Bug 1363959 - Compare jsid equality instead of string comparison in XrayResolveOwnProperty(). r=bholley
authorTing-Yu Chou <janus926@gmail.com>
Thu, 20 Jul 2017 15:12:03 +0800
changeset 418655 861e1a6afff7f1ed325c6c4e34e7ad09000bd1d9
parent 418654 3c96d3de9c7c7eea1692c1bdbca882644a587660
child 418656 9599eab713ca6e7660e18307cf418378896f0363
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1363959
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1363959 - Compare jsid equality instead of string comparison in XrayResolveOwnProperty(). r=bholley MozReview-Commit-ID: LFK5hR2RBGF
dom/bindings/BindingUtils.cpp
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -1736,17 +1736,17 @@ XrayResolveOwnProperty(JSContext* cx, JS
     }
 
     // For non-global instance Xrays there are no other properties, so return
     // here for them.
     if (type != eGlobalInstance) {
       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,
                                            JSPROP_PERMANENT | JSPROP_READONLY,
                                            desc, cacheOnHolder);
     }
 
     if (id == SYMBOL_TO_JSID(JS::GetWellKnownSymbol(cx, JS::SymbolCode::hasInstance)) &&
@@ -1766,17 +1766,17 @@ XrayResolveOwnProperty(JSContext* cx, JS
       desc.object().set(wrapper);
       desc.setSetter(nullptr);
       desc.setGetter(nullptr);
       return true;
     }
   } 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,
                                            0, desc, cacheOnHolder);
     }
 
     // The properties for globals live on the instance, so return here as there
     // are no properties on their interface prototype object.