public/swaggerui/swagger-ui.js
function parsePrimaryExpression() {
        var type, token, expr, node;

        if (match('(')) {
            isBindingElement = false;
            return inheritCoverGrammar(parseGroupExpression);
        }

        if (match('[')) {
            return inheritCoverGrammar(parseArrayInitializer);
        }

        if (match('{')) {
            return inheritCoverGrammar(parseObjectInitializer);
        }

        type = lookahead.type;
        node = new Node();

        if (type === Token.Identifier) {
            if (state.sourceType === 'module' && lookahead.value === 'await') {
                tolerateUnexpectedToken(lookahead);
            }
            expr = node.finishIdentifier(lex().value);
        } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
            isAssignmentTarget = isBindingElement = false;
            if (strict && lookahead.octal) {
                tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);
            }
            expr = node.finishLiteral(lex());
        } else if (type === Token.Keyword) {
            if (!strict && state.allowYield && matchKeyword('yield')) {
                return parseNonComputedProperty();
            }
            if (!strict && matchKeyword('let')) {
                return node.finishIdentifier(lex().value);
            }
            isAssignmentTarget = isBindingElement = false;
            if (matchKeyword('function')) {
                return parseFunctionExpression();
            }
            if (matchKeyword('this')) {
                lex();
                return node.finishThisExpression();
            }
            if (matchKeyword('class')) {
                return parseClassExpression();
            }
            throwUnexpectedToken(lex());
        } else if (type === Token.BooleanLiteral) {
            isAssignmentTarget = isBindingElement = false;
            token = lex();
            token.value = (token.value === 'true');
            expr = node.finishLiteral(token);
        } else if (type === Token.NullLiteral) {
            isAssignmentTarget = isBindingElement = false;
            token = lex();
            token.value = null;
            expr = node.finishLiteral(token);
        } else if (match('/') || match('/=')) {
            isAssignmentTarget = isBindingElement = false;
            index = startIndex;

            if (typeof extra.tokens !== 'undefined') {
                token = collectRegex();
            } else {
                token = scanRegExp();
            }
            lex();
            expr = node.finishLiteral(token);
        } else if (type === Token.Template) {
            expr = parseTemplateLiteral();
        } else {
            throwUnexpectedToken(lex());
        }

        return expr;
    }
function parsePrimaryExpression() {
        var type, token, expr, node;

        if (match('(')) {
            isBindingElement = false;
            return inheritCoverGrammar(parseGroupExpression);
        }

        if (match('[')) {
            return inheritCoverGrammar(parseArrayInitializer);
        }

        if (match('{')) {
            return inheritCoverGrammar(parseObjectInitializer);
        }

        type = lookahead.type;
        node = new Node();

        if (type === Token.Identifier) {
            if (state.sourceType === 'module' && lookahead.value === 'await') {
                tolerateUnexpectedToken(lookahead);
            }
            expr = node.finishIdentifier(lex().value);
        } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
            isAssignmentTarget = isBindingElement = false;
            if (strict && lookahead.octal) {
                tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);
            }
            expr = node.finishLiteral(lex());
        } else if (type === Token.Keyword) {
            if (!strict && state.allowYield && matchKeyword('yield')) {
                return parseNonComputedProperty();
            }
            if (!strict && matchKeyword('let')) {
                return node.finishIdentifier(lex().value);
            }
            isAssignmentTarget = isBindingElement = false;
            if (matchKeyword('function')) {
                return parseFunctionExpression();
            }
            if (matchKeyword('this')) {
                lex();
                return node.finishThisExpression();
            }
            if (matchKeyword('class')) {
                return parseClassExpression();
            }
            throwUnexpectedToken(lex());
        } else if (type === Token.BooleanLiteral) {
            isAssignmentTarget = isBindingElement = false;
            token = lex();
            token.value = (token.value === 'true');
            expr = node.finishLiteral(token);
        } else if (type === Token.NullLiteral) {
            isAssignmentTarget = isBindingElement = false;
            token = lex();
            token.value = null;
            expr = node.finishLiteral(token);
        } else if (match('/') || match('/=')) {
            isAssignmentTarget = isBindingElement = false;
            index = startIndex;

            if (typeof extra.tokens !== 'undefined') {
                token = collectRegex();
            } else {
                token = scanRegExp();
            }
            lex();
            expr = node.finishLiteral(token);
        } else if (type === Token.Template) {
            expr = parseTemplateLiteral();
        } else {
            throwUnexpectedToken(lex());
        }

        return expr;
    }
function parsePrimaryExpression ( ) { var type , token , expr , node ; if ( match ( '(' ) ) { isBindingElement = false ; return inheritCoverGrammar ( parseGroupExpression ) ; } if ( match ( '[' ) ) { return inheritCoverGrammar ( parseArrayInitializer ) ; } if ( match ( '{' ) ) { return inheritCoverGrammar ( parseObjectInitializer ) ; } type = lookahead . type ; node = new Node ( ) ; if ( type === Token . Identifier ) { if ( state . sourceType === 'module' && lookahead . value === 'await' ) { tolerateUnexpectedToken ( lookahead ) ; } expr = node . finishIdentifier ( lex ( ) . value ) ; } else if ( type === Token . StringLiteral || type === Token . NumericLiteral ) { isAssignmentTarget = isBindingElement = false ; if ( strict && lookahead . octal ) { tolerateUnexpectedToken ( lookahead , Messages . StrictOctalLiteral ) ; } expr = node . finishLiteral ( lex ( ) ) ; } else if ( type === Token . Keyword ) { if ( ! strict && state . allowYield && matchKeyword ( 'yield' ) ) { return parseNonComputedProperty ( ) ; } if ( ! strict && matchKeyword ( 'let' ) ) { return node . finishIdentifier ( lex ( ) . value ) ; } isAssignmentTarget = isBindingElement = false ; if ( matchKeyword ( 'function' ) ) { return parseFunctionExpression ( ) ; } if ( matchKeyword ( 'this' ) ) { lex ( ) ; return node . finishThisExpression ( ) ; } if ( matchKeyword ( 'class' ) ) { return parseClassExpression ( ) ; } throwUnexpectedToken ( lex ( ) ) ; } else if ( type === Token . BooleanLiteral ) { isAssignmentTarget = isBindingElement = false ; token = lex ( ) ; token . value = ( token . value === 'true' ) ; expr = node . finishLiteral ( token ) ; } else if ( type === Token . NullLiteral ) { isAssignmentTarget = isBindingElement = false ; token = lex ( ) ; token . value = null ; expr = node . finishLiteral ( token ) ; } else if ( match ( '/' ) || match ( '/=' ) ) { isAssignmentTarget = isBindingElement = false ; index = startIndex ; if ( typeof extra . tokens !== 'undefined' ) { token = collectRegex ( ) ; } else { token = scanRegExp ( ) ; } lex ( ) ; expr = node . finishLiteral ( token ) ; } else if ( type === Token . Template ) { expr = parseTemplateLiteral ( ) ; } else { throwUnexpectedToken ( lex ( ) ) ; } return expr ; }
ECMA-262 12.2 Primary Expressions
ECMA - 262 12 . 2 Primary Expressions