mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
update test/parallel/test-vm-create-context-arg.js in line 27 to change `TypeError` to the regular expression with the `/^TypeError: sandbox must be an object$/`. PR-URL: https://github.com/nodejs/node/pull/14266 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
20 lines
437 B
JavaScript
20 lines
437 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const vm = require('vm');
|
|
|
|
assert.throws(function() {
|
|
vm.createContext('string is not supported');
|
|
}, /^TypeError: sandbox must be an object$/);
|
|
|
|
assert.doesNotThrow(function() {
|
|
vm.createContext({ a: 1 });
|
|
vm.createContext([0, 1, 2, 3]);
|
|
});
|
|
|
|
assert.doesNotThrow(function() {
|
|
const sandbox = {};
|
|
vm.createContext(sandbox);
|
|
vm.createContext(sandbox);
|
|
});
|