summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-new-script-this-context.js
diff options
context:
space:
mode:
authorVictor Poriazov <vporiazov2@bloomberg.net>2018-10-12 13:55:28 -0400
committerRuben Bridgewater <ruben@bridgewater.de>2018-10-15 12:08:04 +0200
commitc0014d5ff01a3988c8f49b668b6ca24a8ad45cc8 (patch)
treecc60be29bc6808049d795393dbd28d0b7f23efc9 /test/parallel/test-vm-new-script-this-context.js
parenta5a1e9a2e4197e8b5a4a324420e042e4ee61ed10 (diff)
downloadandroid-node-v8-c0014d5ff01a3988c8f49b668b6ca24a8ad45cc8.tar.gz
android-node-v8-c0014d5ff01a3988c8f49b668b6ca24a8ad45cc8.tar.bz2
android-node-v8-c0014d5ff01a3988c8f49b668b6ca24a8ad45cc8.zip
test: fix order of assert arguments in vm-new-script-this-context
Fixes the order of assert.strictEqual arguments. PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test/parallel/test-vm-new-script-this-context.js')
-rw-r--r--test/parallel/test-vm-new-script-this-context.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/parallel/test-vm-new-script-this-context.js b/test/parallel/test-vm-new-script-this-context.js
index 2c0c21690e..18f39f9086 100644
--- a/test/parallel/test-vm-new-script-this-context.js
+++ b/test/parallel/test-vm-new-script-this-context.js
@@ -27,7 +27,7 @@ const Script = require('vm').Script;
// Run a string
let script = new Script('\'passed\';');
const result = script.runInThisContext(script);
-assert.strictEqual('passed', result);
+assert.strictEqual(result, 'passed');
// Thrown error
script = new Script('throw new Error(\'test\');');
@@ -38,7 +38,7 @@ assert.throws(() => {
global.hello = 5;
script = new Script('hello = 2');
script.runInThisContext(script);
-assert.strictEqual(2, global.hello);
+assert.strictEqual(global.hello, 2);
// Pass values
@@ -49,15 +49,15 @@ global.foo = 2;
global.obj = { foo: 0, baz: 3 };
script = new Script(global.code);
script.runInThisContext(script);
-assert.strictEqual(0, global.obj.foo);
-assert.strictEqual(2, global.bar);
-assert.strictEqual(1, global.foo);
+assert.strictEqual(global.obj.foo, 0);
+assert.strictEqual(global.bar, 2);
+assert.strictEqual(global.foo, 1);
// Call a function
global.f = function() { global.foo = 100; };
script = new Script('f()');
script.runInThisContext(script);
-assert.strictEqual(100, global.foo);
+assert.strictEqual(global.foo, 100);
common.allowGlobals(
global.hello,