function parseFunctionSourceElements() {
        var sourceElement, sourceElements = [], token, directive, firstRestricted,
            oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;

        startToken = lookahead;
        expect('{');

        while (index < length) {
            if (lookahead.type !== Token.StringLiteral) {
                break;
            }
            token = lookahead;

            sourceElement = parseSourceElement();
            sourceElements.push(sourceElement);
            if (sourceElement.expression.type !== Syntax.Literal) {
                // this is not directive
                break;
            }
            directive = source.slice(token.start + 1, token.end - 1);
            if (directive === 'use strict') {
                strict = true;
                if (firstRestricted) {
                    throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);
                }
            } else {
                if (!firstRestricted && token.octal) {
                    firstRestricted = token;
                }
            }
        }

        oldLabelSet = state.labelSet;
        oldInIteration = state.inIteration;
        oldInSwitch = state.inSwitch;
        oldInFunctionBody = state.inFunctionBody;

        state.labelSet = {};
        state.inIteration = false;
        state.inSwitch = false;
        state.inFunctionBody = true;

        while (index < length) {
            if (match('}')) {
                break;
            }
            sourceElement = parseSourceElement();
            if (typeof sourceElement === 'undefined') {
                break;
            }
            sourceElements.push(sourceElement);
        }

        expect('}');

        state.labelSet = oldLabelSet;
        state.inIteration = oldInIteration;
        state.inSwitch = oldInSwitch;
        state.inFunctionBody = oldInFunctionBody;

        return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);
    }
function parseFunctionSourceElements() {
        var sourceElement, sourceElements = [], token, directive, firstRestricted,
            oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;

        startToken = lookahead;
        expect('{');

        while (index < length) {
            if (lookahead.type !== Token.StringLiteral) {
                break;
            }
            token = lookahead;

            sourceElement = parseSourceElement();
            sourceElements.push(sourceElement);
            if (sourceElement.expression.type !== Syntax.Literal) {
                // this is not directive
                break;
            }
            directive = source.slice(token.start + 1, token.end - 1);
            if (directive === 'use strict') {
                strict = true;
                if (firstRestricted) {
                    throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);
                }
            } else {
                if (!firstRestricted && token.octal) {
                    firstRestricted = token;
                }
            }
        }

        oldLabelSet = state.labelSet;
        oldInIteration = state.inIteration;
        oldInSwitch = state.inSwitch;
        oldInFunctionBody = state.inFunctionBody;

        state.labelSet = {};
        state.inIteration = false;
        state.inSwitch = false;
        state.inFunctionBody = true;

        while (index < length) {
            if (match('}')) {
                break;
            }
            sourceElement = parseSourceElement();
            if (typeof sourceElement === 'undefined') {
                break;
            }
            sourceElements.push(sourceElement);
        }

        expect('}');

        state.labelSet = oldLabelSet;
        state.inIteration = oldInIteration;
        state.inSwitch = oldInSwitch;
        state.inFunctionBody = oldInFunctionBody;

        return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);
    }
function parseFunctionSourceElements ( ) { var sourceElement , sourceElements = [ ] , token , directive , firstRestricted , oldLabelSet , oldInIteration , oldInSwitch , oldInFunctionBody , startToken ; startToken = lookahead ; expect ( '{' ) ; while ( index < length ) { if ( lookahead . type !== Token . StringLiteral ) { break ; } token = lookahead ; sourceElement = parseSourceElement ( ) ; sourceElements . push ( sourceElement ) ; if ( sourceElement . expression . type !== Syntax . Literal ) { // this is not directive break ; } directive = source . slice ( token . start + 1 , token . end - 1 ) ; if ( directive === 'use strict' ) { strict = true ; if ( firstRestricted ) { throwErrorTolerant ( firstRestricted , Messages . StrictOctalLiteral ) ; } } else { if ( ! firstRestricted && token . octal ) { firstRestricted = token ; } } } oldLabelSet = state . labelSet ; oldInIteration = state . inIteration ; oldInSwitch = state . inSwitch ; oldInFunctionBody = state . inFunctionBody ; state . labelSet = { } ; state . inIteration = false ; state . inSwitch = false ; state . inFunctionBody = true ; while ( index < length ) { if ( match ( '}' ) ) { break ; } sourceElement = parseSourceElement ( ) ; if ( typeof sourceElement === 'undefined' ) { break ; } sourceElements . push ( sourceElement ) ; } expect ( '}' ) ; state . labelSet = oldLabelSet ; state . inIteration = oldInIteration ; state . inSwitch = oldInSwitch ; state . inFunctionBody = oldInFunctionBody ; return delegate . markEnd ( delegate . createBlockStatement ( sourceElements ) , startToken ) ; }
13 Function Definition
13 Function Definition
ECMA - 262 12. 2 Function Definition