function parsePrimaryExpression() {
        var type, token, expr, startToken;

        if (match('(')) {
            return parseGroupExpression();
        }

        if (match('[')) {
            return parseArrayInitialiser();
        }

        if (match('{')) {
            return parseObjectInitialiser();
        }

        type = lookahead.type;
        startToken = lookahead;

        if (type === Token.Identifier) {
            expr =  delegate.createIdentifier(lex().value);
        } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
            if (strict && lookahead.octal) {
                throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);
            }
            expr = delegate.createLiteral(lex());
        } else if (type === Token.Keyword) {
            if (matchKeyword('function')) {
                return parseFunctionExpression();
            }
            if (matchKeyword('this')) {
                lex();
                expr = delegate.createThisExpression();
            } else {
                throwUnexpected(lex());
            }
        } else if (type === Token.BooleanLiteral) {
            token = lex();
            token.value = (token.value === 'true');
            expr = delegate.createLiteral(token);
        } else if (type === Token.NullLiteral) {
            token = lex();
            token.value = null;
            expr = delegate.createLiteral(token);
        } else if (match('/') || match('/=')) {
            if (typeof extra.tokens !== 'undefined') {
                expr = delegate.createLiteral(collectRegex());
            } else {
                expr = delegate.createLiteral(scanRegExp());
            }
            peek();
        } else {
            throwUnexpected(lex());
        }

        return delegate.markEnd(expr, startToken);
    }
function parsePrimaryExpression() {
        var type, token, expr, startToken;

        if (match('(')) {
            return parseGroupExpression();
        }

        if (match('[')) {
            return parseArrayInitialiser();
        }

        if (match('{')) {
            return parseObjectInitialiser();
        }

        type = lookahead.type;
        startToken = lookahead;

        if (type === Token.Identifier) {
            expr =  delegate.createIdentifier(lex().value);
        } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
            if (strict && lookahead.octal) {
                throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);
            }
            expr = delegate.createLiteral(lex());
        } else if (type === Token.Keyword) {
            if (matchKeyword('function')) {
                return parseFunctionExpression();
            }
            if (matchKeyword('this')) {
                lex();
                expr = delegate.createThisExpression();
            } else {
                throwUnexpected(lex());
            }
        } else if (type === Token.BooleanLiteral) {
            token = lex();
            token.value = (token.value === 'true');
            expr = delegate.createLiteral(token);
        } else if (type === Token.NullLiteral) {
            token = lex();
            token.value = null;
            expr = delegate.createLiteral(token);
        } else if (match('/') || match('/=')) {
            if (typeof extra.tokens !== 'undefined') {
                expr = delegate.createLiteral(collectRegex());
            } else {
                expr = delegate.createLiteral(scanRegExp());
            }
            peek();
        } else {
            throwUnexpected(lex());
        }

        return delegate.markEnd(expr, startToken);
    }
function parsePrimaryExpression ( ) { var type , token , expr , startToken ; if ( match ( '(' ) ) { return parseGroupExpression ( ) ; } if ( match ( '[' ) ) { return parseArrayInitialiser ( ) ; } if ( match ( '{' ) ) { return parseObjectInitialiser ( ) ; } type = lookahead . type ; startToken = lookahead ; if ( type === Token . Identifier ) { expr = delegate . createIdentifier ( lex ( ) . value ) ; } else if ( type === Token . StringLiteral || type === Token . NumericLiteral ) { if ( strict && lookahead . octal ) { throwErrorTolerant ( lookahead , Messages . StrictOctalLiteral ) ; } expr = delegate . createLiteral ( lex ( ) ) ; } else if ( type === Token . Keyword ) { if ( matchKeyword ( 'function' ) ) { return parseFunctionExpression ( ) ; } if ( matchKeyword ( 'this' ) ) { lex ( ) ; expr = delegate . createThisExpression ( ) ; } else { throwUnexpected ( lex ( ) ) ; } } else if ( type === Token . BooleanLiteral ) { token = lex ( ) ; token . value = ( token . value === 'true' ) ; expr = delegate . createLiteral ( token ) ; } else if ( type === Token . NullLiteral ) { token = lex ( ) ; token . value = null ; expr = delegate . createLiteral ( token ) ; } else if ( match ( '/' ) || match ( '/=' ) ) { if ( typeof extra . tokens !== 'undefined' ) { expr = delegate . createLiteral ( collectRegex ( ) ) ; } else { expr = delegate . createLiteral ( scanRegExp ( ) ) ; } peek ( ) ; } else { throwUnexpected ( lex ( ) ) ; } return delegate . markEnd ( expr , startToken ) ; }
11.1 Primary Expressions
11 . 1 Primary Expressions
ECMA - 262 12. 2 Primary Expressions