Skip to content

Commit

Permalink
test: replace var with const
Browse files Browse the repository at this point in the history
Replace `var` with `const` in vm context for test-util-inspect.js.

PR-URL: #36069
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information
arsenalzp authored and BethGriggs committed Dec 9, 2020
1 parent 7ec261c commit 06d4f16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,9 @@ assert.strictEqual(util.inspect(-5e-324), '-5e-324');
{
let obj = vm.runInNewContext('(function(){return {}})()', {});
assert.strictEqual(util.inspect(obj), '{}');
obj = vm.runInNewContext('var m=new Map();m.set(1,2);m', {});
obj = vm.runInNewContext('const m=new Map();m.set(1,2);m', {});
assert.strictEqual(util.inspect(obj), 'Map(1) { 1 => 2 }');
obj = vm.runInNewContext('var s=new Set();s.add(1);s.add(2);s', {});
obj = vm.runInNewContext('const s=new Set();s.add(1);s.add(2);s', {});
assert.strictEqual(util.inspect(obj), 'Set(2) { 1, 2 }');
obj = vm.runInNewContext('fn=function(){};new Promise(fn,fn)', {});
assert.strictEqual(util.inspect(obj), 'Promise { <pending> }');
Expand Down

0 comments on commit 06d4f16

Please sign in to comment.