This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function F(){} | |
function newApply(ctor, args) { | |
var i, | |
fp = F.prototype = ctor.prototype; // Copy prototype. | |
if(fp) { | |
fp.constructor = ctor; | |
} | |
i = new F; | |
ctor.apply(i, args); // Apply the original constructor. | |
return i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It didn't look like it need much time, or to achieve any depth. Just | |
copy the source text and work down it inserting comments on the things | |
that stand out. When the first line of code is a 'fix' for pre-ECMA 262 | |
3rd edition browsers (a standard that came out in 1999 and where the | |
most recent browser that needed the 'fix' is IE 4, in a system that does | |
not support IE in any version) then you don't need depth to see fault. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- return !!(node && method in node && node[method].apply); | |
1079 + return !!(node && method in node && | |
1080 + (typeof node[method] === 'function' || | |
1081 + String(node[method]).indexOf('function') === 1)); // IE reports as object, prepends space |
NewerOlder