mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
c2c6ae52ea
With the upstream fix in V8, function declarations now work fine in the vm module and the test is no longer failing. Refs: https://codereview.chromium.org/2334733002 Fixes: https://github.com/nodejs/node/issues/548 PR-URL: https://github.com/nodejs/node/pull/9618 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
12 lines
384 B
JavaScript
12 lines
384 B
JavaScript
'use strict';
|
|
// Refs: https://github.com/nodejs/node/issues/548
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const vm = require('vm');
|
|
const context = vm.createContext();
|
|
|
|
vm.runInContext('function test() { return 0; }', context);
|
|
vm.runInContext('function test() { return 1; }', context);
|
|
const result = vm.runInContext('test()', context);
|
|
assert.strictEqual(result, 1);
|