function parseUnaryExpression() {
        var token, expr, startToken;

        if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
            expr = parsePostfixExpression();
        } else if (match('++') || match('--')) {
            startToken = lookahead;
            token = lex();
            expr = parseUnaryExpression();
            // 11.4.4, 11.4.5
            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                throwErrorTolerant({}, Messages.StrictLHSPrefix);
            }

            if (!isLeftHandSide(expr)) {
                throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
            }

            expr = delegate.createUnaryExpression(token.value, expr);
            expr = delegate.markEnd(expr, startToken);
        } else if (match('+') || match('-') || match('~') || match('!')) {
            startToken = lookahead;
            token = lex();
            expr = parseUnaryExpression();
            expr = delegate.createUnaryExpression(token.value, expr);
            expr = delegate.markEnd(expr, startToken);
        } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
            startToken = lookahead;
            token = lex();
            expr = parseUnaryExpression();
            expr = delegate.createUnaryExpression(token.value, expr);
            expr = delegate.markEnd(expr, startToken);
            if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
                throwErrorTolerant({}, Messages.StrictDelete);
            }
        } else {
            expr = parsePostfixExpression();
        }

        return expr;
    }
function parseUnaryExpression() {
        var token, expr, startToken;

        if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
            expr = parsePostfixExpression();
        } else if (match('++') || match('--')) {
            startToken = lookahead;
            token = lex();
            expr = parseUnaryExpression();
            // 11.4.4, 11.4.5
            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                throwErrorTolerant({}, Messages.StrictLHSPrefix);
            }

            if (!isLeftHandSide(expr)) {
                throwErrorTolerant({}, Messages.InvalidLHSInAssignment);
            }

            expr = delegate.createUnaryExpression(token.value, expr);
            expr = delegate.markEnd(expr, startToken);
        } else if (match('+') || match('-') || match('~') || match('!')) {
            startToken = lookahead;
            token = lex();
            expr = parseUnaryExpression();
            expr = delegate.createUnaryExpression(token.value, expr);
            expr = delegate.markEnd(expr, startToken);
        } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
            startToken = lookahead;
            token = lex();
            expr = parseUnaryExpression();
            expr = delegate.createUnaryExpression(token.value, expr);
            expr = delegate.markEnd(expr, startToken);
            if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
                throwErrorTolerant({}, Messages.StrictDelete);
            }
        } else {
            expr = parsePostfixExpression();
        }

        return expr;
    }
function parseUnaryExpression ( ) { var token , expr , startToken ; if ( lookahead . type !== Token . Punctuator && lookahead . type !== Token . Keyword ) { expr = parsePostfixExpression ( ) ; } else if ( match ( '++' ) || match ( '--' ) ) { startToken = lookahead ; token = lex ( ) ; expr = parseUnaryExpression ( ) ; // 11.4.4, 11.4.5 if ( strict && expr . type === Syntax . Identifier && isRestrictedWord ( expr . name ) ) { throwErrorTolerant ( { } , Messages . StrictLHSPrefix ) ; } if ( ! isLeftHandSide ( expr ) ) { throwErrorTolerant ( { } , Messages . InvalidLHSInAssignment ) ; } expr = delegate . createUnaryExpression ( token . value , expr ) ; expr = delegate . markEnd ( expr , startToken ) ; } else if ( match ( '+' ) || match ( '-' ) || match ( '~' ) || match ( '!' ) ) { startToken = lookahead ; token = lex ( ) ; expr = parseUnaryExpression ( ) ; expr = delegate . createUnaryExpression ( token . value , expr ) ; expr = delegate . markEnd ( expr , startToken ) ; } else if ( matchKeyword ( 'delete' ) || matchKeyword ( 'void' ) || matchKeyword ( 'typeof' ) ) { startToken = lookahead ; token = lex ( ) ; expr = parseUnaryExpression ( ) ; expr = delegate . createUnaryExpression ( token . value , expr ) ; expr = delegate . markEnd ( expr , startToken ) ; if ( strict && expr . operator === 'delete' && expr . argument . type === Syntax . Identifier ) { throwErrorTolerant ( { } , Messages . StrictDelete ) ; } } else { expr = parsePostfixExpression ( ) ; } return expr ; }
11.4 Unary Operators
11 . 4 Unary Operators
ECMA - 262 12. 2 Unary Operators