greybel-interpreter 4.0.13 → 4.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bytecode-generator.js +7 -7
- package/dist/context.js +1 -1
- package/dist/utils/error.d.ts +3 -0
- package/dist/utils/error.js +1 -1
- package/dist/vm/evaluation.js +1 -1
- package/dist/vm.js +5 -2
- package/package.json +1 -1
|
@@ -375,7 +375,7 @@ class BytecodeGenerator {
|
|
|
375
375
|
yield this.processSubNode(node.index);
|
|
376
376
|
this.push({
|
|
377
377
|
op: instruction_1.OpCode.GET_SUPER_PROPERTY,
|
|
378
|
-
source: this.getSourceLocation(
|
|
378
|
+
source: this.getSourceLocation(node.index),
|
|
379
379
|
invoke: isInvoke
|
|
380
380
|
});
|
|
381
381
|
}
|
|
@@ -898,7 +898,7 @@ class BytecodeGenerator {
|
|
|
898
898
|
yield pushArgs();
|
|
899
899
|
this.push({
|
|
900
900
|
op: instruction_1.OpCode.CALL_SUPER_PROPERTY,
|
|
901
|
-
source: this.getSourceLocation(node),
|
|
901
|
+
source: this.getSourceLocation(node.base),
|
|
902
902
|
length: node.arguments.length
|
|
903
903
|
});
|
|
904
904
|
}
|
|
@@ -912,7 +912,7 @@ class BytecodeGenerator {
|
|
|
912
912
|
yield pushArgs();
|
|
913
913
|
this.push({
|
|
914
914
|
op: instruction_1.OpCode.CALL_WITH_CONTEXT,
|
|
915
|
-
source: this.getSourceLocation(
|
|
915
|
+
source: this.getSourceLocation(left.identifier),
|
|
916
916
|
length: node.arguments.length
|
|
917
917
|
});
|
|
918
918
|
}
|
|
@@ -924,7 +924,7 @@ class BytecodeGenerator {
|
|
|
924
924
|
yield pushArgs();
|
|
925
925
|
this.push({
|
|
926
926
|
op: instruction_1.OpCode.CALL_SUPER_PROPERTY,
|
|
927
|
-
source: this.getSourceLocation(
|
|
927
|
+
source: this.getSourceLocation(left.index),
|
|
928
928
|
length: node.arguments.length
|
|
929
929
|
});
|
|
930
930
|
}
|
|
@@ -934,7 +934,7 @@ class BytecodeGenerator {
|
|
|
934
934
|
yield pushArgs();
|
|
935
935
|
this.push({
|
|
936
936
|
op: instruction_1.OpCode.CALL_WITH_CONTEXT,
|
|
937
|
-
source: this.getSourceLocation(
|
|
937
|
+
source: this.getSourceLocation(left.index),
|
|
938
938
|
length: node.arguments.length
|
|
939
939
|
});
|
|
940
940
|
}
|
|
@@ -944,7 +944,7 @@ class BytecodeGenerator {
|
|
|
944
944
|
yield pushArgs();
|
|
945
945
|
this.push({
|
|
946
946
|
op: instruction_1.OpCode.CALL,
|
|
947
|
-
source: this.getSourceLocation(
|
|
947
|
+
source: this.getSourceLocation(left),
|
|
948
948
|
length: node.arguments.length
|
|
949
949
|
});
|
|
950
950
|
}
|
|
@@ -953,7 +953,7 @@ class BytecodeGenerator {
|
|
|
953
953
|
yield pushArgs();
|
|
954
954
|
this.push({
|
|
955
955
|
op: instruction_1.OpCode.CALL,
|
|
956
|
-
source: this.getSourceLocation(
|
|
956
|
+
source: this.getSourceLocation(left),
|
|
957
957
|
length: node.arguments.length
|
|
958
958
|
});
|
|
959
959
|
}
|
package/dist/context.js
CHANGED
package/dist/utils/error.d.ts
CHANGED
package/dist/utils/error.js
CHANGED
|
@@ -5,7 +5,7 @@ class RuntimeError extends Error {
|
|
|
5
5
|
constructor(message, vm, source) {
|
|
6
6
|
var _a;
|
|
7
7
|
super(message);
|
|
8
|
-
this.target = vm === null || vm === void 0 ? void 0 : vm.
|
|
8
|
+
this.target = vm === null || vm === void 0 ? void 0 : vm.getFrame().getCurrentInstruction().source.path;
|
|
9
9
|
this.stackTrace = (_a = vm === null || vm === void 0 ? void 0 : vm.getStacktrace()) !== null && _a !== void 0 ? _a : [];
|
|
10
10
|
this.stack = this.createTrace();
|
|
11
11
|
this.source = source;
|
package/dist/vm/evaluation.js
CHANGED
|
@@ -305,7 +305,7 @@ function evalNotEqual(a, b) {
|
|
|
305
305
|
else if (a instanceof nil_1.CustomNil) {
|
|
306
306
|
return new boolean_1.CustomBoolean(!(b instanceof nil_1.CustomNil));
|
|
307
307
|
}
|
|
308
|
-
return default_1.DefaultType.
|
|
308
|
+
return default_1.DefaultType.True;
|
|
309
309
|
}
|
|
310
310
|
exports.evalNotEqual = evalNotEqual;
|
|
311
311
|
function evalMod(a, b) {
|
package/dist/vm.js
CHANGED
|
@@ -144,6 +144,7 @@ class VM {
|
|
|
144
144
|
return this.stack[--this.sp];
|
|
145
145
|
}
|
|
146
146
|
createFrame(options) {
|
|
147
|
+
this.getFrame().ip--;
|
|
147
148
|
const ctx = this.getFrame().fork({
|
|
148
149
|
code: options.code,
|
|
149
150
|
type: context_1.ContextType.Function,
|
|
@@ -155,7 +156,9 @@ class VM {
|
|
|
155
156
|
return ctx;
|
|
156
157
|
}
|
|
157
158
|
popFrame() {
|
|
158
|
-
|
|
159
|
+
const frame = this.frames.pop();
|
|
160
|
+
this.getFrame().ip++;
|
|
161
|
+
return frame;
|
|
159
162
|
}
|
|
160
163
|
exec() {
|
|
161
164
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -176,7 +179,7 @@ class VM {
|
|
|
176
179
|
const instruction = frame.code[frame.ip++];
|
|
177
180
|
switch (instruction.op) {
|
|
178
181
|
case instruction_1.OpCode.NOOP: {
|
|
179
|
-
|
|
182
|
+
break;
|
|
180
183
|
}
|
|
181
184
|
case instruction_1.OpCode.PUSH: {
|
|
182
185
|
const pushInstruction = instruction;
|