diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index 7ceb5e9a..50117628 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -215,18 +215,18 @@ var Abbreviations = Module("abbreviations", { nonkeyword: /[ "']/ }; - this._match = util.regexp(literal(/* + this._match = util.regexp(literal(function () /* (^ | \s | ) (+ )$ | // full-id (^ | \s | ) (+ )$ | // end-id (^ | \s ) (\S* )$ // non-id - */), "x", params); - this._check = util.regexp(literal(/* + */$), "x", params); + this._check = util.regexp(literal(function () /* ^ (?: + | // full-id + | // end-id \S* // non-id ) $ - */), "x", params); + */$), "x", params); }, get allHives() contexts.allGroups.abbrevs, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 752b17dd..53da83a3 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -54,9 +54,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { delete window.liberator; // Prevents box ordering bugs after our stylesheet is removed. - styles.system.add("cleanup-sheet", config.styleableChrome, literal(/* + styles.system.add("cleanup-sheet", config.styleableChrome, literal(function () /* #TabsToolbar tab { display: none; } - */)); + */$)); styles.unregisterSheet("resource://dactyl-skin/dactyl.css"); DOM('#TabsToolbar tab', document).style.display; }, @@ -1041,15 +1041,15 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }, this); }, stringToURLArray: deprecated("dactyl.parseURLs", "parseURLs"), - urlish: Class.Memoize(() => util.regexp(literal(/* + urlish: Class.Memoize(() => util.regexp(literal(function () /* ^ ( + (:\d+)? (/ .*) | + (:\d+) | + \. [a-z0-9]+ | localhost ) $ - */), "ix", { - domain: util.regexp(String.replace(literal(/* + */$), "ix", { + domain: util.regexp(String.replace(literal(function () /* [^ U0000-U002c // U002d-U002e --. U002f // / @@ -1058,7 +1058,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { U005b-U0060 // U0061-U007a A-Z U007b-U007f ] - */), /U/g, "\\u"), "x") + */$), /U/g, "\\u"), "x") })), pluginFiles: {}, diff --git a/common/content/statusline.js b/common/content/statusline.js index caf0390f..992a0d11 100644 --- a/common/content/statusline.js +++ b/common/content/statusline.js @@ -38,20 +38,20 @@ var StatusLine = Module("statusline", { config.tabbrowser.getStatusPanel().hidden = true; if (this.statusBar.localName == "toolbar") { - styles.system.add("addon-bar", config.styleableChrome, literal(/* + styles.system.add("addon-bar", config.styleableChrome, literal(function () /* #status-bar, #dactyl-status-bar { margin-top: 0 !important; } #dactyl-status-bar { min-height: 0 !important; } :-moz-any(#addon-bar, #dactyl-addon-bar) > statusbar { -moz-box-flex: 1 } :-moz-any(#addon-bar, #dactyl-addon-bar) > xul|toolbarspring { visibility: collapse; } #addon-bar > #addonbar-closebutton { visibility: collapse; } - */)); + */$)); overlay.overlayWindow(window, { append: [ ["statusbar", { id: this._statusLine.id, ordinal: "0" }]] }); - highlight.loadCSS(util.compileMacro(literal(/* + highlight.loadCSS(util.compileMacro(literal(function () /* !AddonBar;#addon-bar,#dactyl-addon-bar { padding-left: 0 !important; padding-top: 0 !important; @@ -68,12 +68,12 @@ var StatusLine = Module("statusline", { color: inherit !important; } AddonButton:not(:hover) background: transparent; - */))({ padding: config.OS.isMacOSX ? "padding-right: 10px !important;" : "" })); + */$))({ padding: config.OS.isMacOSX ? "padding-right: 10px !important;" : "" })); if (document.getElementById("appmenu-button")) - highlight.loadCSS(literal(/* + highlight.loadCSS(literal(function () /* AppmenuButton min-width: 0 !important; padding: 0 .5em !important; - */)); + */$)); } let _commandline = "if (window.dactyl) return dactyl.modules.commandline"; diff --git a/common/content/tabs.js b/common/content/tabs.js index 9bf588b9..308ca377 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -36,9 +36,9 @@ var Tabs = Module("tabs", { tabs.switchTo(event.originalTarget.getAttribute("identifier")); }; - this.tabBinding = styles.system.add("tab-binding", "chrome://browser/content/browser.xul", literal(/* + this.tabBinding = styles.system.add("tab-binding", "chrome://browser/content/browser.xul", literal(function () /* xul|tab { -moz-binding: url(chrome://dactyl/content/bindings.xml#tab) !important; } - */).replace(/tab-./g, m => config.OS.isMacOSX ? "tab-mac" : m), + */$).replace(/tab-./g, m => config.OS.isMacOSX ? "tab-mac" : m), false, true); this.timeout(function () { diff --git a/common/make_jar.sh b/common/make_jar.sh index f12bb9bf..37159ab9 100644 --- a/common/make_jar.sh +++ b/common/make_jar.sh @@ -40,7 +40,7 @@ fi mungeliterals=$(cat <<'!' local $/; $_ = <>; - s{(? ] [^ ]* - */), "gx", { - forbid: util.regexp(String.replace(literal(/* + */$), "gx", { + forbid: util.regexp(String.replace(literal(function () /* U0000-U002c // U002d - U002e-U002f U003a-U0040 // U0041-U005a a-z @@ -1269,12 +1269,12 @@ var Commands = Module("commands", { Ufe70-Ufeff // Arabic Presentation Forms-B Uff00-Uffef // Halfwidth and Fullwidth Forms Ufff0-Uffff // Specials - */), /U/g, "\\u"), "x") + */$), /U/g, "\\u"), "x") }), validName: Class.Memoize(function validName() util.regexp("^" + this.nameRegexp.source + "$")), - commandRegexp: Class.Memoize(function commandRegexp() util.regexp(literal(/* + commandRegexp: Class.Memoize(function commandRegexp() util.regexp(literal(function () /* ^ (?P (?P [:\s]*) @@ -1289,7 +1289,7 @@ var Commands = Module("commands", { (?:. | \n)*? )? $ - */), "x", { + */$), "x", { name: this.nameRegexp })), diff --git a/common/modules/config.jsm b/common/modules/config.jsm index dfae6a54..e0272058 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -596,14 +596,14 @@ config.INIT = update(Object.create(config.INIT), config.INIT, { let img = new window.Image; img.src = this.logo || "resource://dactyl-local-content/logo.png"; img.onload = util.wrapCallback(function () { - highlight.loadCSS(literal(/* + highlight.loadCSS(literal(function () /* !Logo { display: inline-block; background: url({src}); width: {width}px; height: {height}px; } - */).replace(/\{(.*?)\}/g, (m, m1) => img[m1])); + */$).replace(/\{(.*?)\}/g, (m, m1) => img[m1])); img = null; }); }, diff --git a/common/modules/help.jsm b/common/modules/help.jsm index cc66a595..f3a7b32c 100644 --- a/common/modules/help.jsm +++ b/common/modules/help.jsm @@ -108,7 +108,7 @@ var Help = Module("Help", { { mimeType: "text/plain;charset=UTF-8" }) .responseText; - let re = util.regexp(UTF8(literal(/* + let re = util.regexp(UTF8(literal(function () /* ^ (?P \s* # .*\n) | ^ (?P \s*) @@ -124,7 +124,7 @@ var Help = Module("Help", { ) | (?: ^ [^\S\n]* \n) + - */)), "gmxy"); + */$)), "gmxy"); let betas = util.regexp(/\[((?:b|rc)\d)\]/, "gx"); diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index 501edde2..ab03dec7 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -229,14 +229,14 @@ var Highlights = Module("Highlight", { return n1 + "[dactyl|highlight~=" + hl + "]"; }), - groupRegexp: util.regexp(literal(/* + groupRegexp: util.regexp(literal(function () /* ^ (\s* (?:\S|\s\S)+ \s+) \{ ([^}]*) \} \s* $ - */), "gmx"), - sheetRegexp: util.regexp(literal(/* + */$), "gmx"), + sheetRegexp: util.regexp(literal(function () /* ^\s* !? \*? (?P (?:[^;\s]|\s[^;\s])+ ) @@ -245,7 +245,7 @@ var Highlights = Module("Highlight", { (?:; (?P (?:[^;\s]|\s[^;\s])+ )? )? \s* (?P .*) $ - */), "x"), + */$), "x"), // /** @@ -328,7 +328,7 @@ var Highlights = Module("Highlight", { commands.add(["hi[ghlight]"], "Set the style of certain display elements", function (args) { - let style = literal(/* + let style = literal(function () /* ; display: inline-block !important; position: static !important; @@ -336,7 +336,7 @@ var Highlights = Module("Highlight", { width: 3em !important; min-width: 3em !important; max-width: 3em !important; height: 1em !important; min-height: 1em !important; max-height: 1em !important; overflow: hidden !important; - */); + */$); let clear = args[0] == "clear"; if (clear) args.shift(); diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 9de04550..24fae9a3 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -680,13 +680,13 @@ var IO = Module("io", { } rtItems.ftdetect.template = //{{{ -literal(/*" Vim filetype detection file +literal(function () /*" Vim filetype detection file
au BufNewFile,BufRead *rc*,*. set filetype= -*/);//}}} +*/$);//}}} rtItems.ftplugin.template = //{{{ -literal(/*" Vim filetype plugin file +literal(function () /*" Vim filetype plugin file
if exists("b:did_ftplugin") @@ -711,9 +711,9 @@ endif let &cpo = s:cpo_save unlet s:cpo_save -*/);//}}} +*/$);//}}} rtItems.syntax.template = //{{{ -literal(/*" Vim syntax file +literal(function () /*" Vim syntax file
if exists("b:current_syntax") @@ -792,7 +792,7 @@ let &cpo = s:cpo_save unlet s:cpo_save " vim: tw=130 et ts=8 sts=4 sw=4: -*/);//}}} +*/$);//}}} const { options } = modules; @@ -1047,7 +1047,7 @@ unlet s:cpo_save }; completion.addUrlCompleter("file", "Local files", function (context, full) { - let match = util.regexp(literal(/* + let match = util.regexp(literal(function () /* ^ (?P (?P @@ -1058,7 +1058,7 @@ unlet s:cpo_save ) (?P \/[^\/]* )? $ - */), "x").exec(context.filter); + */$), "x").exec(context.filter); if (match) { if (!match.path) { context.key = match.proto; diff --git a/common/modules/protocol.jsm b/common/modules/protocol.jsm index d5e6d1a3..69adb6e1 100644 --- a/common/modules/protocol.jsm +++ b/common/modules/protocol.jsm @@ -190,7 +190,7 @@ function XMLChannel(uri, contentType, noErrorChannel, unprivileged) { let type = this.channel.contentType; if (/^text\/|[\/+]xml$/.test(type)) { let stream = services.InputStream(channelStream); - let [, pre, doctype, url, extra, open, post] = util.regexp(literal(/* + let [, pre, doctype, url, extra, open, post] = util.regexp(literal(function () /* ^ ([^]*?) (?: (\s]|\s[^[])*)) @@ -198,7 +198,7 @@ function XMLChannel(uri, contentType, noErrorChannel, unprivileged) { ([^]*) )? $ - */), "x").exec(stream.read(4096)); + */$), "x").exec(stream.read(4096)); this.writes.push(pre); if (doctype) { this.writes.push(doctype + (extra || "") + " [\n"); diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index ee635c20..3689c116 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -469,7 +469,7 @@ var Styles = Module("Styles", { } }, - propertyPattern: util.regexp(literal(/* + propertyPattern: util.regexp(literal(function () /* (?: (?P *) (?P [-a-z]*) @@ -491,14 +491,14 @@ var Styles = Module("Styles", { )? ) (?P * (?: ; | $) ) - */), "gix", + */$), "gix", { space: /(?: \s | \/\* .*? \*\/ )/, string: /(?:" (?:[^\\"]|\\.)* (?:"|$) | '(?:[^\\']|\\.)* (?:'|$) )/ }), patterns: memoize({ - get property() util.regexp(literal(/* + get property() util.regexp(literal(function () /* (?: (?P *) (?P [-a-z]*) @@ -509,26 +509,26 @@ var Styles = Module("Styles", { )? ) (?P * (?: ; | $) ) - */), "gix", this), + */$), "gix", this), - get function() util.regexp(literal(/* + get function() util.regexp(literal(function () /* (?P \s* \( \s* (?: | [^)]* ) \s* (?: \) | $) ) - */), "gx", this), + */$), "gx", this), space: /(?: \s | \/\* .*? \*\/ )/, - get string() util.regexp(literal(/* + get string() util.regexp(literal(function () /* (?P " (?:[^\\"]|\\.)* (?:"|$) | ' (?:[^\\']|\\.)* (?:'|$) ) - */), "gx", this), + */$), "gx", this), - get token() util.regexp(literal(/* + get token() util.regexp(literal(function () /* (?P (?P [-\w]+) ? @@ -538,7 +538,7 @@ var Styles = Module("Styles", { | + | [^;}\s]+ ) - */), "gix", this) + */$), "gix", this) }), /** diff --git a/common/modules/template.jsm b/common/modules/template.jsm index 93b60083..39a42ffd 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -252,11 +252,11 @@ var Template = Module("Template", { return [tag, { xmlns: "dactyl" }, topic]; }, linkifyHelp: function linkifyHelp(str, help) { - let re = util.regexp(literal(/* + let re = util.regexp(literal(function () /* (?P
 [/\s]|^)
             (?P '[\w-]+' | :(?:[\w-]+!?|!) | (?:._)?<[\w-]+>\w* | \b[a-zA-Z]_(?:[\w[\]]+|.) | \[[\w-;]+\] | E\d{3} )
             (?=      [[\)!,:;./\s]|$)
-        */), "gx");
+        */$), "gx");
         return this.highlightSubstrings(str, (function () {
             for (let res in re.iterate(str))
                 yield [res.index + res.pre.length, res.tag.length];
diff --git a/common/modules/util.jsm b/common/modules/util.jsm
index a0d0f090..0f3fae4e 100644
--- a/common/modules/util.jsm
+++ b/common/modules/util.jsm
@@ -359,14 +359,14 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
 
         let defaults = { lt: "<", gt: ">" };
 
-        let re = util.regexp(literal(/*
+        let re = util.regexp(literal(function () /*
             ([^]*?) // 1
             (?:
                 (<\{) | // 2
                 (< ((?:[a-z]-)?[a-z-]+?) (?:\[([0-9]+)\])? >) | // 3 4 5
                 (\}>) // 6
             )
-        */), "gixy");
+        */$), "gixy");
         macro = String(macro);
         let end = 0;
         for (let match in re.iterate(macro)) {
@@ -749,7 +749,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
      *
      * @returns {XMLHttpRequest}
      */
-    httpGet: function httpGet(url, params={}, self) {
+    httpGet: function httpGet(url, params={}, self=null) {
         if (callable(params))
             // Deprecated.
             params = { callback: params.bind(self) };
@@ -908,7 +908,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
     },
 
     // ripped from Firefox; modified
-    unsafeURI: Class.Memoize(() => util.regexp(String.replace(literal(/*
+    unsafeURI: Class.Memoize(() => util.regexp(String.replace(literal(function () /*
             [
                 \s
                 // Invisible characters (bug 452979)
@@ -922,7 +922,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
                 // Bidi formatting characters. (RFC 3987 sections 3.2 and 4.1 paragraph 6)
                 U200E U200F U202A U202B U202C U202D U202E
             ]
-        */), /U/g, "\\u"),
+        */$), /U/g, "\\u"),
         "gx")),
     losslessDecodeURI: function losslessDecodeURI(url) {
         return url.split("%25").map(function (url) {