mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 06:45:33 +00:00
no assignment of function expression statements to script result
This commit is contained in:
parent
b853f502e1
commit
fd3dee4c56
@ -102,6 +102,10 @@ public class IRFactory {
|
||||
return new Node(TokenStream.EXPRSTMT, (Node) expr, lineno);
|
||||
}
|
||||
|
||||
public Object createExprStatementNoReturn(Object expr, int lineno) {
|
||||
return new Node(TokenStream.POP, (Node) expr, lineno);
|
||||
}
|
||||
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
|
@ -300,7 +300,7 @@ class Parser {
|
||||
// The following can be removed but then code generators should
|
||||
// be modified not to push on the stack function expression
|
||||
// statements
|
||||
pn = nf.createExprStatement(pn, baseLineno);
|
||||
pn = nf.createExprStatementNoReturn(pn, baseLineno);
|
||||
}
|
||||
// Add EOL but only if function is not part of expression, in which
|
||||
// case it gets SEMI + EOL from Statement.
|
||||
|
Loading…
x
Reference in New Issue
Block a user