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

Method functionDeclaration

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

Source from the content-addressed store, hash-verified

1018 }
1019
1020 public FunctionDeclaration functionDeclaration() {
1021 try {
1022 pushContext(ContextType.FUNCTION);
1023 Token position = consume(FUNCTION);
1024 Token identifier = consume(IDENTIFIER);
1025 if (!isAssignableName(identifier.getText())) {
1026 throw new SyntaxError(identifier, "invalid identifier: " + identifier.getText());
1027 }
1028
1029 List<Parameter> params = formalParameters();
1030
1031 consume(LEFT_BRACE);
1032 BlockStatement body = functionBody();
1033 consume(RIGHT_BRACE);
1034
1035 return factory.functionDeclaration(position, identifier.getText(), params, body, currentContext().isStrict());
1036 } finally {
1037 popContext();
1038 }
1039 }
1040
1041 public FunctionDescriptor functionDescriptor() {
1042 try {

Callers 2

sourceElementMethod · 0.95
statementMethod · 0.95

Calls 9

pushContextMethod · 0.95
consumeMethod · 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