Created
August 16, 2011 13:12
-
-
Save evilpie/1149041 to your computer and use it in GitHub Desktop.
blabla
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
so well | |
var f = function () {}; | |
var bound = f.bind({}); | |
(new bound) instanceof bound; | |
V = new bound; | |
bound[[HasInstance]](V); | |
/* inside 15.3.4.5.3 [[HasInstance]] (V) */ | |
if (!bound[[Target])) | |
throw; | |
target = bound[[Target]] | |
target[[HasInstance]](V) | |
/* target is just |f| */ | |
/* at this point this is the same as (new bound) instanceof f */ | |
/* 15.3.5.3 [[HasInstance]] (V) */ | |
if (!IsObject(V)) | |
throw; | |
prototype = target.prototype; | |
do { | |
V = V.__proto__; /* V proto is going to be f.prototype, because (new bound) is about the same as (new f) | |
if (V === null) | |
return false; | |
if (V === prototype) | |
return true; /* yaay ! */ | |
} while (true); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well crap, you guys are right. Here is the V8 bug report and explanation by Luke that made it click for me :D