1'use strict'; 2// https://github.com/nodejs/node/issues/12300 3 4require('../common'); 5const assert = require('assert'); 6const vm = require('vm'); 7 8const ctx = vm.createContext({ x: 42 }); 9 10// This might look as if x has not been declared, but x is defined on the 11// sandbox and the assignment should not throw. 12vm.runInContext('"use strict"; x = 1', ctx); 13 14assert.strictEqual(ctx.x, 1); 15