We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 644d990 commit 1e231baCopy full SHA for 1e231ba
test/known_issues/test-vm-strict-mode.js
@@ -0,0 +1,17 @@
1
+'use strict';
2
+// https://github.com/nodejs/node/issues/12300
3
+
4
+require('../common');
5
+const assert = require('assert');
6
+const vm = require('vm');
7
8
+const ctx = vm.createContext({ x: 42 });
9
10
+// The following line wrongly throws an
11
+// error because GlobalPropertySetterCallback()
12
+// does not check if the property exists
13
+// on the sandbox. It should just set x to 1
14
+// instead of throwing an error.
15
+vm.runInContext('"use strict"; x = 1', ctx);
16
17
+assert.strictEqual(ctx.x, 1);
0 commit comments