Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-vm-create-context-arg.js « parallel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 91bbbc3b7793bc6e9909355efc148846fecf21a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'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);
});