Bug 1260984 (part 1) - Remove ClonedBlockObject::objectOps_. r=jorendorff.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 31 Mar 2016 19:20:04 +1100
changeset 291497 fb1734c047af5bbfa2ee1ec4844dd16764b184e9
parent 291495 1c7548ca0a5cdf41ba19239cb4665bf93218c1ae
child 291498 0ed129db55485ccd748f44b4d0b02de607dd290c
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1260984
milestone48.0a1
Bug 1260984 (part 1) - Remove ClonedBlockObject::objectOps_. r=jorendorff. It's full of nulls which means that JS_NULL_OBJECT_OPS suffices.
js/src/vm/ScopeObject.cpp
--- a/js/src/vm/ScopeObject.cpp
+++ b/js/src/vm/ScopeObject.cpp
@@ -1119,30 +1119,16 @@ ClonedBlockObject::thisValue() const
         return ObjectValue(*ToWindowProxyIfWindow(&v.toObject()));
     }
     return v;
 }
 
 static_assert(StaticBlockScope::RESERVED_SLOTS == ClonedBlockObject::RESERVED_SLOTS,
               "static block scopes and dynamic block environments share a Class");
 
-const ObjectOps ClonedBlockObject::objectOps_ = {
-    nullptr,          /* lookupProperty */
-    nullptr,          /* defineProperty */
-    nullptr,          /* hasProperty */
-    nullptr,          /* getProperty */
-    nullptr,          /* setProperty */
-    nullptr,          /* getOwnPropertyDescriptor */
-    nullptr,          /* deleteProperty */
-    nullptr, nullptr, /* watch/unwatch */
-    nullptr,          /* getElements */
-    nullptr,          /* enumerate (native enumeration of target doesn't work) */
-    nullptr,
-};
-
 const Class ClonedBlockObject::class_ = {
     "Block",
     JSCLASS_HAS_RESERVED_SLOTS(ClonedBlockObject::RESERVED_SLOTS) |
     JSCLASS_IS_ANONYMOUS,
     nullptr, /* addProperty */
     nullptr, /* delProperty */
     nullptr, /* getProperty */
     nullptr, /* setProperty */
@@ -1151,17 +1137,17 @@ const Class ClonedBlockObject::class_ = 
     nullptr, /* mayResolve */
     nullptr, /* finalize */
     nullptr, /* call */
     nullptr, /* hasInstance */
     nullptr, /* construct */
     nullptr, /* trace */
     JS_NULL_CLASS_SPEC,
     JS_NULL_CLASS_EXT,
-    &ClonedBlockObject::objectOps_
+    JS_NULL_OBJECT_OPS
 };
 
 template<XDRMode mode>
 bool
 js::XDRStaticBlockScope(XDRState<mode>* xdr, HandleObject enclosingScope,
                         MutableHandle<StaticBlockScope*> objp)
 {
     /* NB: Keep this in sync with CloneStaticBlockScope. */