JS: fix crash when js function contains assignment with bad LHS
Fix KT-20905
This commit is contained in:
@@ -341,18 +341,12 @@ public class IRFactory {
|
||||
default:
|
||||
// TODO: This should be a ReferenceError--but that's a runtime
|
||||
// exception. Should we compile an exception into the code?
|
||||
reportError("msg.bad.lhs.assign");
|
||||
ts.reportSyntaxError("msg.bad.lhs.assign", null);
|
||||
}
|
||||
|
||||
return new Node(TokenStream.ASSIGN, left, right, nodeOp, location);
|
||||
}
|
||||
|
||||
private void reportError(String msgResource) {
|
||||
|
||||
String message = Context.getMessage0(msgResource);
|
||||
ts.reportSyntaxError(message, null);
|
||||
}
|
||||
|
||||
// Only needed to get file/line information. Could create an interface
|
||||
// that TokenStream implements if we want to make the connection less
|
||||
// direct.
|
||||
|
||||
Reference in New Issue
Block a user