-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repl: don't clobber RegExp.$ properties
In REPL, if we evaluate the `RegExp` object's predefined properties, and if they happen to have the same expression, for example, > RegExp.$1 'RegExp.$1' then doing `eval(RegExp.$1)` would evaluate `RegExp.$1` recursively and eventually throw `RangeError: Maximum call stack size exceeded`. This patch stores the old values of `RegExp`'s predefined proprties in an array and restores them just before the current expression entered by user is evaluated. Fixes: #597 PR-URL: #2137 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information
1 parent
64cf711
commit ea05e76
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters