X-Git-Url: https://git.yukkurigames.com/?p=yuu.git;a=blobdiff_plain;f=src%2Fyuu%2Fyf.js;h=3ea8b208802a113342bb25256fd0725645831831;hp=5df966debff5de7ff9e3584c0e5b847101d6d06b;hb=870ba16684b6eab5b8b14a3523e8b6f2e075c675;hpb=68b6de03044888100b10e346df3ef6e81f8ef331 diff --git a/src/yuu/yf.js b/src/yuu/yf.js index 5df966d..3ea8b20 100644 --- a/src/yuu/yf.js +++ b/src/yuu/yf.js @@ -197,8 +197,17 @@ case 1: return function () { return f.call(this, arguments); }; default: return function () { - arguments[length - 1] = slice(arguments, length - 1); - return f.apply(this, arguments); + /* The following code can do this without creating a + new array, but it causes function calls to randomly + not happen in Safari (Mobile and OS X) - presumably + due to some JIT bug, because surrounding it in + an empty try/catch block also makes it work. + + arguments[length - 1] = slice(arguments, length - 1); + */ + var args = slice(arguments, 0, length - 1); + args.push(slice(arguments, length - 1)); + return f.apply(this, args); }; } }