From 597c6c07f7120d253e83fa110db8842bfa05859f Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Tue, 8 Apr 2014 18:07:58 -0700 Subject: [PATCH] Switch back to janky array copying Summary: Bad news @cpojer @tomo. IE8 doesn't like you. Test Plan: Load a diff in IE8; see changes and don't get JS errors. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, tomo, Korvin, cpojer Differential Revision: https://secure.phabricator.com/D8728 --- resources/celerity/map.php | 6 +++--- webroot/rsrc/externals/javelin/core/util.js | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 9c66eeb279..f54a49b935 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -14,7 +14,7 @@ return array( 'differential.pkg.js' => '11a5b750', 'diffusion.pkg.css' => '3783278d', 'diffusion.pkg.js' => '5b4010f4', - 'javelin.pkg.js' => 'ec6c9ac3', + 'javelin.pkg.js' => 'a10417f3', 'maniphest.pkg.css' => 'f1887d71', 'maniphest.pkg.js' => '2fe8af22', 'rsrc/css/aphront/aphront-bars.css' => '231ac33c', @@ -178,7 +178,7 @@ return array( 'rsrc/externals/javelin/core/init.js' => 'b88ab49e', 'rsrc/externals/javelin/core/init_node.js' => 'd7dde471', 'rsrc/externals/javelin/core/install.js' => '52a92793', - 'rsrc/externals/javelin/core/util.js' => 'e1d96281', + 'rsrc/externals/javelin/core/util.js' => '65b0b249', 'rsrc/externals/javelin/docs/Base.js' => '897bb199', 'rsrc/externals/javelin/docs/onload.js' => '81fb4862', 'rsrc/externals/javelin/ext/fx/Color.js' => '7e41274a', @@ -655,7 +655,7 @@ return array( 'javelin-typeahead-source' => '62e18640', 'javelin-typeahead-static-source' => 'cdde23f1', 'javelin-uri' => 'd9a9b862', - 'javelin-util' => 'e1d96281', + 'javelin-util' => '65b0b249', 'javelin-vector' => '403a3dce', 'javelin-view' => '0f764c35', 'javelin-view-html' => 'e5b406f9', diff --git a/webroot/rsrc/externals/javelin/core/util.js b/webroot/rsrc/externals/javelin/core/util.js index bc0d64f0bf..efd4b7c39a 100644 --- a/webroot/rsrc/externals/javelin/core/util.js +++ b/webroot/rsrc/externals/javelin/core/util.js @@ -49,7 +49,13 @@ JX.$E = function(message) { * @group util */ JX.$A = function(object) { - return Array.prototype.slice.call(object); + // IE8 throws "JScript object expected" when trying to call + // Array.prototype.slice on a NodeList, so just copy items one by one here. + var r = []; + for (var ii = 0; ii < object.length; ii++) { + r.push(object[ii]); + } + return r; };