Skip to content

Add test case where IteratorBindingInitialization-bindingelement throws#4922

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

Add test case where IteratorBindingInitialization-bindingelement throws#4922
G-Lee1031 wants to merge 1 commit intotc39:mainfrom
G-Lee1031:bindingelemnetlist-throws

Conversation

@G-Lee1031
Copy link
Contributor

Hello.
This PR adds a test case where IteratorBindingInitialization of BindingElementList : [BindingElementList , BindingElisionElement] throws in step 1 or 2.

Check 1 : tests the case where IteratorBindingInitialization throws in step 1.

  • First
    In IteratorBindingInitialization of BindingElementList : [BindingElementList, BindingElisionElement] step 1, IteratorBindingInitialization of BindingElementlist is performed.
  • Second
    In IteratorBindingInitialization of BindingElement : BindingPattern Initializer? v is declared and defined as undefined because iteratorRecord.[[Done]] is true. After that, BindingInitialization is performed with arguments v and environment.
  • Third
    In BindingInitialization of BindingPattern : ArrayBindingPattern step 1, GetIterator(value, sync) throws TypeError since value is undefined.

Check 2 : tests the case where IteratorBindingInitialization throws in step 2.

  • First
    In IteratorBindingInitialization of BindingElementList: [BindingElementList, BindingElisionElement] step 2, IteratorBindingInitialization of BindingElisionElement is performed. After that, since Elision doesn't exist before [y], it directly performs IteratorBindingInitialization of BindingElement.
  • Second and Third steps are the same as Check 1.

@G-Lee1031 G-Lee1031 requested a review from a team as a code owner February 12, 2026 05:19
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