From 5f44475b5ad9a7ddf6aea4350c0dc9cced4954e8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 30 Jan 2016 22:44:26 -0800 Subject: [PATCH] test: fix redeclared vars in test-vm-* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/4997 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/parallel/test-vm-basic.js | 6 +++--- test/parallel/test-vm-debug-context.js | 2 +- test/parallel/test-vm-harmony-proxies.js | 2 +- test/parallel/test-vm-harmony-symbols.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index 8f9cab90eb5a1b..f08c8383b84a18 100644 --- a/test/parallel/test-vm-basic.js +++ b/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); diff --git a/test/parallel/test-vm-debug-context.js b/test/parallel/test-vm-debug-context.js index b648592eaea901..7789ddc83fc18e 100644 --- a/test/parallel/test-vm-debug-context.js +++ b/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) { diff --git a/test/parallel/test-vm-harmony-proxies.js b/test/parallel/test-vm-harmony-proxies.js index 78ee144582741a..71d9faffd9cedf 100644 --- a/test/parallel/test-vm-harmony-proxies.js +++ b/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); diff --git a/test/parallel/test-vm-harmony-symbols.js b/test/parallel/test-vm-harmony-symbols.js index e4b27c9ebb8579..456a28f4d54215 100644 --- a/test/parallel/test-vm-harmony-symbols.js +++ b/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);