Bug 757562 - Remove JSRESOLVE_CLASSNAME. r=dmandelin
authorJeff Walden <jwalden@mit.edu>
Mon, 21 May 2012 18:08:11 -0700
changeset 94959 a33088aeb47bad3ecca047a3e11f034f48019c61
parent 94958 81c2e2ea2dbf58ef63c659b290dd612ead2cede9
child 94960 7ff28f4ea8703a9579bb083ebfac7c5cd85d3d6e
push id797
push userrcampbell@mozilla.com
push dateSat, 26 May 2012 17:15:03 +0000
treeherderfx-team@ebc06677c620 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmandelin
bugs757562
milestone15.0a1
Bug 757562 - Remove JSRESOLVE_CLASSNAME. r=dmandelin
content/xbl/src/nsXBLBinding.cpp
dom/base/nsDOMClassInfo.cpp
js/src/jsapi.h
js/src/jsobj.cpp
--- a/content/xbl/src/nsXBLBinding.cpp
+++ b/content/xbl/src/nsXBLBinding.cpp
@@ -1201,19 +1201,17 @@ nsXBLBinding::DoInitJSClass(JSContext *c
       char buf[20];
       PR_snprintf(buf, sizeof(buf), " %lx", parent_proto_id);
       className.Append(buf);
     }
   }
 
   jsval val;
   JSObject* proto = NULL;
-  if ((!::JS_LookupPropertyWithFlags(cx, global, className.get(),
-                                     JSRESOLVE_CLASSNAME,
-                                     &val)) ||
+  if ((!::JS_LookupPropertyWithFlags(cx, global, className.get(), 0, &val)) ||
       JSVAL_IS_PRIMITIVE(val)) {
     // We need to initialize the class.
 
     nsXBLJSClass* c;
     void* classObject;
     nsCStringKey key(className);
     classObject = (nsXBLService::gClassTable)->Get(&key);
 
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -5301,21 +5301,20 @@ GetDocument(JSObject *obj)
 
 // static
 JSBool
 nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JSHandleObject obj,
                                           JSHandleId id, unsigned flags,
                                           JSObject **objp)
 {
   if (flags & (JSRESOLVE_ASSIGNING | JSRESOLVE_DECLARING |
-               JSRESOLVE_CLASSNAME | JSRESOLVE_QUALIFIED) ||
+               JSRESOLVE_QUALIFIED) ||
       !JSID_IS_STRING(id)) {
     // Nothing to do here if we're either assigning or declaring,
-    // resolving a class name, doing a qualified resolve, or
-    // resolving a number.
+    // doing a qualified resolve, or resolving a number.
 
     return JS_TRUE;
   }
 
   nsHTMLDocument *document = GetDocument(obj);
 
   if (!document) {
     // If we don't have a document, return early.
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1392,17 +1392,16 @@ typedef JSBool
 
 /*
  * Like JSResolveOp, but flags provide contextual information as follows:
  *
  *  JSRESOLVE_QUALIFIED   a qualified property id: obj.id or obj[id], not id
  *  JSRESOLVE_ASSIGNING   obj[id] is on the left-hand side of an assignment
  *  JSRESOLVE_DETECTING   'if (o.p)...' or similar detection opcode sequence
  *  JSRESOLVE_DECLARING   var, const, or function prolog declaration opcode
- *  JSRESOLVE_CLASSNAME   class name used when constructing
  *
  * The *objp out parameter, on success, should be null to indicate that id
  * was not resolved; and non-null, referring to obj or one of its prototypes,
  * if id was resolved.
  *
  * This hook instead of JSResolveOp is called via the JSClass.resolve member
  * if JSCLASS_NEW_RESOLVE is set in JSClass.flags.
  *
@@ -3806,18 +3805,17 @@ JS_IdToValue(JSContext *cx, jsid id, jsv
 
 /*
  * JSNewResolveOp flag bits.
  */
 #define JSRESOLVE_QUALIFIED     0x01    /* resolve a qualified property id */
 #define JSRESOLVE_ASSIGNING     0x02    /* resolve on the left of assignment */
 #define JSRESOLVE_DETECTING     0x04    /* 'if (o.p)...' or '(o.p) ?...:...' */
 #define JSRESOLVE_DECLARING     0x08    /* var, const, or function prolog op */
-#define JSRESOLVE_CLASSNAME     0x10    /* class name used when constructing */
-#define JSRESOLVE_WITH          0x20    /* resolve inside a with statement */
+#define JSRESOLVE_WITH          0x10    /* resolve inside a with statement */
 
 /*
  * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on
  * the specified object, computing a primitive default value for the object.
  * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On
  * success the resulting value is stored in *vp.
  */
 extern JS_PUBLIC_API(JSBool)
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -4261,17 +4261,17 @@ js_FindClassObject(JSContext *cx, JSObje
     } else {
         JSAtom *atom = js_Atomize(cx, clasp->name, strlen(clasp->name));
         if (!atom)
             return false;
         id = AtomToId(atom);
     }
 
     JS_ASSERT(obj->isNative());
-    if (!LookupPropertyWithFlags(cx, obj, id, JSRESOLVE_CLASSNAME, &pobj, &prop))
+    if (!LookupPropertyWithFlags(cx, obj, id, 0, &pobj, &prop))
         return false;
     Value v = UndefinedValue();
     if (prop && pobj->isNative()) {
         shape = (Shape *) prop;
         if (shape->hasSlot()) {
             v = pobj->nativeGetSlot(shape->slot());
             if (v.isPrimitive())
                 v.setUndefined();