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

IllegalArgumentException in Label.setName #663

Open
jon-bell opened this issue May 7, 2020 · 1 comment
Open

IllegalArgumentException in Label.setName #663

jon-bell opened this issue May 7, 2020 · 1 comment
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec

Comments

@jon-bell
Copy link

jon-bell commented May 7, 2020

We ran into an unexpected IllegalArgumentException when attempting to compile the following string using Rhino 1.7.12: \u000a:S<6

Stack trace:

Exception in thread "main" java.lang.IllegalArgumentException: invalid label name
	at org.mozilla.javascript.ast.Label.setName(Label.java:57)
	at org.mozilla.javascript.Parser.name(Parser.java:3236)
	at org.mozilla.javascript.Parser.primaryExpr(Parser.java:3125)
	at org.mozilla.javascript.Parser.memberExpr(Parser.java:2732)
	at org.mozilla.javascript.Parser.unaryExpr(Parser.java:2626)
	at org.mozilla.javascript.Parser.mulExpr(Parser.java:2547)
	at org.mozilla.javascript.Parser.addExpr(Parser.java:2531)
	at org.mozilla.javascript.Parser.shiftExpr(Parser.java:2512)
	at org.mozilla.javascript.Parser.relExpr(Parser.java:2487)
	at org.mozilla.javascript.Parser.eqExpr(Parser.java:2459)
	at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:2448)
	at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:2437)
	at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:2426)
	at org.mozilla.javascript.Parser.andExpr(Parser.java:2415)
	at org.mozilla.javascript.Parser.orExpr(Parser.java:2404)
	at org.mozilla.javascript.Parser.condExpr(Parser.java:2368)
	at org.mozilla.javascript.Parser.assignExpr(Parser.java:2324)
	at org.mozilla.javascript.Parser.expr(Parser.java:2303)
	at org.mozilla.javascript.Parser.nameOrLabel(Parser.java:2052)
	at org.mozilla.javascript.Parser.statementHelper(Parser.java:1252)
	at org.mozilla.javascript.Parser.statement(Parser.java:1116)
	at org.mozilla.javascript.Parser.parse(Parser.java:653)
	at org.mozilla.javascript.Parser.parse(Parser.java:583)
	at org.mozilla.javascript.Context.parse(Context.java:2572)
	at org.mozilla.javascript.Context.compileImpl(Context.java:2521)
	at org.mozilla.javascript.Context.compileString(Context.java:1525)
	at org.mozilla.javascript.Context.compileString(Context.java:1514)
@rbri
Copy link
Collaborator

rbri commented May 31, 2020

Can you please prepare a simple test case to make it easy for us to reproduce this.

You can have a look at the packages org.mozilla.javascript.tests.es5 or org.mozilla.javascript.tests.es6 for sample tests.

@p-bakker p-bakker added the bug Issues considered a bug label Jun 30, 2021
@p-bakker p-bakker added the Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec label Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec
Projects
None yet
Development

No branches or pull requests

3 participants