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

ClassCastException when compiling malformed destructuring expression #406

Open
rohanpadhye opened this issue Mar 11, 2018 · 1 comment
Open

Comments

@rohanpadhye
Copy link

@rohanpadhye rohanpadhye commented Mar 11, 2018

Input to Rhino 1.7.8:

(1 ? ({x: (y)}) : (490)) = 1

Expected: ReferenceError (Invalid left-hand side in assignment)
Instead, I get:

java.lang.ClassCastException: org.mozilla.javascript.Node cannot be cast to org.mozilla.javascript.ast.ObjectLiteral

	at org.mozilla.javascript.Parser.destructuringAssignmentHelper(Parser.java:3932)
	at org.mozilla.javascript.Parser.createDestructuringAssignment(Parser.java:3902)
	at org.mozilla.javascript.IRFactory.createAssignment(IRFactory.java:2235)
	at org.mozilla.javascript.IRFactory.transformAssignment(IRFactory.java:432)
	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 rohanpadhye commented Mar 18, 2019

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

@p-bakker p-bakker added the bug label Jul 5, 2021
@p-bakker p-bakker added this to To do in v2.0.0 via automation Oct 14, 2021
@p-bakker p-bakker moved this from To do to bugs in v2.0.0 Oct 14, 2021
@p-bakker p-bakker added this to To do in v1.7.15 via automation Oct 14, 2021
@p-bakker p-bakker moved this from To do to To do: bugs (v2.0.0 prep) in v1.7.15 Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v1.7.15
To do: bugs (v2.0.0 prep)
v2.0.0
To do: bugs
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants