Apply rest arguments transform.

This commit is contained in:
John-David Dalton
2017-01-06 15:49:42 -08:00
parent f4a6e9ede9
commit bf54267f0b
7 changed files with 15 additions and 15 deletions

View File

@@ -18,9 +18,9 @@ function createBind(func, bitmask, thisArg) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
function wrapper(...args) {
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
return fn.apply(isBind ? thisArg : this, args);
}
return wrapper;
}