protected void setIsGenerator() { if (insideFunction()) { ((FunctionNode)currentScriptOrFn).setIsGenerator(); } }
protected void setRequiresActivation() { if (insideFunction()) { ((FunctionNode)currentScriptOrFn).setRequiresActivation(); } }
protected void checkActivationName(String name, int token) { if (!insideFunction()) { return; } boolean activation = false; if ("arguments".equals(name) || (compilerEnv.getActivationNames() != null && compilerEnv.getActivationNames().contains(name))) { activation = true; } else if ("length".equals(name)) { if (token == Token.GETPROP && compilerEnv.getLanguageVersion() == Context.VERSION_1_2) { // Use of "length" in 1.2 requires an activation object. activation = true; } } if (activation) { setRequiresActivation(); } }
private AstNode returnOrYield(int tt, boolean exprContext) throws IOException if (!insideFunction()) { reportError(tt == Token.RETURN ? "msg.bad.return" : "msg.bad.yield"); addStrictWarning("msg.return.inconsistent", "", pos, end - pos); } else { if (!insideFunction()) reportError("msg.bad.yield"); endFlags |= Node.END_YIELDS; if (insideFunction() && nowAllSet(before, endFlags, Node.END_YIELDS|Node.END_RETURNS_VALUE)) {
return new ExpressionStatement(expr, !insideFunction()); expr = expr(); if (expr.getType() != Token.LABEL) { stmt = new ExpressionStatement(expr, !insideFunction()); autoInsertSemicolon(stmt); break;
new ExpressionStatement(pn, !insideFunction()); es.setLineno(pn.getLineno()); return es;
pn = new ExpressionStatement(expr(), !insideFunction()); break;
fnNode.setLp(lpPos - functionSourceStart); if (insideFunction() || nestingOfWith > 0) {