Reputation: 7213
So I recently noticed that when I console.log a YUI node and inspect its _node attribute, that object has fields like "childNodes: NodeList" where NodeList is just a JS object. How does YUI provide meta-information so that web inspector knows that this object is actually a NodeList?
It may be extremely useful for debugging to be able to provide meta type information for object blobs.
Thanks
Upvotes: 0
Views: 38
Reputation: 2236
There is no meta-data. NodeList is the name of the class, and debuggers can see what class every object belongs to. In your example, somewhere a NodeList was created by calling
new NodeList();
and the engine remembers that type information.
Upvotes: 1