diff options
author | Jesús <heckyel@hyperbola.info> | 2019-12-30 16:10:54 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-12-30 16:10:54 -0500 |
commit | d1d3aaa224ec068dc8d267e4d64255f88b6641a0 (patch) | |
tree | 9e6b679c529dca7217becc7856ea6aac2d3069f7 /lib/CallbackWrapper.jsm | |
parent | fa6fb12f089ff0170d0f3ee93b6ce7131a6a2254 (diff) | |
download | ematrix-d1d3aaa224ec068dc8d267e4d64255f88b6641a0.tar.lz ematrix-d1d3aaa224ec068dc8d267e4d64255f88b6641a0.tar.xz ematrix-d1d3aaa224ec068dc8d267e4d64255f88b6641a0.zip |
fix syntax libraries
Diffstat (limited to 'lib/CallbackWrapper.jsm')
-rw-r--r-- | lib/CallbackWrapper.jsm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CallbackWrapper.jsm b/lib/CallbackWrapper.jsm index 1d3664e..55fdf11 100644 --- a/lib/CallbackWrapper.jsm +++ b/lib/CallbackWrapper.jsm @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://gitlab.com/vannilla/ematrix + Home: https://libregit.org/heckyel/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -28,7 +28,7 @@ var EXPORTED_SYMBOLS = ['CallbackWrapper']; var junkyard = []; var CallbackWrapper = function (messageManager, channelName, - listenerId, requestId) { + listenerId, requestId) { // This allows to avoid creating a closure for every single // message which expects an answer. Having a closure created // each time a message is processed has been always bothering @@ -52,19 +52,19 @@ var CallbackWrapper = function (messageManager, channelName, }; CallbackWrapper.factory = function (messageManager, channelName, - listenerId, requestId) { + listenerId, requestId) { let wrapper = junkyard.pop(); if (wrapper) { wrapper.init(messageManager, channelName, listenerId, requestId); return wrapper; } - + return new CallbackWrapper(messageManager, channelName, - listenerId, requestId); + listenerId, requestId); }; CallbackWrapper.prototype.init = function (messageManager, channelName, - listenerId, requestId) { + listenerId, requestId) { this.messageManager = messageManager; this.channelName = channelName; this.listenerId = listenerId; @@ -86,7 +86,7 @@ CallbackWrapper.prototype.proxy = function (response) { // Mark for reuse this.messageManager = this.channelName = - this.requestId = this.listenerId = null; - + this.requestId = this.listenerId = null; + junkyard.push(this); }; |