-
Notifications
You must be signed in to change notification settings - Fork 309
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
resetting/clearing a model: Uncaught TypeError: cb is not a function #644
Comments
I think, it was connected to this: |
I just had the same problem. I think it's due to this commit callback() for callback in callbacks[keypath].slice() when callback in callbacks[keypath] has been replaced with cb() for cb in callbacks[keypath] Some code is missing and causes the error. |
The only requirement to avoid the mem leak is rename the callback var from callback to cb The other changes were to remove redundant code: Anyway, the fastest way to discover is replace with the old code. try As a side note a jsfiddle showing the error and tests are desirable |
I don't quite understand this part of code, but it seems necessary to copy the array (with This situation is somehow quite similar to #650 and I'm starting to think it hides a vicious bug in unbind process... but it's just a thought |
I think you are right. I suggest changing to
Will fix the mem leak and account for this case. |
I reduced the minimum to reproduce the issue: https://jsfiddle.net/3Lbjxbxh/4/ |
I've added a test. You can see here: blikblum@e80e45b |
Thanks, it's on the PR. |
PR has been merged. |
…ix seems to be already effective on ES6 branch
Report fix for #644 on ES6. Only the test has been reported, fix seem…
Maybe I am missing something fundamental.
I am trying to clear out error messages from a form, by replacing the the error model with an empty Object.
My model structure looks like this, when the validation fails:
In order to get rid of the error messages after the validation the error object is set to empty {}
But when that happens, this error is being raised:
Obviously the program expects a function at this point. What's really there is an undefined value.
The text was updated successfully, but these errors were encountered: