mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-27 15:42:26 +01:00
Replace Array.slice conversions of the arguments object with rest parameters.
This commit is contained in:
@@ -389,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);
|
||||
|
||||
@@ -985,9 +985,9 @@ function _runCommands(cmdName, testName, commands) {
|
||||
});
|
||||
}
|
||||
|
||||
function runTest(message, test) {
|
||||
function runTest(message, test, ...args) {
|
||||
if (test)
|
||||
var res = test.apply(null, Array.slice(arguments, runTest.length));
|
||||
var res = test.apply(null, args);
|
||||
if (res !== undefined)
|
||||
jumlib.assert(res, message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user