summaryrefslogtreecommitdiff
path: root/test/parallel/test-vm-function-redefinition.js
diff options
context:
space:
mode:
authorFranziska Hinkelmann <franzih@chromium.org>2016-09-16 15:58:05 +0200
committerMichaƫl Zasso <targos@protonmail.com>2017-01-26 22:46:18 +0100
commitc2c6ae52eaf302da9c106699b69d17c083ced316 (patch)
tree7fcc6e47f7495f0601c45c683087a68af97ca8a2 /test/parallel/test-vm-function-redefinition.js
parentb37f55a1bae12be887a34e4eec7db8408875d405 (diff)
downloadandroid-node-v8-c2c6ae52eaf302da9c106699b69d17c083ced316.tar.gz
android-node-v8-c2c6ae52eaf302da9c106699b69d17c083ced316.tar.bz2
android-node-v8-c2c6ae52eaf302da9c106699b69d17c083ced316.zip
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>
Diffstat (limited to 'test/parallel/test-vm-function-redefinition.js')
-rw-r--r--test/parallel/test-vm-function-redefinition.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-vm-function-redefinition.js b/test/parallel/test-vm-function-redefinition.js
new file mode 100644
index 0000000000..fa1ddde389
--- /dev/null
+++ b/test/parallel/test-vm-function-redefinition.js
@@ -0,0 +1,11 @@
+'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);