diff --git a/js/src/xpconnect/tests/chrome/test_wrappers.xul b/js/src/xpconnect/tests/chrome/test_wrappers.xul index ce30df6068aa..8faf336d7586 100644 --- a/js/src/xpconnect/tests/chrome/test_wrappers.xul +++ b/js/src/xpconnect/tests/chrome/test_wrappers.xul @@ -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(); diff --git a/js/src/xpconnect/wrappers/XrayWrapper.cpp b/js/src/xpconnect/wrappers/XrayWrapper.cpp index 43ee48e530e8..a3e805b2cb8b 100644 --- a/js/src/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/src/xpconnect/wrappers/XrayWrapper.cpp @@ -739,10 +739,10 @@ XrayWrapper::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;