Opened 5 years ago

Closed 2 years ago

#18244 closed defect (wontfix)

lang.js fix up the isAlien and _toArray

Reported by: 154371199@… Owned by: dylan
Priority: high Milestone: 1.13
Component: Core Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Hi sir, I have two question as following

(1) isAlien will return true if it is a built in function, but the source file of this method, why it has a !lang.isFunction(it)?

isAlien: function(it){
return it && !lang.isFunction(it) && /\{\s*\[native code\]\s*\}/.test(String(it)); // Boolean

(2) IE9 and above browser can cover the HTMLCollection to Javascript object, In the source, it will call the slow function.

_toArray: has("ie") ?
				function slow(obj, offset, startWith){
					var arr = startWith||[];
					for(var x = offset || 0; x < obj.length; x++){
					return arr;
				return function(obj){
					return ((obj.item) ? slow : efficient).apply(this, arguments);  //IE 9 and above, will call the slow function
			})() : efficient,

Change History (8)

comment:1 Changed 5 years ago by dylan

Milestone: tbd1.11
Priority: undecidedhigh

comment:2 Changed 5 years ago by mdlabrec

Pull request for isAlien issue:

comment:3 Changed 4 years ago by dylan

Owner: set to dylan
Status: newassigned

comment:4 Changed 4 years ago by bill

Component: GeneralCore
Description: modified (diff)

comment:5 Changed 4 years ago by bill

Description: modified (diff)

As I wrote in the PR, ISTM that isAlien() is obeying its spec, which implies that it returns false for normal functions.

Last edited 4 years ago by bill (previous) (diff)

comment:6 Changed 4 years ago by dylan

Milestone: 1.111.12

comment:7 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

comment:8 Changed 2 years ago by dylan

Milestone: 1.151.13
Resolution: wontfix
Status: assignedclosed

Closing this as wontfix, but please reopen if there's a new patch that addresses feedback.

Note: See TracTickets for help on using tickets.