parent
463df3adf6
commit
ff5e8dc3f5
1 changed files with 3 additions and 0 deletions
3
repl.js
3
repl.js
|
@ -583,6 +583,9 @@ import * as os from "os";
|
||||||
base = get_context_word(line, pos);
|
base = get_context_word(line, pos);
|
||||||
if (["true", "false", "null", "this"].includes(base) || !isNaN(+base))
|
if (["true", "false", "null", "this"].includes(base) || !isNaN(+base))
|
||||||
return eval(base);
|
return eval(base);
|
||||||
|
// Check if `base` is a set of regexp flags
|
||||||
|
if (pos - base.length >= 3 && line[pos - base.length - 1] === '/')
|
||||||
|
return new RegExp('', base);
|
||||||
obj = get_context_object(line, pos - base.length);
|
obj = get_context_object(line, pos - base.length);
|
||||||
if (obj === null || obj === void 0)
|
if (obj === null || obj === void 0)
|
||||||
return obj;
|
return obj;
|
||||||
|
|
Loading…
Reference in a new issue