Browse Source

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>
process-exit-stdio-flushing
Rich Trott 9 years ago
committed by James M Snell
parent
commit
5f44475b5a
  1. 6
      test/parallel/test-vm-basic.js
  2. 2
      test/parallel/test-vm-debug-context.js
  3. 2
      test/parallel/test-vm-harmony-proxies.js
  4. 2
      test/parallel/test-vm-harmony-symbols.js

6
test/parallel/test-vm-basic.js

@ -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);

2
test/parallel/test-vm-debug-context.js

@ -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) {

2
test/parallel/test-vm-harmony-proxies.js

@ -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);

2
test/parallel/test-vm-harmony-symbols.js

@ -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);

Loading…
Cancel
Save