Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix redeclared vars in test-vm-* #4997

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);