-
Notifications
You must be signed in to change notification settings - Fork 22
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: Maximum call stack size exceeded (#40) #64
fix: Maximum call stack size exceeded (#40) #64
Conversation
We don't want to be mutating |
d016094
to
4605d5b
Compare
yepp // original
a.push(...b, c)
// replaceMethod = "pushArray"
a.pushArray(b, [c])
// current version
// replaceMethod = "pushArrayNoMethod"
pushArray(a, b, [c])
thats usually slower code-red has no eslint, so the patched code looks a bit ugly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could possibly tweak the naming a bit, but otherwise lgtm
src/utils/push_array.js
Outdated
@@ -0,0 +1,11 @@ | |||
export function push_array(thisArray, ...otherList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be this_array
and other_list
according to Rich's coding convention. though the variable name is perhaps a bit ambiguous - is it "another list" or a "list of other"? I might have the function signature be something like:
export function push_array(array, ...additional_arrays) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherList is a list of otherArray ... maybe call it otherArrayList?
example call:
push_array(thisArray, otherArray1, otherArray2, otherArray3)
… exceeded error Fixes Rich-Harris#40 Alternative to Rich-Harris#64 Part of sveltejs/svelte#4694
closing for #71 - thanks all : ) |
part of sveltejs/svelte#6716
start fixing #40 and sveltejs/svelte#4694