зеркало из https://github.com/mozilla/pjs.git
no assignment of function expression statements to script result
This commit is contained in:
Родитель
058ee62667
Коммит
8ebcc7f9af
|
@ -102,6 +102,10 @@ public class IRFactory {
|
||||||
return new Node(TokenStream.EXPRSTMT, (Node) expr, lineno);
|
return new Node(TokenStream.EXPRSTMT, (Node) expr, lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object createExprStatementNoReturn(Object expr, int lineno) {
|
||||||
|
return new Node(TokenStream.POP, (Node) expr, lineno);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name
|
* Name
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -300,7 +300,7 @@ class Parser {
|
||||||
// The following can be removed but then code generators should
|
// The following can be removed but then code generators should
|
||||||
// be modified not to push on the stack function expression
|
// be modified not to push on the stack function expression
|
||||||
// statements
|
// statements
|
||||||
pn = nf.createExprStatement(pn, baseLineno);
|
pn = nf.createExprStatementNoReturn(pn, baseLineno);
|
||||||
}
|
}
|
||||||
// Add EOL but only if function is not part of expression, in which
|
// Add EOL but only if function is not part of expression, in which
|
||||||
// case it gets SEMI + EOL from Statement.
|
// case it gets SEMI + EOL from Statement.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче