-
Notifications
You must be signed in to change notification settings - Fork 375
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
proxy method not properly passing array return parameters #87
Comments
You have to return [arr]. Just make it return an array of your array. |
yes i saw that comment to proxy method But actually how i came to this problem is primary that models method is not working anymore i saw in commit 92d8f88 so either proxy needs to be fixed or that commented out line should be enabled again |
you should no longer be using this.proxy(['models',success]) like that anymore, instead you should be setting the dataType to: "json recipe.models" |
btw, was that documented anywhere to use it like that? I've tried to clean them all from the docs. |
Yes in new code we use either simple model definitions or properly setting type as you mentioned in the previous post, and everything works fine it's just the old code stopped working now after that commit, so I was wondering why -----Original Message----- btw, was that documented anywhere to use it like that? I've tried to clean them all from the docs. Reply to this email directly or view it on GitHub: |
Hi,
I think there is a problem with proxy method. If I call proxy with multiple callback functions that return array back, that array is not properly passed to the next callback function. Here is short example that demonstrates the problem
If you run "test" function
The output is
steal.js INFO: array length: 3
steal.js INFO: array length: 1
Where I'd expect to see in both cases Length 3.
I tried to change in class.js
to
That fixed the issue and everything still seems to work.
Are there any special reasons for that !isArray(cur) || cur._use_call condition?
after all apply always wants to have a array of arguments.
This problem is also now causing Model to fail when using following config for ajax call
....
success: this.proxy(['models',success]),
...
I saw, since few days this line is comented out in model.js
//res._use_call = true; //so we don't call next function with all of these
Regards,
Dmytro
The text was updated successfully, but these errors were encountered: