Bug 820665 part 4. Remove no-longer-used IsPlatformObject. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 03 Jan 2013 14:03:16 -0500
changeset 123050 e72009158e15dc3f17af1c70ac358a2264058b73
parent 123049 ed9af04edd8c73649151ad77fd5458943b9ba668
child 123051 358c8fc9b59b4c7f06a66539b4875e7021be4198
push idunknown
push userunknown
push dateunknown
reviewerskhuey
bugs820665
milestone20.0a1
Bug 820665 part 4. Remove no-longer-used IsPlatformObject. r=khuey
dom/bindings/BindingUtils.h
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -234,41 +234,16 @@ IsConvertibleToDictionary(JSContext* cx,
 }
 
 MOZ_ALWAYS_INLINE bool
 IsConvertibleToCallbackInterface(JSContext* cx, JSObject* obj)
 {
   return IsNotDateOrRegExp(cx, obj);
 }
 
-inline bool
-IsPlatformObject(JSContext* cx, JSObject* obj)
-{
-  MOZ_ASSERT(obj);
-  // Fast-path the common cases
-  JSClass* clasp = js::GetObjectJSClass(obj);
-  if (js::Valueify(clasp) == &js::ObjectClass) {
-    return false;
-  }
-  if (IsDOMClass(clasp)) {
-    return true;
-  }
-  // Now for simplicity check for security wrappers before anything else
-  if (js::IsWrapper(obj)) {
-    obj = xpc::Unwrap(cx, obj, false);
-    if (!obj) {
-      // Let's say it's not
-      return false;
-    }
-    clasp = js::GetObjectJSClass(obj);
-  }
-  return IS_WRAPPER_CLASS(js::Valueify(clasp)) || IsDOMClass(clasp) ||
-    JS_IsArrayBufferObject(obj);
-}
-
 // U must be something that a T* can be assigned to (e.g. T* or an nsRefPtr<T>).
 template <class T, typename U>
 inline nsresult
 UnwrapObject(JSContext* cx, JSObject* obj, U& value)
 {
   return UnwrapObject<static_cast<prototypes::ID>(
            PrototypeIDMap<T>::PrototypeID), T>(cx, obj, value);
 }