Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0569bfe

Browse filesBrowse files
Victor PoriazovMylesBorins
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 fc05ca5 commit 0569bfe
Copy full SHA for 0569bfe

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-vm-new-script-this-context.js
+6-6Lines changed: 6 additions & 6 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.