Rename Frame_* to DebugFrame_*. The next changeset will add DebugObject_*, and Object_* was way too confusing.
authorJason Orendorff <jorendorff@mozilla.com>
Tue, 03 May 2011 08:45:53 -0500
changeset 74401 d3b9adab89ecb9e83b3e2489f447703ffc7046a6
parent 74400 f88f637c1cf10d723c0a3b0258b7bedea5cf47f8
child 74402 1c8820681b80fd95a7979b5b14efcd78576369d5
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone6.0a1
Rename Frame_* to DebugFrame_*. The next changeset will add DebugObject_*, and Object_* was way too confusing.
js/src/jsdbg.cpp
--- a/js/src/jsdbg.cpp
+++ b/js/src/jsdbg.cpp
@@ -46,21 +46,21 @@
 #include "jsobj.h"
 #include "jswrapper.h"
 #include "jsobjinlines.h"
 
 using namespace js;
 
 // === Forward declarations
 
-extern Class Frame_class;
+extern Class DebugFrame_class;
 
 enum {
-    JSSLOT_FRAME_OWNER,
-    JSSLOT_FRAME_COUNT
+    JSSLOT_DEBUGFRAME_OWNER,
+    JSSLOT_DEBUGFRAME_COUNT
 };
 
 // === Utils
 
 static bool
 NotImplemented(JSContext *cx)
 {
     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NEED_DIET, "API");
@@ -143,21 +143,21 @@ Debug::init()
 }
 
 bool
 Debug::getScriptFrame(JSContext *cx, StackFrame *fp, Value *vp)
 {
     FrameMap::AddPtr p = frames.lookupForAdd(fp);
     if (!p) {
         JSObject *proto = &object->getReservedSlot(JSSLOT_DEBUG_FRAME_PROTO).toObject();
-        JSObject *frameobj = NewNonFunction<WithProto::Given>(cx, &Frame_class, proto, NULL);
+        JSObject *frameobj = NewNonFunction<WithProto::Given>(cx, &DebugFrame_class, proto, NULL);
         if (!frameobj || !frameobj->ensureClassReservedSlots(cx))
             return false;
         frameobj->setPrivate(fp);
-        frameobj->setReservedSlot(JSSLOT_FRAME_OWNER, ObjectValue(*object));
+        frameobj->setReservedSlot(JSSLOT_DEBUGFRAME_OWNER, ObjectValue(*object));
         if (!frames.add(p, fp, frameobj)) {
             js_ReportOutOfMemory(cx);
             return false;
         }
     }
     vp->setObject(*p->value);
     return true;
 }
@@ -551,40 +551,40 @@ JSPropertySpec Debug::properties[] = {
     JS_PSGS("enabled", Debug::getEnabled, Debug::setEnabled, 0),
     JS_PSGS("uncaughtExceptionHook", Debug::getUncaughtExceptionHook,
             Debug::setUncaughtExceptionHook, 0),
     JS_PS_END
 };
 
 // === Debug.Frame
 
-Class Frame_class = {
-    "Frame", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_FRAME_COUNT),
+Class DebugFrame_class = {
+    "Frame", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGFRAME_COUNT),
     PropertyStub, PropertyStub, PropertyStub, StrictPropertyStub,
     EnumerateStub, ResolveStub, ConvertStub, FinalizeStub,
 };
 
 JSObject *
 CheckThisFrame(JSContext *cx, Value *vp, const char *fnname, bool checkLive)
 {
     if (!vp[1].isObject()) {
         ReportObjectRequired(cx);
         return NULL;
     }
     JSObject *thisobj = &vp[1].toObject();
-    if (thisobj->getClass() != &Frame_class) {
+    if (thisobj->getClass() != &DebugFrame_class) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_INCOMPATIBLE_PROTO,
                              "Debug.Frame", fnname, thisobj->getClass()->name);
         return NULL;
     }
 
     // Check for e.g. Debug.prototype, which is of the Debug JSClass but isn't
     // really a Debug object.
     if (!thisobj->getPrivate()) {
-        if (thisobj->getReservedSlot(JSSLOT_FRAME_OWNER).isUndefined()) {
+        if (thisobj->getReservedSlot(JSSLOT_DEBUGFRAME_OWNER).isUndefined()) {
             JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_INCOMPATIBLE_PROTO,
                                  "Debug.Frame", fnname, "prototype object");
             return NULL;
         }
         if (checkLive) {
             JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_DEBUG_FRAME_NOT_LIVE,
                                  "Debug.Frame", fnname);
             return NULL;
@@ -595,60 +595,60 @@ CheckThisFrame(JSContext *cx, Value *vp,
 
 #define THIS_FRAME(cx, vp, fnname, thisobj, fp)                              \
     JSObject *thisobj = CheckThisFrame(cx, vp, fnname, true);                \
     if (!thisobj)                                                            \
         return false;                                                        \
     StackFrame *fp = (StackFrame *) thisobj->getPrivate()
 
 JSBool
-Frame_getType(JSContext *cx, uintN argc, Value *vp)
+DebugFrame_getType(JSContext *cx, uintN argc, Value *vp)
 {
     THIS_FRAME(cx, vp, "get type", thisobj, fp);
 
     // Indirect eval frames are both isGlobalFrame() and isEvalFrame(), so the
     // order of checks here is significant.
     vp->setString(fp->isEvalFrame()
                   ? cx->runtime->atomState.evalAtom
                   : fp->isGlobalFrame()
                   ? cx->runtime->atomState.globalAtom
                   : cx->runtime->atomState.callAtom);
     return true;
 }
 
 JSBool
-Frame_getGenerator(JSContext *cx, uintN argc, Value *vp)
+DebugFrame_getGenerator(JSContext *cx, uintN argc, Value *vp)
 {
     THIS_FRAME(cx, vp, "get generator", thisobj, fp);
     vp->setBoolean(fp->isGeneratorFrame());
     return true;
 }
 
 JSBool
-Frame_getLive(JSContext *cx, uintN argc, Value *vp)
+DebugFrame_getLive(JSContext *cx, uintN argc, Value *vp)
 {
     JSObject *thisobj = CheckThisFrame(cx, vp, "get live", false);
     if (!thisobj)
         return false;
     StackFrame *fp = (StackFrame *) thisobj->getPrivate();
     vp->setBoolean(!!fp);
     return true;
 }
 
 JSBool
-Frame_construct(JSContext *cx, uintN argc, Value *vp)
+DebugFrame_construct(JSContext *cx, uintN argc, Value *vp)
 {
     JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NO_CONSTRUCTOR, "Debug.Frame");
     return false;
 }
 
-JSPropertySpec Frame_properties[] = {
-    JS_PSG("type", Frame_getType, 0),
-    JS_PSG("generator", Frame_getGenerator, 0),
-    JS_PSG("live", Frame_getLive, 0),
+JSPropertySpec DebugFrame_properties[] = {
+    JS_PSG("type", DebugFrame_getType, 0),
+    JS_PSG("generator", DebugFrame_getGenerator, 0),
+    JS_PSG("live", DebugFrame_getLive, 0),
     JS_PS_END
 };
 
 // === Glue
 
 extern JS_PUBLIC_API(JSBool)
 JS_DefineDebugObject(JSContext *cx, JSObject *obj)
 {
@@ -658,16 +658,17 @@ JS_DefineDebugObject(JSContext *cx, JSOb
 
     JSObject *debugCtor;
     JSObject *debugProto = js_InitClass(cx, obj, objProto, &Debug::jsclass, Debug::construct, 1,
                                         Debug::properties, NULL, NULL, NULL, &debugCtor);
     if (!debugProto || !debugProto->ensureClassReservedSlots(cx))
         return false;
 
     JSObject *frameCtor;
-    JSObject *frameProto = js_InitClass(cx, debugCtor, objProto, &Frame_class, Frame_construct, 0,
-                                        Frame_properties, NULL, NULL, NULL, &frameCtor);
+    JSObject *frameProto = js_InitClass(cx, debugCtor, objProto, &DebugFrame_class,
+                                        DebugFrame_construct, 0,
+                                        DebugFrame_properties, NULL, NULL, NULL, &frameCtor);
     if (!frameProto)
         return false;
     debugProto->setReservedSlot(JSSLOT_DEBUG_FRAME_PROTO, ObjectValue(*frameProto));
 
     return true;
 }