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
Timob 10463:Android: Implement new bubbling architecture as prescribed in TIMOB-10372 #3124
Conversation
if (!handler.listener || !(handler.listener.call)) { | ||
if (kroll.DBG) { | ||
kroll.log(TAG, "handler for event '" + type + "' is " + (typeof handler.listener) + " and cannot be called."); | ||
} | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the handler for the event can't be called, shouldn't we just return? Do we even want to bubble it up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, eg. a view in the window, only window has the listener, when we click the view, the window's listener should be invoked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense. Then we should probably merge the kroll.DBG condition with the previous if statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better not merging them because there is "else" block after that.
Code reviewed. Please address comments. |
Updated. Please review. |
Updated. Please review. |
…e into timob-10463
// Set the "bubbles" and "cancelBubble" properties for event data. | ||
if (data !== null && typeof data == "object") { | ||
if (data.bubbles) { | ||
data.bubbles = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having an if-else statement, you can just do data.bubbles = !!data.bubbles
I'm acting as second reviewer. |
listeners; | ||
|
||
// Set the "bubbles" and "cancelBubble" properties for event data. | ||
if (data !== null && typeof data == "object") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be typeof data ===
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeof will always return a string. So it is fine to use "==" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!! :)
CR accepted |
Code reviewed and functionally tested. Ran KS and Anvil on both runtimes. Also ran all of the TIMOB tickets mentioned in the test steps on both runtimes. Request Accepted |
Timob 10463:Android: Implement new bubbling architecture as prescribed in TIMOB-10372
http://jira.appcelerator.org/browse/TIMOB-10463
Test steps in JIRA.
The doc is updated in #3114