diff options
author | Kris Maglione <maglione.k@gmail.com> | 2014-02-25 09:19:34 -0800 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2014-02-25 09:19:34 -0800 |
commit | 0a9b503bca3708b1cabe2e8cbf4034c5466ad901 (patch) | |
tree | 5bcc7560edcbe632d31a10f7926e53552f0f0b76 /common/modules/styles.jsm | |
parent | f0dbb9a3148f975ba5e57405038b18539fa9cce5 (diff) | |
download | pentadactyl-0a9b503bca3708b1cabe2e8cbf4034c5466ad901.tar.gz |
Fix styles cleanup issue.
Diffstat (limited to 'common/modules/styles.jsm')
-rw-r--r-- | common/modules/styles.jsm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index d4ce815f..5c1ee972 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -111,8 +111,10 @@ var Hive = Class("Hive", { }, cleanup: function cleanup() { - for (let sheet in values(this.sheets)) - sheet.enabled = false; + for (let sheet of this.sheets) + util.trapErrors(() => { + sheet.enabled = false; + }); }, __iterator__: function () Iterator(this.sheets), @@ -137,8 +139,12 @@ var Hive = Class("Hive", { */ add: function add(name, filter, css, agent, lazy) { - if (!isArray(filter)) + if (isArray(filter)) + // Need an array from the same compartment. + filter = Array.slice(filter); + else filter = filter.split(","); + if (name && name in this.names) { var sheet = this.names[name]; sheet.agent = agent; |