-
Notifications
You must be signed in to change notification settings - Fork 233
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
emit()
arguments
#54
Comments
@jkirkwood maybe submit a PR with this change plus a test case? Is this possibly because of a |
Ah, that's it. From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode#Making_eval_and_arguments_simpler:
When I concat my js files, angular.js is at the top which starts with: /**
* @license AngularJS v1.2.16
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict'; so Should angular-socket-io also be modified to declare angular.module('btford.socket-io', []).
provider('socketFactory', function () {
'use strict';
... |
Yep. would you like to put together a PR? |
Fixed in #55. |
I've been experiencing some strange problems when using the
emit
function with multiple data arguments.For instance when I call
At the beginning of the
emit
function the arguments array looks as expected:However, after
var callback = arguments[lastIndex]
is executed the arguments array is altered like this:It appears that
callback
defined in the function params still points to the arguments array during the function's execution, and is being updated byvar callback = arguments[lastIndex]
.Does this behavior make sense? Im using the latest version of Chrome on OS X.
What's strange is that I only have problems when I concat this file with my other js files. If I run this script without concating them, the arguments array is never altered.
Is this some strange js bug, or am I missing something here. Perhaps the parameters should be removed from the emit function altogether, since they are never referred to anyways? This seems to fix my problem:
The text was updated successfully, but these errors were encountered: