Bug 1363959 - Compare jsid equality instead of string comparison in XrayResolveOwnProperty(). r=bholley

MozReview-Commit-ID: LFK5hR2RBGF

--HG--
extra : rebase_source : 1aa34b9998840302574f23c00d15ec713f70dcde
This commit is contained in:
Ting-Yu Chou 2017-07-20 15:12:03 +08:00
parent 5258e1e147
commit a4c77b8ab9

View File

@ -1741,7 +1741,7 @@ XrayResolveOwnProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
return true;
}
} else if (type == eInterface) {
if (IdEquals(id, "prototype")) {
if (id == GetJSIDByIndex(cx, XPCJSContext::IDX_PROTOTYPE)) {
return nativePropertyHooks->mPrototypeID == prototypes::id::_ID_Count ||
ResolvePrototypeOrConstructor(cx, wrapper, obj,
nativePropertyHooks->mPrototypeID,
@ -1771,7 +1771,7 @@ XrayResolveOwnProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
} else {
MOZ_ASSERT(IsInterfacePrototype(type));
if (IdEquals(id, "constructor")) {
if (id == GetJSIDByIndex(cx, XPCJSContext::IDX_CONSTRUCTOR)) {
return nativePropertyHooks->mConstructorID == constructors::id::_ID_Count ||
ResolvePrototypeOrConstructor(cx, wrapper, obj,
nativePropertyHooks->mConstructorID,