Fix spread test fail.

This commit is contained in:
John-David Dalton
2015-11-28 23:33:47 -06:00
parent 3874b5bf84
commit 0a55eff5d5
2 changed files with 14 additions and 3 deletions

View File

@@ -383,7 +383,8 @@
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
var length = args ? args.length : 0;
switch (length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);