From ae8700747866bff3390cf60f580f4c809d4ea7dd Mon Sep 17 00:00:00 2001 From: Sean Coates Date: Sat, 9 Oct 2010 12:25:02 -0400 Subject: [PATCH] add $ to variable name character matching patterns in repl completer --- lib/repl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/repl.js b/lib/repl.js index 5e6de2f720..fcd65e0ca6 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -266,8 +266,8 @@ REPLServer.prototype.complete = function (line) { // spam.eggs.<|> # completions for 'spam.eggs' with filter '' // foo<|> # all scope vars with filter 'foo' // foo.<|> # completions for 'foo' with filter '' - else if (line.length === 0 || line[line.length-1].match(/\w|\./)) { - var simpleExpressionPat = /(([a-zA-Z_]\w*)\.)*([a-zA-Z_]\w*)\.?$/; + else if (line.length === 0 || line[line.length-1].match(/\w|\.|\$/)) { + var simpleExpressionPat = /(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/; match = simpleExpressionPat.exec(line); if (line.length === 0 || match) { var expr;