Skip to content

Instantly share code, notes, and snippets.

@jiixyj
Last active January 27, 2016 12:23
Show Gist options
  • Save jiixyj/93277b471590c26cbc3d to your computer and use it in GitHub Desktop.
Save jiixyj/93277b471590c26cbc3d to your computer and use it in GitHub Desktop.
Vimperator hacks for Firefox 44.0a2
diff --git a/common/content/util.js b/common/content/util.js
index e12bee0..2a50b7b 100644
--- a/common/content/util.js
+++ b/common/content/util.js
@@ -827,7 +827,7 @@ const Util = Module("util", {
return {
__proto__: ary,
__iterator__: function () this.iteritems(),
- __noSuchMethod__: function (meth, args) {
+ mapImpl: function (meth, args) {
var res = util.Array[meth].apply(null, [this.__proto__].concat(args));
if (util.Array.isinstance(res))
@@ -836,7 +836,8 @@ const Util = Module("util", {
},
toString: function () this.__proto__.toString(),
concat: function () this.__proto__.concat.apply(this.__proto__, arguments),
- map: function () this.__noSuchMethod__("map", Array.slice(arguments))
+ map: function () this.mapImpl("map", Array.slice(arguments)),
+ flatten: function () this.mapImpl("flatten", arguments)
};
}
}, {
diff --git a/common/modules/template-tag.js b/common/modules/template-tag.js
index 5d7472d..0fb056b 100644
--- a/common/modules/template-tag.js
+++ b/common/modules/template-tag.js
@@ -178,8 +178,9 @@ function templateXML(portion, ...args) // {{{
break;
case ATTR2:
whiteSpace.lastIndex = offset;
- whiteSpace.exec(str);
- offset = whiteSpace.lastIndex;
+ if (whiteSpace.exec(str)) {
+ offset = whiteSpace.lastIndex;
+ }
close = str[offset++];
if (!close) {
if (i >= j) throw SyntaxError("attr right");
diff --git a/vimperator/content/config.js b/vimperator/content/config.js
index 173abe2..02338bc 100644
--- a/vimperator/content/config.js
+++ b/vimperator/content/config.js
@@ -5,7 +5,7 @@
// This work is licensed for reuse under an MIT license. Details are
// given in the License.txt file included with this file.
-const Config = Module("config", ConfigBase, {
+var Config = Module("config", ConfigBase, {
init: function () {
// TODO: delete me when minversion is greater than 34
var {isSupport} = Cu.import("resource://liberator/CheckTemplate.jsm", {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment