mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically. Backport-PR-URL: https://github.com/nodejs/node/pull/11775 PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
1 parent
de63698066
commit
db61c952de
806 files changed
+5031
-4995
No files matched your search
@@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
require('../common');
|
||||
var assert = require('assert');
|
||||
var vm = require('vm');
|
||||
const assert = require('assert');
|
||||
const vm = require('vm');
|
||||
|
||||
// Test 1: vm.runInNewContext
|
||||
var sandbox = {};
|
||||
var result = vm.runInNewContext(
|
||||
const sandbox = {};
|
||||
let result = vm.runInNewContext(
|
||||
'foo = "bar"; this.typeofProcess = typeof process; typeof Object;',
|
||||
sandbox
|
||||
);
|
||||
@@ -16,8 +16,8 @@ assert.deepStrictEqual(sandbox, {
|
||||
assert.strictEqual(result, 'function');
|
||||
|
||||
// Test 2: vm.runInContext
|
||||
var sandbox2 = { foo: 'bar' };
|
||||
var context = vm.createContext(sandbox2);
|
||||
const sandbox2 = { foo: 'bar' };
|
||||
const context = vm.createContext(sandbox2);
|
||||
result = vm.runInContext(
|
||||
'baz = foo; this.typeofProcess = typeof process; typeof Object;',
|
||||
context
|
||||
@@ -45,6 +45,6 @@ assert.strictEqual(global.vmResult, undefined);
|
||||
assert.strictEqual(result, 'undefined');
|
||||
|
||||
// Test 5: vm.createContext
|
||||
var sandbox3 = {};
|
||||
var context2 = vm.createContext(sandbox3);
|
||||
const sandbox3 = {};
|
||||
const context2 = vm.createContext(sandbox3);
|
||||
assert.strictEqual(sandbox3, context2);
|
||||
Reference in new issue
Block a user