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

FAILED ASSERTION due to malformed destructuring syntax #405

Closed
rohanpadhye opened this issue Mar 11, 2018 · 3 comments · Fixed by #1519
Closed

FAILED ASSERTION due to malformed destructuring syntax #405

rohanpadhye opened this issue Mar 11, 2018 · 3 comments · Fixed by #1519
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec

Comments

@rohanpadhye
Copy link

Rhino 1.7.8:

[x (y)] = 2, 3

Expected: syntax error (EvaluatorException)

Instead, I get:

java.lang.IllegalStateException: FAILED ASSERTION: unexpected token: CALL
	at org.mozilla.javascript.Kit.codeBug(Kit.java:433)
	at org.mozilla.javascript.IRFactory.decompile(IRFactory.java:2407)
	at org.mozilla.javascript.IRFactory.decompileArrayLiteral(IRFactory.java:2419)
	at org.mozilla.javascript.IRFactory.decompile(IRFactory.java:2381)
	at org.mozilla.javascript.IRFactory.transformAssignment(IRFactory.java:426)
	at org.mozilla.javascript.IRFactory.transform(IRFactory.java:212)
	at org.mozilla.javascript.IRFactory.transformExprStmt(IRFactory.java:516)
	at org.mozilla.javascript.IRFactory.transform(IRFactory.java:209)
	at org.mozilla.javascript.IRFactory.transformScript(IRFactory.java:1042)
	at org.mozilla.javascript.IRFactory.transform(IRFactory.java:192)
	at org.mozilla.javascript.IRFactory.transformTree(IRFactory.java:117)
	at org.mozilla.javascript.Context.compileImpl(Context.java:2540)
	at org.mozilla.javascript.Context.compileString(Context.java:1507)
	at org.mozilla.javascript.Context.compileString(Context.java:1496)

Found using JQF.

@rohanpadhye
Copy link
Author

rohanpadhye commented Mar 18, 2019

Hi, it's been more than one year since this was first reported. Are there any updates?

@p-bakker
Copy link
Collaborator

p-bakker commented Jul 5, 2021

Such code should throw a SyntaxError (nowadays)

@p-bakker p-bakker added the bug Issues considered a bug label Jul 5, 2021
@p-bakker p-bakker added the Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec label Oct 14, 2021
@tuchida
Copy link
Contributor

tuchida commented Jul 16, 2024

ref. #1519, #1520
Applying these will correct the problem.

$ ./gradlew run -q --console=plain --args="-version 200"
Rhino 1.7.16-SNAPSHOT
js> [x (y)] = 2, 3
js: line 2: Invalid assignment left-hand side.
js: 
js: ^
js: line 2: Compilation produced 1 syntax errors.

@p-bakker p-bakker linked a pull request Jul 16, 2024 that will close this issue
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
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants