X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Ftests%2Ffunctional%2Fdactyl.jsm;h=d738da635b1cfb630e5be285e2384e7d26c94f0b;hb=3d837eb266a3a01d424192aa4ec1a167366178c5;hp=5f7bda5a4b50d4462a2399f9615c09a1860ddf1c;hpb=70740024f9c028c1fd63e1a1850ab062ff956054;p=dactyl.git diff --git a/common/tests/functional/dactyl.jsm b/common/tests/functional/dactyl.jsm index 5f7bda5..d738da6 100644 --- a/common/tests/functional/dactyl.jsm +++ b/common/tests/functional/dactyl.jsm @@ -40,7 +40,6 @@ function assertMessage(funcName, want, got, message) { * @param {MozMillController} controller The browser's MozMill controller. */ function Controller(controller) { - var self = this; this.controller = controller; /** @@ -51,13 +50,13 @@ function Controller(controller) { this.errorCount = 0; - this._countBeep = function countBeep() { - self.beepCount++; + this._countBeep = () => { + this.beepCount++; } this.errors = []; - this._countError = function countError(message, highlight) { + this._countError = (message, highlight) => { if (/\b(Error|Warning)Msg\b/.test(highlight)) - self.errors.push(String(message)); + this.errors.push(String(message)); } this.modules.dactyl.registerObserver("beep", this._countBeep); this.modules.dactyl.registerObserver("echoLine", this._countError); @@ -251,8 +250,7 @@ Controller.prototype = { * @param {string} message The message to display upon assertion failure. @optional */ wrapAssertNoErrors: function (func, message) { - let self = this; - return function wrapped() self.assertNoErrors(func, this, arguments, message); + return () => this.assertNoErrors(func, this, arguments, message); }, /** @@ -391,10 +389,10 @@ Controller.prototype = { * @param {...} Extra arguments are passed to the completion * function directly. */ - testCompleter: wrapAssertNoErrors(function testCompleter(self, func, string, message) { + testCompleter: wrapAssertNoErrors(function testCompleter(self, func, string, message, ...args) { var context = this.modules.CompletionContext(string || ""); context.tabPressed = true; - context.forkapply("completions", 0, self, func, Array.slice(arguments, testCompleter.length)); + context.forkapply("completions", 0, self, func, args); utils.assert("dactyl.runCompletions", context.wait(5000), message || "Completion failed: " + self + "." + func);