ReactiveX / rxjs

A reactive programming library for JavaScript
https://rxjs.dev
Apache License 2.0
30.67k stars 3k forks source link

The async generator example in `from` crashes the browser. #7377

Open dpurp-db opened 10 months ago

dpurp-db commented 10 months ago

Describe the bug

Running the async generator example in Stackblitz (link) crashes the page in Chrome v119

https://rxjs.dev/api/index/function/from#examples

Expected behavior

Stackblitz logs the expected outcome:

// Logs:
// 3
// 6
// 12
// 24
// 48
// 96
// 192
// 384
// 768
// 1536

Reproduction code

import { from, take } from 'rxjs';

function* generateDoubles(seed) {
   let i = seed;
   while (true) {
     yield i;
     i = 2 * i; // double it
   }
}

const iterator = generateDoubles(3);
const result = from(iterator).pipe(take(10));

result.subscribe(x => console.log(x));

Reproduction URL

https://stackblitz.com/run?devtoolsheight=50&file=index.ts

Version

7.8.1

Environment

Chrome v119

Additional context

No response

jakovljevic-mladen commented 9 months ago

Hi, I can't reproduce this issue. Is there a chance you could create a reproducible code and post a proper link that would work? Current link does not work. Also, pasting the provided code example to seems to Stackblitz works for me and it doesn't seem to freeze my browser.