// Test 2: vm.runInContext
var sandbox2 = { foo: 'bar' };
var context = vm.createContext(sandbox2);
-var result = vm.runInContext(
+result = vm.runInContext(
'baz = foo; this.typeofProcess = typeof process; typeof Object;',
context
);
assert.strictEqual(result, 'function');
// Test 3: vm.runInThisContext
-var result = vm.runInThisContext(
+result = vm.runInThisContext(
'vmResult = "foo"; Object.prototype.toString.call(process);'
);
assert.strictEqual(global.vmResult, 'foo');
delete global.vmResult;
// Test 4: vm.runInNewContext
-var result = vm.runInNewContext(
+result = vm.runInNewContext(
'vmResult = "foo"; typeof process;'
);
assert.strictEqual(global.vmResult, undefined);
assert.equal(signalCode, null);
}));
-var proc = spawn(process.execPath, [script, 'handle-fatal-exception']);
+proc = spawn(process.execPath, [script, 'handle-fatal-exception']);
proc.stdout.on('data', common.fail);
proc.stderr.on('data', common.fail);
proc.once('exit', common.mustCall(function(exitCode, signalCode) {
assert(sandbox.Proxy !== Proxy);
// Unless we copy the Proxy object explicitly, of course.
-var sandbox = { Proxy: Proxy };
+sandbox = { Proxy: Proxy };
vm.runInNewContext('this.Proxy = Proxy', sandbox);
assert(typeof sandbox.Proxy === 'object');
assert(sandbox.Proxy === Proxy);
assert(sandbox.Symbol !== Symbol);
// Unless we copy the Symbol constructor explicitly, of course.
-var sandbox = { Symbol: Symbol };
+sandbox = { Symbol: Symbol };
vm.runInNewContext('this.Symbol = Symbol', sandbox);
assert(typeof sandbox.Symbol === 'function');
assert(sandbox.Symbol === Symbol);