{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"closed","user":{"avatar_url":"https://secure.gravatar.com/avatar/ee51332d5269c9e6723d749292d352fe?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ee51332d5269c9e6723d749292d352fe","url":"https://api.github.com/users/dimaf","login":"dimaf","id":804976},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-08T23:25:50Z","comments":1,"closed_at":"2011-11-08T23:25:50Z","url":"https://api.github.com/repos/jupiterjs/jquerymx/issues/87","body":"Hi,\r\nI 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\r\n\r\n```javascript\r\n\r\n    test:function (){\r\n\t\tthis.run(['a','b','c'],this.proxy([\"call1\",\"call2\"]));\r\n\t},\r\n\trun:function(arr,callback){\r\n\t\tcallback(arr);\r\n\t},\r\n\tcall1:function(arr){\r\n\t\tsteal.dev.log(\"array length: \"+arr.length);\r\n\t\treturn arr;\r\n\t},\r\n\tcall2:function(arr){\r\n\t\tsteal.dev.log(\"array length: \"+arr.length);\r\n\t\treturn arr;\r\n\t},\r\n\r\n```\r\n\r\nIf you run \"test\" function \r\nThe output is \r\nsteal.js INFO: array length: 3\r\nsteal.js INFO: array length: 1\r\n\r\nWhere I'd expect to see in both cases Length 3.\r\n\r\nI tried to change  in class.js\r\n\r\n```javascript\r\nif ( f < length - 1 ) {\r\n\tcur = !isArray(cur) || cur._use_call ? [cur] : cur\r\n}\r\n\r\n```\r\n\r\n to\r\n\r\n```javascript\r\nif ( f < length - 1 ) {\r\n\tcur = [cur];\r\n}\r\n\r\n```\r\nThat fixed the issue and everything still seems to work.\r\nAre there any special reasons for that  !isArray(cur) || cur._use_call condition?\r\nafter all apply always wants to have a array of arguments.\r\n\r\nThis problem is also now causing Model to fail when using following config for ajax call\r\n....\r\nsuccess: this.proxy(['models',success]),\r\n...\r\nI saw, since few days this line is comented out in model.js\r\n\r\n//res._use_call = true; //so we don't call next function with all of these\r\n\r\nRegards,\r\nDmytro","html_url":"https://github.com/jupiterjs/jquerymx/issues/87","title":"proxy method not properly passing array return parameters","number":87,"id":2180246,"created_at":"2011-11-08T22:22:55Z"},"action":"closed"}