From 62a230d8482e5ef39b0e9499e7ae2793aa7f8c82 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Thu, 2 Oct 2014 02:51:38 +0200 Subject: [PATCH] Work around a Safari JIT bug in arguments handling. --- BUGS.org | 3 +++ src/yuu/yf.js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/BUGS.org b/BUGS.org index 30d6f2f..1d11cc7 100644 --- a/BUGS.org +++ b/BUGS.org @@ -4,6 +4,9 @@ performance. ** Use standard Unicode codepoints for icon fonts This is done via the [[https://korewanetadesu.com/pages/fontstandard.html][Font Standard]] icon font. +** Work around incorrect Safari JIT generation. + Some details of the symptoms / likely-but-unproven cause at + https://korewanetadesu.com/safari-jit-bug.html. * v1.2 ** DONE Override the GPU blacklist on GNU/Linux diff --git a/src/yuu/yf.js b/src/yuu/yf.js index 5df966d..0779e7e 100644 --- a/src/yuu/yf.js +++ b/src/yuu/yf.js @@ -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 - 1); + args.push(slice(arguments, length - 1)); + return f.apply(this, args); }; } } -- 2.20.1