Skip to content

Commit

Permalink
test: fix redeclared vars in test-vm-*
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
Trott authored and jasnell committed Feb 1, 2016
1 parent f3be421 commit 5f44475
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-vm-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -30,15 +30,15 @@ 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');
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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-vm-debug-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-vm-harmony-proxies.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion test/parallel/test-vm-harmony-symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 5f44475

Please sign in to comment.