X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=src%2Fyuu%2Fyf.js;h=ab3969b664d824f43131d67e28b1ae2cd6a125e0;hp=5df966debff5de7ff9e3584c0e5b847101d6d06b;hb=de6ca4453d2a81955bba2436f69be912fd70efb0;hpb=d2962105772fbdc548118bd65cd5bb4934e66085 diff --git a/src/yuu/yf.js b/src/yuu/yf.js index 5df966d..ab3969b 100644 --- a/src/yuu/yf.js +++ b/src/yuu/yf.js @@ -1,7 +1,7 @@ /* Copyright 2014 Yukkuri Games Licensed under the terms of the GNU GPL v2 or later - @license http://www.gnu.org/licenses/gpl-2.0.html - @source: http://yukkurigames.com/yuu/ + @license https://www.gnu.org/licenses/gpl-2.0.html + @source: https://yukkurigames.com/yuu/ */ (function () { @@ -197,8 +197,9 @@ case 1: return function () { return f.call(this, arguments); }; default: return function () { - arguments[length - 1] = slice(arguments, length - 1); - return f.apply(this, arguments); + var args = slice(arguments, 0, length); + args[length - 1] = slice(arguments, length - 1); + return f.apply(this, args); }; } } @@ -258,8 +259,9 @@ map.call(thisArg, callback, ...). */ var a = []; - arguments[0] = compose(pusher(a), arguments[0]); - each.apply(this, arguments); + var args = slice(arguments); + args[0] = compose(pusher(a), args[0]); + each.apply(this, args); return a; } @@ -269,8 +271,9 @@ As eachr is to each, so mapr is to map. */ var a = []; - arguments[0] = compose(pusher(a), arguments[0]); - eachr.apply(this, arguments); + var args = slice(arguments); + args[0] = compose(pusher(a), args[0]); + eachr.apply(this, args); return a; } @@ -413,8 +416,9 @@ } function every () { - arguments[0] = not(arguments[0] || I); - return !some.apply(this, arguments); + var args = slice(arguments); + args[0] = not(args[0] || I); + return !some.apply(this, args); } function none () {