1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 15:30:58 +01:00

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:
epriestley 2014-04-03 09:43:13 -07:00
parent 9fedd343eb
commit f36d504b75

View file

@ -48,15 +48,8 @@ JX.$E = function(message) {
*
* @group util
*/
JX.$A = function(mysterious_arraylike_object) {
// NOTE: This avoids the Array.slice() trick because some bizarre COM 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;
JX.$A = function(object) {
return Array.prototype.slice.call(object);
};