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

Method functionDescriptor

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

Source from the content-addressed store, hash-verified

1039 }
1040
1041 public FunctionDescriptor functionDescriptor() {
1042 try {
1043 pushContext(ContextType.FUNCTION);
1044 Token position = consume(FUNCTION);
1045 String identifier = null;
1046 if (la() == IDENTIFIER) {
1047 identifier = consume(IDENTIFIER).getText();
1048 }
1049 List<Parameter> params = formalParameters();
1050
1051 consume(LEFT_BRACE);
1052 BlockStatement body = functionBody();
1053 consume(RIGHT_BRACE);
1054
1055 return new FunctionDescriptor(position, identifier, params, body, currentContext().isStrict());
1056 } finally {
1057 popContext();
1058 }
1059
1060 }
1061
1062 public BlockStatement functionBody() {
1063 List<Statement> statements = sourceElements();

Callers 1

parseFunctionMethod · 0.95

Calls 9

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

Tested by

no test coverage detected