test: fix redeclared vars in test-vm-*
authorRich Trott <rtrott@gmail.com>
Sun, 31 Jan 2016 06:44:26 +0000 (22:44 -0800)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
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>
test/parallel/test-vm-basic.js
test/parallel/test-vm-debug-context.js
test/parallel/test-vm-harmony-proxies.js
test/parallel/test-vm-harmony-symbols.js

index 8f9cab9..f08c838 100644 (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);
index b648592..7789ddc 100644 (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) {
index 78ee144..71d9faf 100644 (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);
index e4b27c9..456a28f 100644 (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);