diff --git a/LICENSE b/LICENSE index c3a9eca17..8466855be 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.3.2 - 2014-01-14 +* 4chan X - Version 1.3.2 - 2014-01-15 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index c37561c14..e37735474 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -22,7 +22,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.3.2 - 2014-01-14 +* 4chan X - Version 1.3.2 - 2014-01-15 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -805,16 +805,6 @@ }; })(); - $.remove = function(arr, value) { - var i; - i = arr.indexOf(value); - if (i === -1) { - return false; - } - arr.splice(i, 1); - return true; - }; - $$ = function(selector, root) { if (root == null) { root = d.body; @@ -1624,9 +1614,13 @@ }; SimpleDict.prototype.rm = function(key) { + var i; key = "" + key; - if ($.remove(this.keys, key)) { - return delete this[key]; + if ((i = this.keys.indexOf(key)) !== -1) { + this.keys.splice(i, 1); + if ($.remove(this.keys, key)) { + return delete this[key]; + } } }; diff --git a/builds/crx/script.js b/builds/crx/script.js index c87dcff8b..5fd0faabd 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.3.2 - 2014-01-14 +* 4chan X - Version 1.3.2 - 2014-01-15 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -810,16 +810,6 @@ }; })(); - $.remove = function(arr, value) { - var i; - i = arr.indexOf(value); - if (i === -1) { - return false; - } - arr.splice(i, 1); - return true; - }; - $$ = function(selector, root) { if (root == null) { root = d.body; @@ -1630,9 +1620,13 @@ }; SimpleDict.prototype.rm = function(key) { + var i; key = "" + key; - if ($.remove(this.keys, key)) { - return delete this[key]; + if ((i = this.keys.indexOf(key)) !== -1) { + this.keys.splice(i, 1); + if ($.remove(this.keys, key)) { + return delete this[key]; + } } }; diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index 3e45ed12a..87807ac9c 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -404,11 +404,5 @@ $.set = do -> return <% } %> -$.remove = (arr, value) -> - i = arr.indexOf value - return false if i is -1 - arr.splice i, 1 - true - $$ = (selector, root=d.body) -> [root.querySelectorAll(selector)...] diff --git a/src/General/lib/simpledict.class b/src/General/lib/simpledict.class index 7dddffc69..34ce15cf4 100644 --- a/src/General/lib/simpledict.class +++ b/src/General/lib/simpledict.class @@ -9,6 +9,8 @@ class SimpleDict rm: (key) -> key = "#{key}" - delete @[key] if $.remove @keys, key + if (i = @keys.indexOf key) isnt -1 + @keys.splice i, 1 + delete @[key] if $.remove @keys, key forEach: (fn) -> fn @[key] for key in [@keys...]