()
| 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(); |
no test coverage detected