From 2e173d3e2e7c5a33eb9956b15bdf58eefcf3c2a9 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 10 Nov 2009 18:42:27 +0900 Subject: [PATCH] Fix a wrong reference. --- common/content/autocommands.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 common/content/autocommands.js diff --git a/common/content/autocommands.js b/common/content/autocommands.js old mode 100644 new mode 100755 index e2eef7f9..0adcaba0 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -31,12 +31,14 @@ const AutoCommands = Module("autocommands", { * @param {string} cmd The Ex command to run. */ add: function (events, regex, cmd) { + let self = this; + if (typeof events == "string") { events = events.split(","); liberator.log("DEPRECATED: the events list arg to autocommands.add() should be an array of event names"); } events.forEach(function (event) { - this._store.push(new AutoCommand(event, RegExp(regex), cmd)); + self._store.push(new AutoCommand(event, RegExp(regex), cmd)); }); },