Skip to content
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 "exceeding maximum call stack" error which caused by mistakenly calling to self.on #90

Merged
merged 2 commits into from
Mar 1, 2013

Conversation

normanzb
Copy link
Contributor

@normanzb normanzb commented Mar 1, 2013

No description provided.

@@ -18,6 +18,7 @@ define([ "../event/emitter", "when", "../pubsub/hub" ], function GadgetModule(Em
var TYPE = "type";
var VALUE = "value";
var SUBSCRIPTIONS = "subscriptions";
var BASE = Emitter.prototype;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we store refs to ON, OFF and REEMIT directly? I'm thinking something along the lines of:

var EMITTER_PROTO = Emitter.prototype;
var ON = EMITTER_PROTO.on;
var OFF = EMITTER_PROTO.off;
var REEMITT = EMITTER_PROTO.reemit;

@mikaelkaron
Copy link
Member

I think that we have the same problem with .reemit ?

@@ -142,7 +143,7 @@ define([ "../event/emitter", "when", "../pubsub/hub" ], function GadgetModule(Em
ARRAY_PUSH.apply(args, ARRAY_SLICE.call(arguments, 1));

// Forward
return self.on.apply(self, args);
return BASE.on.apply(self, args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here we'd do ON.apply(self, args)

@normanzb
Copy link
Contributor Author

normanzb commented Mar 1, 2013

updated

mikaelkaron added a commit that referenced this pull request Mar 1, 2013
fix "exceeding maximum call stack" error which caused by mistakenly calling to self.on
@mikaelkaron mikaelkaron merged commit e71fba5 into troopjs:develop Mar 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants