|
@ -42,7 +42,6 @@ result = script.runInContext(context); |
|
|
assert.equal(3, context.foo); |
|
|
assert.equal(3, context.foo); |
|
|
assert.equal('lala', context.thing); |
|
|
assert.equal('lala', context.thing); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Issue GH-227:
|
|
|
// Issue GH-227:
|
|
|
Script.runInNewContext('', null, 'some.js'); |
|
|
Script.runInNewContext('', null, 'some.js'); |
|
|
|
|
|
|
|
@ -69,3 +68,10 @@ function isTypeError(o) { |
|
|
assert.throws(function() { script.runInContext(e); }, isTypeError); |
|
|
assert.throws(function() { script.runInContext(e); }, isTypeError); |
|
|
assert.throws(function() { vm.runInContext('', e); }, isTypeError); |
|
|
assert.throws(function() { vm.runInContext('', e); }, isTypeError); |
|
|
})); |
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
// Issue GH-693:
|
|
|
|
|
|
common.debug('test RegExp as argument to assert.throws'); |
|
|
|
|
|
script = vm.createScript('var assert = require(\'assert\'); assert.throws(' + |
|
|
|
|
|
'function() { throw "hello world"; }, /hello/);', |
|
|
|
|
|
'some.js'); |
|
|
|
|
|
script.runInNewContext({ require : require }); |
|
|