aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-new-script-new-context.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-07-24 12:08:28 -0700
committerJames M Snell <jasnell@gmail.com>2017-08-03 11:00:23 -0700
commit4b23b429818d3fef1714cbdea4c6a1fd06410a5f (patch)
treecd80c04fde27527616c62bcaaba8351cf2844f51 /test/parallel/test-vm-new-script-new-context.js
parentd41423fe72a86d84998a1b2cb915b0888369aaa7 (diff)
downloadandroid-node-v8-4b23b429818d3fef1714cbdea4c6a1fd06410a5f.tar.gz
android-node-v8-4b23b429818d3fef1714cbdea4c6a1fd06410a5f.tar.bz2
android-node-v8-4b23b429818d3fef1714cbdea4c6a1fd06410a5f.zip
test: improve multiple vm tests
PR-URL: https://github.com/nodejs/node/pull/14458 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'test/parallel/test-vm-new-script-new-context.js')
-rw-r--r--test/parallel/test-vm-new-script-new-context.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-vm-new-script-new-context.js b/test/parallel/test-vm-new-script-new-context.js
index 045c37ce33..7015499879 100644
--- a/test/parallel/test-vm-new-script-new-context.js
+++ b/test/parallel/test-vm-new-script-new-context.js
@@ -36,14 +36,14 @@ const Script = require('vm').Script;
{
const script = new Script('throw new Error(\'test\');');
- assert.throws(function() {
+ assert.throws(() => {
script.runInNewContext();
}, /^Error: test$/);
}
{
const script = new Script('foo.bar = 5;');
- assert.throws(function() {
+ assert.throws(() => {
script.runInNewContext();
}, /^ReferenceError: foo is not defined$/);
}
@@ -94,14 +94,14 @@ const Script = require('vm').Script;
script.runInNewContext({ f: f });
assert.strictEqual(f.a, 2);
- assert.throws(function() {
+ assert.throws(() => {
script.runInNewContext();
}, /^ReferenceError: f is not defined$/);
}
{
const script = new Script('');
- assert.throws(function() {
+ assert.throws(() => {
script.runInNewContext.call('\'hello\';');
}, /^TypeError: this\.runInContext is not a function$/);
}