From c28d4552257d2d34505c40abf7663032e52f49af Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Wed, 8 Jan 2014 12:02:08 -0700 Subject: [PATCH] Yeah, that wouldn't be good to happen, but.. --- builds/4chan-X.user.js | 3 +++ builds/crx/script.js | 3 +++ src/General/lib/callbacks.class | 2 ++ 3 files changed, 8 insertions(+) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 653d21bc1..b66b530f7 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -820,6 +820,9 @@ Callbacks.prototype.push = function(_arg) { var cb, name; name = _arg.name, cb = _arg.cb; + if (this[name]) { + this.rm(name); + } this[name] = cb; return this.keys.push(name); }; diff --git a/builds/crx/script.js b/builds/crx/script.js index 0870781dc..c2a9a092b 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -825,6 +825,9 @@ Callbacks.prototype.push = function(_arg) { var cb, name; name = _arg.name, cb = _arg.cb; + if (this[name]) { + this.rm(name); + } this[name] = cb; return this.keys.push(name); }; diff --git a/src/General/lib/callbacks.class b/src/General/lib/callbacks.class index fcb735b2b..22afb222c 100644 --- a/src/General/lib/callbacks.class +++ b/src/General/lib/callbacks.class @@ -3,6 +3,8 @@ class Callbacks @keys = [] push: ({name, cb}) -> + @rm name if @[name] + @[name] = cb @keys.push name