mirror of https://github.com/lukechilds/node.git
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.
19 lines
431 B
19 lines
431 B
13 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
var vm = require('vm');
|
||
|
|
||
|
assert.throws(function() {
|
||
|
var ctx = vm.createContext('string is not supported');
|
||
12 years ago
|
}, TypeError);
|
||
13 years ago
|
|
||
|
assert.doesNotThrow(function() {
|
||
|
var ctx = vm.createContext({ a: 1 });
|
||
|
ctx = vm.createContext([0, 1, 2, 3]);
|
||
|
});
|
||
12 years ago
|
|
||
|
assert.doesNotThrow(function() {
|
||
|
var sandbox = {};
|
||
|
vm.createContext(sandbox);
|
||
|
vm.createContext(sandbox);
|
||
|
});
|