()
| 6026 | // 11.4 Unary Operators |
| 6027 | |
| 6028 | function parseUnaryExpression() { |
| 6029 | var marker, token, expr; |
| 6030 | |
| 6031 | if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { |
| 6032 | return parsePostfixExpression(); |
| 6033 | } |
| 6034 | |
| 6035 | if (match('++') || match('--')) { |
| 6036 | marker = markerCreate(); |
| 6037 | token = lex(); |
| 6038 | expr = parseUnaryExpression(); |
| 6039 | // 11.4.4, 11.4.5 |
| 6040 | if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { |
| 6041 | throwErrorTolerant({}, Messages.StrictLHSPrefix); |
| 6042 | } |
| 6043 | |
| 6044 | if (!isLeftHandSide(expr)) { |
| 6045 | throwError({}, Messages.InvalidLHSInAssignment); |
| 6046 | } |
| 6047 | |
| 6048 | return markerApply(marker, delegate.createUnaryExpression(token.value, expr)); |
| 6049 | } |
| 6050 | |
| 6051 | if (match('+') || match('-') || match('~') || match('!')) { |
| 6052 | marker = markerCreate(); |
| 6053 | token = lex(); |
| 6054 | expr = parseUnaryExpression(); |
| 6055 | return markerApply(marker, delegate.createUnaryExpression(token.value, expr)); |
| 6056 | } |
| 6057 | |
| 6058 | if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { |
| 6059 | marker = markerCreate(); |
| 6060 | token = lex(); |
| 6061 | expr = parseUnaryExpression(); |
| 6062 | expr = markerApply(marker, delegate.createUnaryExpression(token.value, expr)); |
| 6063 | if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { |
| 6064 | throwErrorTolerant({}, Messages.StrictDelete); |
| 6065 | } |
| 6066 | return expr; |
| 6067 | } |
| 6068 | |
| 6069 | return parsePostfixExpression(); |
| 6070 | } |
| 6071 | |
| 6072 | function binaryPrecedence(token, allowIn) { |
| 6073 | var prec = 0; |
no test coverage detected