greybel-interpreter 5.6.0 → 5.6.2
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/types/map.js +1 -1
- package/dist/vm.js +12 -0
- package/package.json +1 -1
package/dist/types/map.js
CHANGED
|
@@ -61,7 +61,7 @@ class CustomMap extends with_intrinsics_1.CustomObject {
|
|
|
61
61
|
const entries = this.value.entries();
|
|
62
62
|
for (let index = 0; index < entries.length; index++) {
|
|
63
63
|
const [key, value] = entries[index];
|
|
64
|
-
fields.push(`${key instanceof CustomMap ? key.toJSON(depth + 1) : key.toJSON(depth)}
|
|
64
|
+
fields.push(`${key instanceof CustomMap ? key.toJSON(depth + 1) : key.toJSON(depth)}: ${value instanceof CustomMap
|
|
65
65
|
? value.toJSON(depth + 1)
|
|
66
66
|
: value.toJSON(depth)}`);
|
|
67
67
|
}
|
package/dist/vm.js
CHANGED
|
@@ -223,14 +223,26 @@ class VM {
|
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
225
|
case instruction_1.OpCode.GET_GLOBALS: {
|
|
226
|
+
if (frame.locals.scope.has(string_1.Globals)) {
|
|
227
|
+
this.pushStack(frame.locals.scope.get(string_1.Globals, this.contextTypeIntrinsics));
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
226
230
|
this.pushStack(frame.globals.scope);
|
|
227
231
|
break;
|
|
228
232
|
}
|
|
229
233
|
case instruction_1.OpCode.GET_OUTER: {
|
|
234
|
+
if (frame.locals.scope.has(string_1.Outer)) {
|
|
235
|
+
this.pushStack(frame.locals.scope.get(string_1.Outer, this.contextTypeIntrinsics));
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
230
238
|
this.pushStack(((_a = frame.outer) !== null && _a !== void 0 ? _a : frame.globals).scope);
|
|
231
239
|
break;
|
|
232
240
|
}
|
|
233
241
|
case instruction_1.OpCode.GET_LOCALS: {
|
|
242
|
+
if (frame.locals.scope.has(string_1.Locals)) {
|
|
243
|
+
this.pushStack(frame.locals.scope.get(string_1.Locals, this.contextTypeIntrinsics));
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
234
246
|
this.pushStack(frame.locals.scope);
|
|
235
247
|
break;
|
|
236
248
|
}
|