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

rohanpadhye opened this issue Mar 11, 2018 · 1 comment


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(
	at org.mozilla.javascript.Parser.createDestructuringAssignment(
	at org.mozilla.javascript.IRFactory.createAssignment(
	at org.mozilla.javascript.IRFactory.transformAssignment(
	at org.mozilla.javascript.IRFactory.transform(
	at org.mozilla.javascript.IRFactory.transformExprStmt(
	at org.mozilla.javascript.IRFactory.transform(
	at org.mozilla.javascript.IRFactory.transformScript(
	at org.mozilla.javascript.IRFactory.transform(
	at org.mozilla.javascript.IRFactory.transformTree(
	at org.mozilla.javascript.Context.compileImpl(
	at org.mozilla.javascript.Context.compileString(
	at org.mozilla.javascript.Context.compileString(

Found using JQF.


This comment has been minimized.

Copy link

@rohanpadhye rohanpadhye commented Mar 18, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.