mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 22:56:06 +00:00

Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
20 lines
406 B
JavaScript
20 lines
406 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const vm = require('vm');
|
|
|
|
assert.throws(function() {
|
|
vm.createContext('string is not supported');
|
|
}, TypeError);
|
|
|
|
assert.doesNotThrow(function() {
|
|
vm.createContext({ a: 1 });
|
|
vm.createContext([0, 1, 2, 3]);
|
|
});
|
|
|
|
assert.doesNotThrow(function() {
|
|
const sandbox = {};
|
|
vm.createContext(sandbox);
|
|
vm.createContext(sandbox);
|
|
});
|