Repository: microsoft/TypeScript
File: src/compiler/transformers/generators.ts (TypeScript)

Code before:
                }
            }
            else {
                for (let i = blockStack.length - 1; i >= 0; i--) {
                    const block = blockStack[i];
                    if (supportsUnlabeledContinue(block)) {
                        return block.continueLabel;
                    }
                }
            }
        }
        return 0;
    }

    /**
     * Creates an expression that can be used to indicate the value for a label.
     *
     * @param label A label.
     */
    function createLabel(label: Label | undefined): Expression {
        if (label !== undefined && label > 0) {
            if (labelExpressions === undefined) {
                labelExpressions = [];
            }

            const expression = factory.createNumericLiteral(Infinity);
            if (labelExpressions[label] === undefined) {
                labelExpressions[label] = [expression];
            }
            else {
                labelExpressions[label].push(expression);
            }

            return expression;
        }

        return factory.createOmittedExpression();
    }

    /**
     * Creates a numeric literal for the provided instruction.
     */
    function createInstruction(instruction: Instruction): NumericLiteral {
        const literal = factory.createNumericLiteral(instruction);
        addSyntheticTrailingComment(literal, SyntaxKind.MultiLineCommentTrivia, getInstructionName(instruction));
        return literal;
    }

    /**
     * Creates a statement that can be used indicate a Break operation to the provided label.
     *

Review comment (bug):
This shows how `createNumericLiteral` is still a somewhat weird thing. `Infinity` is allowed because parsed numbers are "normalized" to text here:
https://github.com/microsoft/TypeScript/blob/83f3abda153f0f567e296a3c75cdca37c7eb065d/src/compiler/scanner.ts#L1765-L1773

So a sufficiently long number in the input can be stringified to `Infinity` 🤷‍♂️ I find it weird an there is [an issue](https://github.com/microsoft/TypeScript/issues/33298) about it that is labeled as a bug. While it doesn't mention `Infinity` case the issue there is basically related to the same "normalization". 

This issue is certainly fixable but I'm not 100% sure if you'd really want to fix it.

Code after:
                }
            }
            else {
                for (let i = blockStack.length - 1; i >= 0; i--) {
                    const block = blockStack[i];
                    if (supportsUnlabeledContinue(block)) {
                        return block.continueLabel;
                    }
                }
            }
        }
        return 0;
    }

    /**
     * Creates an expression that can be used to indicate the value for a label.
     *
     * @param label A label.
     */
    function createLabel(label: Label | undefined): Expression {
        if (label !== undefined && label > 0) {
            if (labelExpressions === undefined) {
                labelExpressions = [];
            }

            const expression = factory.createNumericLiteral(Number.MAX_SAFE_INTEGER);
            if (labelExpressions[label] === undefined) {
                labelExpressions[label] = [expression];
            }
            else {
                labelExpressions[label].push(expression);
            }

            return expression;
        }

        return factory.createOmittedExpression();
    }

    /**
     * Creates a numeric literal for the provided instruction.
     */
    function createInstruction(instruction: Instruction): NumericLiteral {
        const literal = factory.createNumericLiteral(instruction);
        addSyntheticTrailingComment(literal, SyntaxKind.MultiLineCommentTrivia, getInstructionName(instruction));
        return literal;
    }

    /**
     * Creates a statement that can be used indicate a Break operation to the provided label.
     *