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

RangeError: Maximum call stack size exceeded on a seemingly simple file #31

Closed
denik opened this issue Feb 24, 2013 · 0 comments
Closed

Comments

@denik
Copy link

denik commented Feb 24, 2013

Parsing a file with a single variable declaration initialized to a big string causes RangeError to be raised.

var acorn = require("./acorn.js");
var fs = require("fs");
fs.readFile("./test/jquery-string.js", function(err, data) {
    if (err) throw err;
    acorn.parse(data);
});
master ~/work/acorn $ node test1.js 

/home/denis/work/acorn/acorn.js:804
        return finishToken(_string, String.fromCharCode.apply(null, rs_str));
                                                        ^
RangeError: Maximum call stack size exceeded
    at readString (/home/denis/work/acorn/acorn.js:804:57)
    at getTokenFromCode (/home/denis/work/acorn/acorn.js:646:14)
    at readToken (/home/denis/work/acorn/acorn.js:692:15)
    at next (/home/denis/work/acorn/acorn.js:936:5)
    at eat (/home/denis/work/acorn/acorn.js:1013:7)
    at parseVar (/home/denis/work/acorn/acorn.js:1370:19)
    at parseStatement (/home/denis/work/acorn/acorn.js:1251:14)
    at parseTopLevel (/home/denis/work/acorn/acorn.js:1073:18)
    at Object.exports.parse (/home/denis/work/acorn/acorn.js:42:12)
    at /home/denis/work/acorn/test1.js:5:11

master ~/work/acorn $ node --version
v0.8.20

master ~/work/acorn $ git describe --tags 
v0.1-3-g782259b

Passing --stack-size=1000 to node seem to fix it, but esprima handles the file without any errors without any additional options, so I'm not sure if that's expected behavior or a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants