0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-vm-function-redefinition.js
Franziska Hinkelmann c2c6ae52ea test: move test-vm-function-redefinition to parallel
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>
2017-01-26 22:46:18 +01:00

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);