diff options
author | Kris Maglione <maglione.k@gmail.com> | 2010-10-14 13:58:18 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2010-10-14 13:58:18 -0400 |
commit | e925a7db012144901eda875940e0d78554b8d686 (patch) | |
tree | 212e7d0372045f2ca57508543676e12037616249 /common/modules/highlight.jsm | |
parent | fbb70c7093cd4377376ae96e7a48d13633aa3806 (diff) | |
download | pentadactyl-e925a7db012144901eda875940e0d78554b8d686.tar.gz |
Fix some stupid bugs in newer JägerMonkey. Closes issue #86.
Diffstat (limited to 'common/modules/highlight.jsm')
-rw-r--r-- | common/modules/highlight.jsm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index 96a142e0..d5d7f711 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -147,11 +147,13 @@ const Highlights = Module("Highlight", { * * @param {string} class */ - selector: function (class_) - class_.replace(/(^|\s)([A-Z]\w+)\b/g, + selector: function (class_) { + const self = this; + return class_.replace(/(^|\s)([A-Z]\w+)\b/g, function (m, n1, hl) n1 + - (this.highlight[hl] && this.highlight[hl].class != class_ - ? this.highlight[hl] : "[dactyl|highlight~=" + hl + "]")), + (self.highlight[hl] && self.highlight[hl].class != class_ + ? self.highlight[hl] : "[dactyl|highlight~=" + hl + "]")); + }, /** * Clears all highlighting rules. Rules with default values are |