summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWeijia Wang <starkwang@126.com>2018-06-27 12:57:57 +0800
committerWeijia Wang <381152119@qq.com>2018-07-02 23:04:04 +0800
commit4f151228472d80a4583f90aeeaaec1bdc4446fe0 (patch)
treed7b85ad5814190583770a2a65ed8ee0e84f3d4e3 /test
parent484c6c31b068fb64fa8b4bd46b82bc09a54a6a17 (diff)
downloadandroid-node-v8-4f151228472d80a4583f90aeeaaec1bdc4446fe0.tar.gz
android-node-v8-4f151228472d80a4583f90aeeaaec1bdc4446fe0.tar.bz2
android-node-v8-4f151228472d80a4583f90aeeaaec1bdc4446fe0.zip
repl: fix tab completion for object properties with special char
The old RegExp will pass property names like `"hello world!"` when filtering the results of tab complete. This change is to fix it. Fixes: https://github.com/nodejs/node/issues/21201 PR-URL: https://github.com/nodejs/node/pull/21556 Fixes: https://github.com/nodejs/node/issues/21201 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-repl-tab-complete.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js
index 57c1615e6f..0e6c4bb654 100644
--- a/test/parallel/test-repl-tab-complete.js
+++ b/test/parallel/test-repl-tab-complete.js
@@ -369,6 +369,12 @@ putIn.run(['.clear']);
testMe.complete('.b', common.mustCall((error, data) => {
assert.deepStrictEqual(data, [['break'], 'b']);
}));
+putIn.run(['.clear']);
+putIn.run(['var obj = {"hello, world!": "some string", "key": 123}']);
+testMe.complete('obj.', common.mustCall((error, data) => {
+ assert.strictEqual(data[0].includes('obj.hello, world!'), false);
+ assert(data[0].includes('obj.key'));
+}));
// tab completion for large buffer
const warningRegEx = new RegExp(