Bug 247790 - Using async function to Symbol.iterator results in infinite loop
Summary: Using async function to Symbol.iterator results in infinite loop
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-11 01:24 PST by Kanguk Lee
Modified: 2022-11-14 08:48 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kanguk Lee 2022-11-11 01:24:35 PST
// input.js
var obj = {
  [ Symbol . iterator ]: async ( ) => {
      await 0 ;
      while ( true ) ;
  }
}

for ( { } of obj );
______________________________

Hello,

Executing the input.js using JSC, it throws TypeError but never terminates.

Running the input.js with JSC results in:

---
$ jsc input.js
Exception: TypeError: undefined is not a function (near '...{ } of obj...')
global code@input.js:8:10

// infinite loop

---


WebKit version: 615.1.10
Comment 1 Radar WebKit Bug Importer 2022-11-14 08:15:52 PST
<rdar://problem/102321717>
Comment 2 Yusuke Suzuki 2022-11-14 08:48:32 PST
This is expected. The first microtask throws an error. But it does not matter to the second microtask.