Skip to content

ParseScript: sourceText parameter type inconsistency with ParseText #3848

Description

@alexey-alanreys

ParseScript (§16.1.5) declares sourceText as ECMAScript source text,
which per §11.1 is a sequence of Unicode code points.

However, ParseText (§11.1.6), which ParseScript calls directly in step 1,
accepts sourceText as a String or a sequence of Unicode code points and
explicitly handles the String case via StringToCodePoints.

This means callers like the HTML spec can pass a String to ParseScript,
which works in practice but violates the declared type at the ParseScript level.

Suggestion: update ParseScript's parameter type to
a String or a sequence of Unicode code points to match ParseText's actual accepted input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions