Bug 604476 - Do a full property resolve when enumerating. r=gal

--HG--
extra : rebase_source : be6ee618aebfed864e737d341208e854061671ee
This commit is contained in:
Blake Kaplan 2010-10-15 18:27:42 -07:00
Родитель 7f28a03fff
Коммит 84dcc4af5f
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -52,6 +52,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=500931
"this is wrapped correctly");
SimpleTest.finish();
}, 0)
var saw0 = false;
for (let i in $('ifr').contentDocument.getElementsByTagName('body')) {
if (i === "0")
saw0 = true;
}
ok(saw0, "properly enumerated the 0 value");
}
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -739,10 +739,10 @@ XrayWrapper<Base, Policy>::enumerate(JSContext *cx, JSObject *wrapper, js::AutoI
// Go through the properties we got and enumerate all native ones.
for (size_t n = 0; n < wnProps.length(); ++n) {
jsid id = wnProps[n];
JSPropertyDescriptor dummy;
if (!ResolveNativeProperty(cx, wrapper, holder, id, false, &dummy))
JSBool hasProp;
if (!JS_HasPropertyById(cx, wrapper, id, &hasProp))
return false;
if (dummy.obj)
if (hasProp)
props.append(id);
}
return true;