]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/modules/highlight.jsm
Import r6948 from upstream hg supporting Firefox up to 24.*
[dactyl.git] / common / modules / highlight.jsm
index bf242e08f70eed2c3caaa0354166c9ac38a35c78..fca93478b3f7ce514cabba374e700eaf5bde62a8 100644 (file)
@@ -218,11 +218,12 @@ var Highlights = Module("Highlight", {
      * @param {string} class
      */
     selector: function selector(class_)
-        let (self = this)
-           class_.replace(/(^|[>\s])([A-Z][\w-]+)\b/g,
-            function (m, n1, hl) n1 +
-                (self.highlight[hl] && self.highlight[hl].class != class_
-                    ? self.highlight[hl].selector : "[dactyl|highlight~=" + hl + "]")),
+        class_.replace(/(^|[>\s])([A-Z][\w-]+)\b/g,
+            (m, n1, hl) => {
+                if (this.highlight[hl] && this.highlight[hl].class != class_)
+                    return n1 + this.highlight[hl].selector;
+                return n1 + "[dactyl|highlight~=" + hl + "]";
+            }),
 
     groupRegexp: util.regexp(literal(/*
         ^
@@ -452,4 +453,4 @@ var Highlights = Module("Highlight", {
 
 endModule();
 
-// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
+// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript: