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

acorn loose throwing unexpected SyntaxError: Escape sequence in keyword function #1139

Closed
abose opened this issue Jul 30, 2022 · 1 comment
Closed

Comments

@abose
Copy link

abose commented Jul 30, 2022

Hi,

I am integrating the latest tern and acorn into brackets code editor. But a few of our integration tests for acorn loose error tolerant parser is failing as it is throwing errors. I have added the minimal test that fails below:

acorn_loose.parse('function unicodeTabAfter\\u0009() {}');
Caught Critical error from: http://localhost:8000/src/thirdparty/acorn/dist/acorn_loose.js:248 message: Uncaught SyntaxError: Escape sequence in keyword function (1:9) 11 SyntaxError: Escape sequence in keyword function (1:9) (at acorn.js:2927:15)
    at pp$4.raise (acorn.js:2927:15)
    at pp$9.next (acorn.js:4349:14)
    at lp.readToken (acorn_loose.js:204:19)
    at lp.next (acorn_loose.js:190:25)
    at lp$2.parseIdent (acorn_loose.js:1225:10)
    at lp$1.parseFunction (acorn_loose.js:632:65)
    at lp$1.parseStatement (acorn_loose.js:365:19)
    at lp$1.parseTopLevel (acorn_loose.js:295:72)
    at LooseParser.parse (acorn_loose.js:160:17)
    at Function.parse (acorn_loose.js:173:37)
window.onerror @ main.js:129
acorn_loose.js:248 Uncaught SyntaxError: Escape sequence in keyword function (1:9) (at acorn.js:2927:15)
    at pp$4.raise (acorn.js:2927:15)
    at pp$9.next (acorn.js:4349:14)
    at lp.readToken (acorn_loose.js:204:19)
    at lp.next (acorn_loose.js:190:25)
    at lp$2.parseIdent (acorn_loose.js:1225:10)
    at lp$1.parseFunction (acorn_loose.js:632:65)
    at lp$1.parseStatement (acorn_loose.js:365:19)
    at lp$1.parseTopLevel (acorn_loose.js:295:72)
    at LooseParser.parse (acorn_loose.js:160:17)
    at Function.parse (acorn_loose.js:173:37)
pp$4.raise @ acorn.js:2927
pp$9.next @ acorn.js:4349
lp.readToken @ acorn_loose.js:204
lp.next @ acorn_loose.js:190
lp$2.parseIdent @ acorn_loose.js:1225
lp$1.parseFunction @ acorn_loose.js:632
lp$1.parseStatement @ acorn_loose.js:365
lp$1.parseTopLevel @ acorn_loose.js:295
parse @ acorn_loose.js:160
parse @ acorn_loose.js:173
parse @ acorn_loose.js:1366
(anonymous) @ VM10980:1

Requesting for help!

@abose
Copy link
Author

abose commented Aug 2, 2022

Thanks for the quick fix @marijnh

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

1 participant