(node)
| 4064 | } |
| 4065 | |
| 4066 | function parseFunctionDeclaration(node) { |
| 4067 | var id, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict; |
| 4068 | |
| 4069 | expectKeyword('function'); |
| 4070 | token = lookahead; |
| 4071 | id = parseVariableIdentifier(); |
| 4072 | if (strict) { |
| 4073 | if (isRestrictedWord(token.value)) { |
| 4074 | tolerateUnexpectedToken(token, Messages.StrictFunctionName); |
| 4075 | } |
| 4076 | } else { |
| 4077 | if (isRestrictedWord(token.value)) { |
| 4078 | firstRestricted = token; |
| 4079 | message = Messages.StrictFunctionName; |
| 4080 | } else if (isStrictModeReservedWord(token.value)) { |
| 4081 | firstRestricted = token; |
| 4082 | message = Messages.StrictReservedWord; |
| 4083 | } |
| 4084 | } |
| 4085 | |
| 4086 | tmp = parseParams(firstRestricted); |
| 4087 | params = tmp.params; |
| 4088 | defaults = tmp.defaults; |
| 4089 | stricted = tmp.stricted; |
| 4090 | firstRestricted = tmp.firstRestricted; |
| 4091 | if (tmp.message) { |
| 4092 | message = tmp.message; |
| 4093 | } |
| 4094 | |
| 4095 | previousStrict = strict; |
| 4096 | body = parseFunctionSourceElements(); |
| 4097 | if (strict && firstRestricted) { |
| 4098 | throwUnexpectedToken(firstRestricted, message); |
| 4099 | } |
| 4100 | if (strict && stricted) { |
| 4101 | tolerateUnexpectedToken(stricted, message); |
| 4102 | } |
| 4103 | strict = previousStrict; |
| 4104 | |
| 4105 | return node.finishFunctionDeclaration(id, params, defaults, body); |
| 4106 | } |
| 4107 | |
| 4108 | function parseFunctionExpression() { |
| 4109 | var token, id = null, stricted, firstRestricted, message, tmp, |
no test coverage detected