Sha256: 0e09e94aa149f1c26eebf185459f3163eeb0e5e051b3c47f96620ab59726504b
Contents?: true
Size: 511 Bytes
Versions: 8
Compression:
Stored size: 511 Bytes
Contents
var test = require('testling'); var vm = require('./'); test('vmRunInNewContext', function (t) { t.plan(5); t.equal(vm.runInNewContext('a + 5', { a : 100 }), 105); (function () { var vars = { x : 10 }; t.equal(vm.runInNewContext('x++', vars), 10); t.equal(vars.x, 11); })(); (function () { var vars = { x : 10 }; t.equal(vm.runInNewContext('var y = 3; y + x++', vars), 13); t.equal(vars.x, 11); })(); t.end(); });
Version data entries
8 entries across 6 versions & 3 rubygems