Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/common.js

Issue 6327452271902720: Pass return value of ext.onMessage listener through to chrome.runtime.onMessage (Closed)
Patch Set: Created April 14, 2014, 9:12 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/ext/common.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/common.js
===================================================================
--- a/ext/common.js
+++ b/ext/common.js
@@ -37,15 +37,19 @@
if (idx != -1)
this._listeners.splice(idx, 1);
},
- _dispatch: function(cancelable, args)
+ _dispatch: function()
{
+ var result = null;
+
for (var i = 0; i < this._listeners.length; i++)
{
- var result = this._listeners[i].apply(null, arguments);
+ result = this._listeners[i].apply(null, arguments);
+
if (this._cancelable && result === false)
- return false;
+ break;
}
- return true;
+
+ return result;
}
};
})();
« no previous file with comments | « chrome/ext/common.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld