From c6c86fa85877c42de5ce980bbefced34c3812029 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 14 Oct 2010 14:08:12 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20some=20more=20stupid=20bugs=20in=20newer?= =?UTF-8?q?=20J=C3=A4gerMonkey.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/content/commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index a82e58f8..c2760018 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -157,7 +157,7 @@ const Command = Class("Command", { */ hasName: function (name) { 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; }); }, @@ -292,7 +292,7 @@ const Command = Class("Command", { */ parseSpecs: function parseSpecs(specs) { return specs.map(function (spec) { - let [, head, tail] = spec.match(/([^[]+)(?:\[(.*)])?/); + let [, head, tail] = /([^[]+)(?:\[(.*)])?/.exec(spec); return tail ? [head + tail, head] : [head]; }); }