Bug 536512 - Ignore security wrappers when computing instanceof. r=brendan

--HG--
extra : rebase_source : 685f05cbb79288a976242c2b4908023a7ed1b035
This commit is contained in:
Blake Kaplan 2009-12-23 14:09:08 -08:00
parent 55d140a7e2
commit a950e7cc20
2 changed files with 3 additions and 1 deletions

View File

@ -5539,7 +5539,7 @@ js_IsDelegate(JSContext *cx, JSObject *obj, jsval v, JSBool *bp)
*bp = JS_FALSE;
if (JSVAL_IS_PRIMITIVE(v))
return JS_TRUE;
obj2 = JSVAL_TO_OBJECT(v);
obj2 = js_GetWrappedObject(cx, JSVAL_TO_OBJECT(v));
while ((obj2 = OBJ_GET_PROTO(cx, obj2)) != NULL) {
if (obj2 == obj) {
*bp = JS_TRUE;

View File

@ -7,6 +7,8 @@
</head>
<body>
<script class="testbody" type="text/javascript;version=1.7">
ok(window instanceof Object, "window is instanceof Object");
location.foopy = 3;
var xow_answer = [];