Skip to content

Commit

Permalink
Fix for evancohen/issues/65, extracting argumnets from arrow function…
Browse files Browse the repository at this point in the history
… behaves erratically
  • Loading branch information
andreapply committed Nov 12, 2018
1 parent 279bd67 commit 2c507d0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/annyang-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const commandToRegExp = function (command) {
};

// This method receives an array of callbacks to iterate over, and invokes each of them
const invokeCallbacks = callbacks => {
let args = Array.prototype.slice.call(arguments, 1);
const invokeCallbacks = (callbacks, ...args) => {
callbacks.forEach(callback =>
callback.callback.apply(callback.context, args)
);
Expand Down

0 comments on commit 2c507d0

Please sign in to comment.