Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] introduce helper method to prevent push maximum call stack size exceeded error #71

Merged
merged 3 commits into from Jan 31, 2022

Conversation

dummdidumm
Copy link

@dummdidumm dummdidumm commented Jan 29, 2022

As discussed in the maintainers meeting, this just introduces a simple push_array method

Fixes #40
Alternative to / closes #64
Part of sveltejs/svelte#4694

Credit to @milahu for finding the issue, we should add a "co-authored by"-message to the merge.

Copy link
Contributor

@benmccann benmccann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thanks for tackling this!

for (let i = 0; i < items.length; i++) {
array.push(items[i]);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like there's whitespace before the } which shouldn't be necessary. same above before the export

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm no longer able to format code since using Prettier 😄 Fixed

* Does `array.push` for all `items`.
* Needed because `array.push(...items)` throws
* "Maximum call stack size exceeded" when items
* is too big of an array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a pretty short line wrap length

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted 👍

@Rich-Harris Rich-Harris merged commit 157710e into Rich-Harris:master Jan 31, 2022
@dummdidumm dummdidumm deleted the max-callstacksize branch January 31, 2022 20:19
Sign up for free to 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.

Array push spread v8
3 participants