summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl.js
diff options
context:
space:
mode:
authorPrince J Wesley <princejohnwesley@gmail.com>2016-07-09 04:29:23 +0530
committerLance Ball <lball@redhat.com>2016-07-15 13:44:34 -0400
commitbb9eabec40ed95e0193d08bf3f9b16d774904a17 (patch)
treebe691be6503e52d4105949e42ce2aad612dbc217 /test/parallel/test-repl.js
parent5aac4c42da104c30d8f701f1042d61c2f06b7e6c (diff)
downloadandroid-node-v8-bb9eabec40ed95e0193d08bf3f9b16d774904a17.tar.gz
android-node-v8-bb9eabec40ed95e0193d08bf3f9b16d774904a17.tar.bz2
android-node-v8-bb9eabec40ed95e0193d08bf3f9b16d774904a17.zip
repl: Mitigate vm #548 function redefinition issue
```js node 🙈 ₹ git:(upstream ⚡ repl-tmp-548) ./node > function name() { return "node"; }; undefined > name() 'node' > function name() { return "nodejs"; }; undefined > name() 'nodejs' > ``` Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Lance Ball <lball@redhat.com>
Diffstat (limited to 'test/parallel/test-repl.js')
-rw-r--r--test/parallel/test-repl.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js
index f321f43174..7936967202 100644
--- a/test/parallel/test-repl.js
+++ b/test/parallel/test-repl.js
@@ -328,6 +328,11 @@ function error_test() {
// or block comment. https://github.com/nodejs/node/issues/3611
{ client: client_unix, send: 'a = 3.5e',
expect: /^SyntaxError: Invalid or unexpected token/ },
+ // Mitigate https://github.com/nodejs/node/issues/548
+ { client: client_unix, send: 'function name(){ return "node"; };name()',
+ expect: "'node'\n" + prompt_unix },
+ { client: client_unix, send: 'function name(){ return "nodejs"; };name()',
+ expect: "'nodejs'\n" + prompt_unix },
]);
}