Skip to content

Add test case where IteratorBindingInitialization-SingleNameBinding NamedEvaluation throws#4923

Open
G-Lee1031 wants to merge 1 commit intotc39:mainfrom
G-Lee1031:singlenamebinding-throws
Open

Add test case where IteratorBindingInitialization-SingleNameBinding NamedEvaluation throws#4923
G-Lee1031 wants to merge 1 commit intotc39:mainfrom
G-Lee1031:singlenamebinding-throws

Conversation

@G-Lee1031
Copy link
Contributor

Hello.
This PR adds a abrupt completion returning case of IteratorBindingInitialization of SingleNameBinding : BindingIdentifier Initializer? step 5.a.i.

  • First
    In IteratorBindingInitialization of SingleNameBinding : BindingIdentifier Initializer step 5.a.i, NamedEvaluation of ClassExpression : class ClassTail is performed.
  • Second
    In NamedEvaluation of ClasExpression: class ClassTail step 1, ClassDefinitionEvaluation of ClassTail : ClassHeritage? {ClassBody?} is performed.
  • Third
    In ClassDefinitionEvaluation of ClassTail : ClassHeritage? {ClassBody?}, superclass is defined as GetValue(? superclassRef). And_superclassRef_ is defined as Completion(Evaluation of |ClassHeritage|). Specifically in this PR, ClassHeritage is x(var [x = class extends x {}] = ''). However, x is not yet defined, but hoisted in the environment record remaining as undefined. So, in step 8.g, IsConstructor(superClass) returns false. As a result, ClassDefinitionEvaluation throws a TypeError.

@G-Lee1031 G-Lee1031 requested a review from a team as a code owner February 12, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants