X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=src%2Fyuu%2Fyf.js;h=ab3969b664d824f43131d67e28b1ae2cd6a125e0;hp=0779e7e25268248ec80acb8322b8b83b11a75623;hb=f96f0ecc5cd905dba4d20f3a06d154bf2683bff3;hpb=62a230d8482e5ef39b0e9499e7ae2793aa7f8c82 diff --git a/src/yuu/yf.js b/src/yuu/yf.js index 0779e7e..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,8 @@ case 1: return function () { return f.call(this, arguments); }; default: return function () { - var args = slice(arguments, 0, length - 1); - args.push(slice(arguments, length - 1)); + var args = slice(arguments, 0, length); + args[length - 1] = slice(arguments, length - 1); return f.apply(this, args); }; } @@ -259,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; } @@ -270,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; } @@ -414,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 () {