1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 13:37:58 +01:00

Fix some more stupid bugs in newer JägerMonkey.

This commit is contained in:
Kris Maglione
2010-10-14 14:08:12 -04:00
parent e925a7db01
commit c6c86fa858

View File

@@ -157,7 +157,7 @@ const Command = Class("Command", {
*/ */
hasName: function (name) { hasName: function (name) {
return this.specs.some(function (spec) { return this.specs.some(function (spec) {
let [, head, tail] = spec.match(/([^[]+)(?:\[(.*)])?/); let [, head, tail] = /([^[]+)(?:\[(.*)])?/.exec(spec);
return name.indexOf(head) == 0 && (head + (tail || "")).indexOf(name) == 0; return name.indexOf(head) == 0 && (head + (tail || "")).indexOf(name) == 0;
}); });
}, },
@@ -292,7 +292,7 @@ const Command = Class("Command", {
*/ */
parseSpecs: function parseSpecs(specs) { parseSpecs: function parseSpecs(specs) {
return specs.map(function (spec) { return specs.map(function (spec) {
let [, head, tail] = spec.match(/([^[]+)(?:\[(.*)])?/); let [, head, tail] = /([^[]+)(?:\[(.*)])?/.exec(spec);
return tail ? [head + tail, head] : [head]; return tail ? [head + tail, head] : [head];
}); });
} }