Bug 1390074 - Remove unused nsJSObjWrapper::HasOwnProperty method. r=njn
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 15 Aug 2017 16:14:21 +0200
changeset 374787 c8a1fb34d90906002946ec7e1a336e494eda55a3
parent 374786 5322ba58976c4be04f11cec36676af2755562970
child 374788 35622c347169c77eb68f8f62c7f4b4ecd0e2a60f
push id93764
push userjandemooij@gmail.com
push dateTue, 15 Aug 2017 14:16:31 +0000
treeherdermozilla-inbound@35622c347169 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1390074
milestone57.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 1390074 - Remove unused nsJSObjWrapper::HasOwnProperty method. r=njn
dom/plugins/base/nsJSNPRuntime.cpp
dom/plugins/base/nsJSNPRuntime.h
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -2249,43 +2249,8 @@ NPObjectMember_toPrimitive(JSContext *cx
 
   args.rval().set(memberPrivate->fieldValue);
   if (args.rval().isObject()) {
     JS::Rooted<JSObject*> objVal(cx, &args.rval().toObject());
     return JS::ToPrimitive(cx, objVal, hint, args.rval());
   }
   return true;
 }
-
-// static
-bool
-nsJSObjWrapper::HasOwnProperty(NPObject *npobj, NPIdentifier npid)
-{
-  NPP npp = NPPStack::Peek();
-  nsIGlobalObject* globalObject = GetGlobalObject(npp);
-  if (NS_WARN_IF(!globalObject)) {
-    return false;
-  }
-
-  dom::AutoEntryScript aes(globalObject, "NPAPI HasOwnProperty");
-  JSContext *cx = aes.cx();
-
-  if (!npobj) {
-    ThrowJSExceptionASCII(cx,
-                          "Null npobj in nsJSObjWrapper::NP_HasOwnProperty!");
-
-    return false;
-  }
-
-  nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
-  bool found, ok = false;
-
-  AutoJSExceptionSuppressor suppressor(aes, npjsobj);
-  JS::Rooted<JSObject*> jsobj(cx, npjsobj->mJSObj);
-  JSAutoCompartment ac(cx, jsobj);
-  MarkCrossZoneNPIdentifier(cx, npid);
-
-  NS_ASSERTION(NPIdentifierIsInt(npid) || NPIdentifierIsString(npid),
-               "id must be either string or int!\n");
-  JS::Rooted<jsid> id(cx, NPIdentifierToJSId(npid));
-  ok = ::JS_AlreadyHasOwnPropertyById(cx, jsobj, id, &found);
-  return ok && found;
-}
--- a/dom/plugins/base/nsJSNPRuntime.h
+++ b/dom/plugins/base/nsJSNPRuntime.h
@@ -54,17 +54,16 @@ public:
 class nsJSObjWrapper : public NPObject
 {
 public:
   JS::Heap<JSObject *> mJSObj;
   const NPP mNpp;
   bool mDestroyPending;
 
   static NPObject* GetNewOrUsed(NPP npp, JS::Handle<JSObject*> obj);
-  static bool HasOwnProperty(NPObject* npobj, NPIdentifier npid);
 
   void trace(JSTracer* trc) {
       JS::TraceEdge(trc, &mJSObj, "nsJSObjWrapper");
   }
 
 protected:
   explicit nsJSObjWrapper(NPP npp);
   ~nsJSObjWrapper();