8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f52358 commit 3d45b35Copy full SHA for 3d45b35
lib/repl.js
@@ -39,12 +39,12 @@ const parentModule = module;
39
const replMap = new WeakMap();
40
41
const GLOBAL_OBJECT_PROPERTIES = ['NaN', 'Infinity', 'undefined',
42
- 'eval', 'parseInt', 'parseFloat', 'isNaN', 'isFinite', 'decodeURI',
43
- 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
44
- 'Object', 'Function', 'Array', 'String', 'Boolean', 'Number',
45
- 'Date', 'RegExp', 'Error', 'EvalError', 'RangeError',
46
- 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError',
47
- 'Math', 'JSON'];
+ 'eval', 'parseInt', 'parseFloat', 'isNaN', 'isFinite', 'decodeURI',
+ 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
+ 'Object', 'Function', 'Array', 'String', 'Boolean', 'Number',
+ 'Date', 'RegExp', 'Error', 'EvalError', 'RangeError',
+ 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError',
+ 'Math', 'JSON'];
48
const GLOBAL_OBJECT_PROPERTY_MAP = {};
49
GLOBAL_OBJECT_PROPERTIES.forEach((p) => GLOBAL_OBJECT_PROPERTY_MAP[p] = p);
50
@@ -622,7 +622,7 @@ ArrayStream.prototype.writable = true;
622
ArrayStream.prototype.resume = function() {};
623
ArrayStream.prototype.write = function() {};
624
625
-const requireRE = /\brequire\s*\(['"](([\w\.\/-]+\/)?([\w\.\/-]*))/;
+const requireRE = /\brequire\s*\(['"](([\w./-]+\/)?([\w./-]*))/;
626
const simpleExpressionRE =
627
/(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/;
628
@@ -870,7 +870,7 @@ REPLServer.prototype.complete = function(line, callback) {
870
var newCompletionGroups = [];
871
for (i = 0; i < completionGroups.length; i++) {
872
group = completionGroups[i].filter(function(elem) {
873
- return elem.indexOf(filter) == 0;
+ return elem.indexOf(filter) === 0;
874
});
875
if (group.length) {
876
newCompletionGroups.push(group);
@@ -1124,8 +1124,8 @@ function regexpEscape(s) {
1124
* @return {String} The converted command.
1125
*/
1126
REPLServer.prototype.convertToContext = function(cmd) {
1127
- const scopeVar = /^\s*var\s*([_\w\$]+)(.*)$/m;
1128
- const scopeFunc = /^\s*function\s*([_\w\$]+)/;
+ const scopeVar = /^\s*var\s*([\w$]+)(.*)$/m;
+ const scopeFunc = /^\s*function\s*([\w$]+)/;
1129
var matches;
1130
1131
// Replaces: var foo = "bar"; with: self.context.foo = bar;