You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
404 B

'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() {
var sandbox = {};
vm.createContext(sandbox);
vm.createContext(sandbox);
});