test: fix redeclared vars in test-vm-*

PR-URL: https://github.com/nodejs/node/pull/4997
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott 2016-01-30 22:44:26 -08:00 committed by James M Snell
parent f3be421c1c
commit 5f44475b5a
4 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ assert.strictEqual(result, 'function');
// 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
);
@ -30,7 +30,7 @@ assert.deepEqual(sandbox2, {
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');
@ -38,7 +38,7 @@ assert.strictEqual(result, '[object process]');
delete global.vmResult;
// Test 4: vm.runInNewContext
var result = vm.runInNewContext(
result = vm.runInNewContext(
'vmResult = "foo"; typeof process;'
);
assert.strictEqual(global.vmResult, undefined);

View File

@ -87,7 +87,7 @@ proc.once('exit', common.mustCall(function(exitCode, signalCode) {
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) {

View File

@ -13,7 +13,7 @@ assert(typeof sandbox.Proxy === 'object');
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);

View File

@ -10,7 +10,7 @@ assert(typeof sandbox.Symbol === 'function');
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);