()
| 8268 | } |
| 8269 | |
| 8270 | function parseFunctionExpression() { |
| 8271 | var token, id = null, firstRestricted, message, tmp, body, generator, isAsync, |
| 8272 | previousStrict, previousYieldAllowed, previousAwaitAllowed, |
| 8273 | marker = markerCreate(), typeParameters; |
| 8274 | |
| 8275 | isAsync = false; |
| 8276 | if (matchAsync()) { |
| 8277 | lex(); |
| 8278 | isAsync = true; |
| 8279 | } |
| 8280 | |
| 8281 | expectKeyword('function'); |
| 8282 | |
| 8283 | generator = false; |
| 8284 | |
| 8285 | if (match('*')) { |
| 8286 | lex(); |
| 8287 | generator = true; |
| 8288 | } |
| 8289 | |
| 8290 | if (!match('(')) { |
| 8291 | if (!match('<')) { |
| 8292 | token = lookahead; |
| 8293 | id = parseVariableIdentifier(); |
| 8294 | |
| 8295 | if (strict) { |
| 8296 | if (isRestrictedWord(token.value)) { |
| 8297 | throwErrorTolerant(token, Messages.StrictFunctionName); |
| 8298 | } |
| 8299 | } else { |
| 8300 | if (isRestrictedWord(token.value)) { |
| 8301 | firstRestricted = token; |
| 8302 | message = Messages.StrictFunctionName; |
| 8303 | } else if (isStrictModeReservedWord(token.value)) { |
| 8304 | firstRestricted = token; |
| 8305 | message = Messages.StrictReservedWord; |
| 8306 | } |
| 8307 | } |
| 8308 | } |
| 8309 | |
| 8310 | if (match('<')) { |
| 8311 | typeParameters = parseTypeParameterDeclaration(); |
| 8312 | } |
| 8313 | } |
| 8314 | |
| 8315 | tmp = parseParams(firstRestricted); |
| 8316 | firstRestricted = tmp.firstRestricted; |
| 8317 | if (tmp.message) { |
| 8318 | message = tmp.message; |
| 8319 | } |
| 8320 | |
| 8321 | previousStrict = strict; |
| 8322 | previousYieldAllowed = state.yieldAllowed; |
| 8323 | state.yieldAllowed = generator; |
| 8324 | previousAwaitAllowed = state.awaitAllowed; |
| 8325 | state.awaitAllowed = isAsync; |
| 8326 | |
| 8327 | body = parseFunctionSourceElements(); |
no test coverage detected