public/swaggerui/swagger-ui.js
function parseReturnStatement(node) {
        var argument = null;

        expectKeyword('return');

        if (!state.inFunctionBody) {
            tolerateError(Messages.IllegalReturn);
        }

        // 'return' followed by a space and an identifier is very common.
        if (source.charCodeAt(lastIndex) === 0x20) {
            if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) {
                argument = parseExpression();
                consumeSemicolon();
                return node.finishReturnStatement(argument);
            }
        }

        if (hasLineTerminator) {
            // HACK
            return node.finishReturnStatement(null);
        }

        if (!match(';')) {
            if (!match('}') && lookahead.type !== Token.EOF) {
                argument = parseExpression();
            }
        }

        consumeSemicolon();

        return node.finishReturnStatement(argument);
    }
function parseReturnStatement(node) {
        var argument = null;

        expectKeyword('return');

        if (!state.inFunctionBody) {
            tolerateError(Messages.IllegalReturn);
        }

        // 'return' followed by a space and an identifier is very common.
        if (source.charCodeAt(lastIndex) === 0x20) {
            if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) {
                argument = parseExpression();
                consumeSemicolon();
                return node.finishReturnStatement(argument);
            }
        }

        if (hasLineTerminator) {
            // HACK
            return node.finishReturnStatement(null);
        }

        if (!match(';')) {
            if (!match('}') && lookahead.type !== Token.EOF) {
                argument = parseExpression();
            }
        }

        consumeSemicolon();

        return node.finishReturnStatement(argument);
    }
function parseReturnStatement ( node ) { var argument = null ; expectKeyword ( 'return' ) ; if ( ! state . inFunctionBody ) { tolerateError ( Messages . IllegalReturn ) ; } // 'return' followed by a space and an identifier is very common. if ( source . charCodeAt ( lastIndex ) === 0x20 ) { if ( isIdentifierStart ( source . charCodeAt ( lastIndex + 1 ) ) ) { argument = parseExpression ( ) ; consumeSemicolon ( ) ; return node . finishReturnStatement ( argument ) ; } } if ( hasLineTerminator ) { // HACK return node . finishReturnStatement ( null ) ; } if ( ! match ( ';' ) ) { if ( ! match ( '}' ) && lookahead . type !== Token . EOF ) { argument = parseExpression ( ) ; } } consumeSemicolon ( ) ; return node . finishReturnStatement ( argument ) ; }
ECMA-262 13.10 The return statement
ECMA - 262 13 . 10 The return statement