Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: preventing recursive eval of RegEx predefined properties #2137

Commits on Jul 30, 2015

  1. repl: preventing recursive eval of RegEx predefined properties

    Fixes: nodejs#597
    
    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 evluated `RegExp.$1` recursively and
    eventually throw `RangeError: Maximum call stack size exceeded`.
    
    This patch stores the old values of `RegExp`'s predefined proprties and
    restores them just before the current expression entered by user is
    evaluated.
    thefourtheye committed Jul 30, 2015
    Configuration menu
    Copy the full SHA
    b1acd42 View commit details
    Browse the repository at this point in the history