pakmanaged.js
function parseArrayInitialiser() {
            var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true,
                marker = markerCreate();
    
            expect('[');
            while (!match(']')) {
                if (lookahead.value === 'for' &&
                        lookahead.type === Token.Keyword) {
                    if (!possiblecomprehension) {
                        throwError({}, Messages.ComprehensionError);
                    }
                    matchKeyword('for');
                    tmp = parseForStatement({ignoreBody: true});
                    tmp.of = tmp.type === Syntax.ForOfStatement;
                    tmp.type = Syntax.ComprehensionBlock;
                    if (tmp.left.kind) { // can't be let or const
                        throwError({}, Messages.ComprehensionError);
                    }
                    blocks.push(tmp);
                } else if (lookahead.value === 'if' &&
                               lookahead.type === Token.Keyword) {
                    if (!possiblecomprehension) {
                        throwError({}, Messages.ComprehensionError);
                    }
                    expectKeyword('if');
                    expect('(');
                    filter = parseExpression();
                    expect(')');
                } else if (lookahead.value === ',' &&
                               lookahead.type === Token.Punctuator) {
                    possiblecomprehension = false; // no longer allowed.
                    lex();
                    elements.push(null);
                } else {
                    tmp = parseSpreadOrAssignmentExpression();
                    elements.push(tmp);
                    if (tmp && tmp.type === Syntax.SpreadElement) {
                        if (!match(']')) {
                            throwError({}, Messages.ElementAfterSpreadElement);
                        }
                    } else if (!(match(']') || matchKeyword('for') || matchKeyword('if'))) {
                        expect(','); // this lexes.
                        possiblecomprehension = false;
                    }
                }
            }
    
            expect(']');
    
            if (filter && !blocks.length) {
                throwError({}, Messages.ComprehensionRequiresBlock);
            }
    
            if (blocks.length) {
                if (elements.length !== 1) {
                    throwError({}, Messages.ComprehensionError);
                }
                return markerApply(marker, delegate.createComprehensionExpression(filter, blocks, elements[0]));
            }
            return markerApply(marker, delegate.createArrayExpression(elements));
        }
function parseArrayInitialiser() {
            var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true,
                marker = markerCreate();
    
            expect('[');
            while (!match(']')) {
                if (lookahead.value === 'for' &&
                        lookahead.type === Token.Keyword) {
                    if (!possiblecomprehension) {
                        throwError({}, Messages.ComprehensionError);
                    }
                    matchKeyword('for');
                    tmp = parseForStatement({ignoreBody: true});
                    tmp.of = tmp.type === Syntax.ForOfStatement;
                    tmp.type = Syntax.ComprehensionBlock;
                    if (tmp.left.kind) { // can't be let or const
                        throwError({}, Messages.ComprehensionError);
                    }
                    blocks.push(tmp);
                } else if (lookahead.value === 'if' &&
                               lookahead.type === Token.Keyword) {
                    if (!possiblecomprehension) {
                        throwError({}, Messages.ComprehensionError);
                    }
                    expectKeyword('if');
                    expect('(');
                    filter = parseExpression();
                    expect(')');
                } else if (lookahead.value === ',' &&
                               lookahead.type === Token.Punctuator) {
                    possiblecomprehension = false; // no longer allowed.
                    lex();
                    elements.push(null);
                } else {
                    tmp = parseSpreadOrAssignmentExpression();
                    elements.push(tmp);
                    if (tmp && tmp.type === Syntax.SpreadElement) {
                        if (!match(']')) {
                            throwError({}, Messages.ElementAfterSpreadElement);
                        }
                    } else if (!(match(']') || matchKeyword('for') || matchKeyword('if'))) {
                        expect(','); // this lexes.
                        possiblecomprehension = false;
                    }
                }
            }
    
            expect(']');
    
            if (filter && !blocks.length) {
                throwError({}, Messages.ComprehensionRequiresBlock);
            }
    
            if (blocks.length) {
                if (elements.length !== 1) {
                    throwError({}, Messages.ComprehensionError);
                }
                return markerApply(marker, delegate.createComprehensionExpression(filter, blocks, elements[0]));
            }
            return markerApply(marker, delegate.createArrayExpression(elements));
        }
11.1.4 Array Initialiser