MCPcopy Create free account
hub / github.com/dynjs/dynjs / functionExpression

Method functionExpression

src/main/java/org/dynjs/parser/js/Parser.java:994–1018  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

992 }
993
994 public FunctionExpression functionExpression() {
995 try {
996 pushContext(ContextType.FUNCTION);
997 Token position = consume(FUNCTION);
998 Token identifier = null;
999 String identifierName = null;
1000 if (la() == IDENTIFIER) {
1001 identifier = consume(IDENTIFIER);
1002 if (!isAssignableName(identifier.getText())) {
1003 throw new SyntaxError(identifier, "invalid identifier: " + identifier.getText());
1004 }
1005 identifierName = identifier.getText();
1006 }
1007
1008 List<Parameter> params = formalParameters();
1009
1010 consume(LEFT_BRACE);
1011 BlockStatement body = functionBody();
1012 consume(RIGHT_BRACE);
1013
1014 return factory.functionExpression(position, identifierName, params, body, currentContext().isStrict());
1015 } finally {
1016 popContext();
1017 }
1018 }
1019
1020 public FunctionDeclaration functionDeclaration() {
1021 try {

Callers 1

memberExpressionMethod · 0.95

Calls 10

pushContextMethod · 0.95
consumeMethod · 0.95
laMethod · 0.95
isAssignableNameMethod · 0.95
getTextMethod · 0.95
formalParametersMethod · 0.95
functionBodyMethod · 0.95
currentContextMethod · 0.95
popContextMethod · 0.95
isStrictMethod · 0.65

Tested by

no test coverage detected