mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Fix bug 114491: if (true) function f(){}()
This commit is contained in:
parent
d74a3b867a
commit
cd3ab305ae
@ -82,6 +82,11 @@ public class IRFactory {
|
||||
return new Node(nodeType, nodeOp);
|
||||
}
|
||||
|
||||
public int getLeafType(Object leaf) {
|
||||
Node n = (Node) leaf;
|
||||
return n.getType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Statement leaf nodes.
|
||||
*/
|
||||
|
@ -809,8 +809,12 @@ class Parser {
|
||||
return pn;
|
||||
}
|
||||
|
||||
if (lastExprType == ts.FUNCTION)
|
||||
if (lastExprType == ts.FUNCTION) {
|
||||
if (nf.getLeafType(pn) != ts.FUNCTION) {
|
||||
reportError(ts, "msg.syntax");
|
||||
}
|
||||
nf.setFunctionExpressionStatement(pn);
|
||||
}
|
||||
|
||||
pn = nf.createExprStatement(pn, lineno);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user