Skip to content

Commit 4118e90

Browse files
Victor Poriazovjasnell
Victor Poriazov
authored andcommitted
test: fix order of assert arguments in vm-new-script-this-context
Fixes the order of assert.strictEqual arguments. PR-URL: #23558 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 2f38550 commit 4118e90

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-vm-new-script-this-context.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Script = require('vm').Script;
2727
// Run a string
2828
let script = new Script('\'passed\';');
2929
const result = script.runInThisContext(script);
30-
assert.strictEqual('passed', result);
30+
assert.strictEqual(result, 'passed');
3131

3232
// Thrown error
3333
script = new Script('throw new Error(\'test\');');
@@ -38,7 +38,7 @@ assert.throws(() => {
3838
global.hello = 5;
3939
script = new Script('hello = 2');
4040
script.runInThisContext(script);
41-
assert.strictEqual(2, global.hello);
41+
assert.strictEqual(global.hello, 2);
4242

4343

4444
// Pass values
@@ -49,15 +49,15 @@ global.foo = 2;
4949
global.obj = { foo: 0, baz: 3 };
5050
script = new Script(global.code);
5151
script.runInThisContext(script);
52-
assert.strictEqual(0, global.obj.foo);
53-
assert.strictEqual(2, global.bar);
54-
assert.strictEqual(1, global.foo);
52+
assert.strictEqual(global.obj.foo, 0);
53+
assert.strictEqual(global.bar, 2);
54+
assert.strictEqual(global.foo, 1);
5555

5656
// Call a function
5757
global.f = function() { global.foo = 100; };
5858
script = new Script('f()');
5959
script.runInThisContext(script);
60-
assert.strictEqual(100, global.foo);
60+
assert.strictEqual(global.foo, 100);
6161

6262
common.allowGlobals(
6363
global.hello,

0 commit comments

Comments
 (0)