Skip to content

fix(takeLast): handle Infinity count - #7635

Open
yowainwright wants to merge 1 commit into
ReactiveX:masterfrom
yowainwright:fix/take-last-infinity-v9
Open

fix(takeLast): handle Infinity count#7635
yowainwright wants to merge 1 commit into
ReactiveX:masterfrom
yowainwright:fix/take-last-infinity-v9

Conversation

@yowainwright

Copy link
Copy Markdown

Description

takeLast(Infinity) currently allocates new Array(Infinity), which throws RangeError: Invalid array length.

This update assigns a growable buffer only for Infinity, while preserving the existing finite-count ring buffer and non-positive early-complete behavior.

  • The regression test verifies that values are still emitted on completion.

Related issue (if exists)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@yowainwright