Use Array.prototype.slice in JX.$A
Summary: Being bold. I think it is fine to do this in 2011. Test Plan: Run the new specs. Reviewers: mroch, tomo, epriestley Reviewed By: epriestley Subscribers: chad, epriestley, aran Differential Revision: https://secure.phabricator.com/D835
This commit is contained in:
11
webroot/rsrc/externals/javelin/core/util.js
vendored
11
webroot/rsrc/externals/javelin/core/util.js
vendored
@@ -48,15 +48,8 @@ JX.$E = function(message) {
|
|||||||
*
|
*
|
||||||
* @group util
|
* @group util
|
||||||
*/
|
*/
|
||||||
JX.$A = function(mysterious_arraylike_object) {
|
JX.$A = function(object) {
|
||||||
// NOTE: This avoids the Array.slice() trick because some bizarre COM object
|
return Array.prototype.slice.call(object);
|
||||||
// I dug up somewhere was freaking out when I tried to do it and it made me
|
|
||||||
// very upset, so do not replace this with Array.slice() cleverness.
|
|
||||||
var r = [];
|
|
||||||
for (var ii = 0; ii < mysterious_arraylike_object.length; ii++) {
|
|
||||||
r.push(mysterious_arraylike_object[ii]);
|
|
||||||
}
|
|
||||||
return r;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user