bug 624880 - renaming JSD public API to reflect the signature change. r=timeless
authorIgor Bukanov <igor@mir2.org>
Sat, 29 Jan 2011 22:40:29 +0100
changeset 61691 8835fffb27afe4de1580c98596abe3f10ea2d83c
parent 61690 378cfa4ae4f53ad02167900355664110b9769213
child 61692 6d5c859c452db930a3e1d620c8b2592a124ff79c
push idunknown
push userunknown
push dateunknown
reviewerstimeless
bugs624880
milestone2.0b11pre
bug 624880 - renaming JSD public API to reflect the signature change. r=timeless
js/jsd/jsd.h
js/jsd/jsd1640.def
js/jsd/jsd_java.c
js/jsd/jsd_obj.c
js/jsd/jsd_scpt.c
js/jsd/jsd_stak.c
js/jsd/jsd_step.c
js/jsd/jsd_val.c
js/jsd/jsd_xpc.cpp
js/jsd/jsdebug.c
js/jsd/jsdebug.h
--- a/js/jsd/jsd.h
+++ b/js/jsd/jsd.h
@@ -456,17 +456,17 @@ jsd_GetScriptPrivate (JSDScript *jsdscri
 
 extern JSBool
 jsd_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript);
 
 extern const char*
 jsd_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript);
 
 extern JSString*
-jsd_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript);
+jsd_GetScriptFunctionId(JSDContext* jsdc, JSDScript *jsdscript);
 
 extern uintN
 jsd_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript);
 
 extern uintN
 jsd_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript);
 
 extern JSBool
@@ -720,19 +720,19 @@ jsd_IsStackFrameConstructing(JSDContext*
                              JSDStackFrameInfo* jsdframe);
 
 extern JSDValue*
 jsd_GetThisForStackFrame(JSDContext* jsdc,
                          JSDThreadState* jsdthreadstate,
                          JSDStackFrameInfo* jsdframe);
 
 extern JSString*
-jsd_GetNameForStackFrame(JSDContext* jsdc, 
-                         JSDThreadState* jsdthreadstate,
-                         JSDStackFrameInfo* jsdframe);
+jsd_GetIdForStackFrame(JSDContext* jsdc, 
+                       JSDThreadState* jsdthreadstate,
+                       JSDStackFrameInfo* jsdframe);
 
 extern JSDThreadState*
 jsd_NewThreadState(JSDContext* jsdc, JSContext *cx);
 
 extern void
 jsd_DestroyThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate);
 
 extern JSBool
@@ -965,17 +965,17 @@ jsd_GetValueInt(JSDContext* jsdc, JSDVal
 
 extern jsdouble
 jsd_GetValueDouble(JSDContext* jsdc, JSDValue* jsdval);
 
 extern JSString*
 jsd_GetValueString(JSDContext* jsdc, JSDValue* jsdval);
 
 extern JSString*
-jsd_GetValueFunctionName(JSDContext* jsdc, JSDValue* jsdval);
+jsd_GetValueFunctionId(JSDContext* jsdc, JSDValue* jsdval);
 
 extern JSFunction*
 jsd_GetValueFunction(JSDContext* jsdc, JSDValue* jsdval);
 
 /**************************************************/
 
 extern uintN
 jsd_GetCountOfProperties(JSDContext* jsdc, JSDValue* jsdval);
--- a/js/jsd/jsd1640.def
+++ b/js/jsd/jsd1640.def
@@ -67,17 +67,17 @@ EXPORTS
 	_JSD_GetCountOfStackFrames
 	_JSD_GetDefaultJSContext
 	_JSD_GetMajorVersion
 	_JSD_GetMinorVersion
 	_JSD_GetPCForStackFrame
 	_JSD_GetScriptBaseLineNumber
 	_JSD_GetScriptFilename
 	_JSD_GetScriptForStackFrame
-	_JSD_GetScriptFunctionName
+	_JSD_GetScriptFunctionId
 	_JSD_GetScriptHook
 	_JSD_GetScriptLineExtent
 	_JSD_GetSourceAlterCount
 	_JSD_GetSourceStatus
 	_JSD_GetSourceText
 	_JSD_GetSourceURL
 	_JSD_GetStackFrame
 	_JSD_IncrementSourceAlterCount
--- a/js/jsd/jsd_java.c
+++ b/js/jsd/jsd_java.c
@@ -149,17 +149,17 @@ void
     ExecEnv* ee = EE();
 
     if( ! context || ! controller || ! ee )
         return;
 
     if( creating )
     {
         char* url      = (char*)JSD_GetScriptFilename       (jsdc, jsdscript);
-        char* function = (char*)JSD_GetScriptFunctionName   (jsdc, jsdscript);
+        JSString* function =    JSD_GetScriptFunctionId     (jsdc, jsdscript);
         int base       =        JSD_GetScriptBaseLineNumber (jsdc, jsdscript);
         int extent     =        JSD_GetScriptLineExtent     (jsdc, jsdscript);
 
         if( ! url )
         {
             return;
             /* url = ""; */
         }
--- a/js/jsd/jsd_obj.c
+++ b/js/jsd/jsd_obj.c
@@ -153,17 +153,17 @@ jsd_Constructing(JSDContext* jsdc, JSCon
             if( ctorURL )
                 jsdobj->ctorURL = jsd_AddAtom(jsdc, ctorURL);
 
             JSD_LOCK_SCRIPTS(jsdc);
             jsdscript = jsd_FindOrCreateJSDScript(jsdc, cx, script, fp);
             JSD_UNLOCK_SCRIPTS(jsdc);
             if( jsdscript )
             {
-                ctorName = jsd_GetScriptFunctionName(jsdc, jsdscript);
+                ctorName = jsd_GetScriptFunctionId(jsdc, jsdscript);
                 if( ctorName )
                     jsdobj->ctorName = jsd_AddAtom(jsdc, ctorName);
             }
             jsdobj->ctorLineno = JS_GetScriptBaseLineNumber(cx, script);
         }
     }
     TRACEOBJ(jsdc, jsdobj, 3);
     JSD_UNLOCK_OBJECTS(jsdc);
--- a/js/jsd/jsd_scpt.c
+++ b/js/jsd/jsd_scpt.c
@@ -200,17 +200,17 @@ static void
     const char* name;
     JSString* fun;
     uintN base;
     uintN extent;
     char Buf[256];
     size_t n;
 
     name   = jsd_GetScriptFilename(jsdc, jsdscript);
-    fun    = jsd_GetScriptFunctionName(jsdc, jsdscript);
+    fun    = jsd_GetScriptFunctionId(jsdc, jsdscript);
     base   = jsd_GetScriptBaseLineNumber(jsdc, jsdscript);
     extent = jsd_GetScriptLineExtent(jsdc, jsdscript);
     n = size_t(snprintf(Buf, sizeof(Buf), "%sscript=%08X, %s, ",
                         leadingtext, (unsigned) jsdscript->script,
                         name ? name : "no URL"));
     if (n + 1 < sizeof(Buf)) {
         if (fun) {
             n += size_t(snprintf(Buf + n, sizeof(Buf) - n, "%s", "no fun"));
@@ -493,17 +493,17 @@ jsd_IsActiveScript(JSDContext* jsdc, JSD
 
 const char*
 jsd_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript)
 {
     return jsdscript->url;
 }
 
 JSString*
-jsd_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript)
+jsd_GetScriptFunctionId(JSDContext* jsdc, JSDScript *jsdscript)
 {
     JSString* str;
 
     if( ! jsdscript->function )
         return NULL;
     str = JS_GetFunctionId(jsdscript->function);
 
     /* For compatibility we return "anonymous", not an empty string here. */
--- a/js/jsd/jsd_stak.c
+++ b/js/jsd/jsd_stak.c
@@ -353,19 +353,19 @@ jsd_GetThisForStackFrame(JSDContext* jsd
             jsdval = JSD_NewValue(jsdc, thisval);
     }
 
     JSD_UNLOCK_THREADSTATES(jsdc);
     return jsdval;
 }
 
 JSString*
-jsd_GetNameForStackFrame(JSDContext* jsdc, 
-                         JSDThreadState* jsdthreadstate,
-                         JSDStackFrameInfo* jsdframe)
+jsd_GetIdForStackFrame(JSDContext* jsdc, 
+                       JSDThreadState* jsdthreadstate,
+                       JSDStackFrameInfo* jsdframe)
 {
     JSString *rv = NULL;
     
     JSD_LOCK_THREADSTATES(jsdc);
     
     if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
     {
         JSFunction *fun = JS_GetFrameFunction (jsdthreadstate->context,
--- a/js/jsd/jsd_step.c
+++ b/js/jsd/jsd_step.c
@@ -73,17 +73,17 @@ static void
 
     script = JS_GetFrameScript(cx, fp);
     if(script)
     {
         JSD_LOCK_SCRIPTS(jsdc);
         jsdscript = jsd_FindOrCreateJSDScript(jsdc, cx, script, fp);
         JSD_UNLOCK_SCRIPTS(jsdc);
         if(jsdscript)
-            funName = JSD_GetScriptFunctionName(jsdc, jsdscript);
+            funName = JSD_GetScriptFunctionId(jsdc, jsdscript);
     }
 
     if(before)
         printf("%sentering ", _indentSpaces(indent++));
     else
         printf("%sleaving ", _indentSpaces(--indent));
 
     if (!funName)
--- a/js/jsd/jsd_val.c
+++ b/js/jsd/jsd_val.c
@@ -240,17 +240,17 @@ jsd_GetValueString(JSDContext* jsdc, JSD
             JS_LeaveCrossCompartmentCall(call);
             JS_EndRequest(cx);
         }
     }
     return jsdval->string;
 }
 
 JSString*
-jsd_GetValueFunctionName(JSDContext* jsdc, JSDValue* jsdval)
+jsd_GetValueFunctionId(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSContext* cx = jsdc->dumbContext;
     JSFunction* fun;
     JSExceptionState* exceptionState;
     JSCrossCompartmentCall *call = NULL;
 
     if(!jsdval->funName && jsd_IsValueFunction(jsdc, jsdval))
     {
--- a/js/jsd/jsd_xpc.cpp
+++ b/js/jsd/jsd_xpc.cpp
@@ -986,17 +986,17 @@ jsdScript::jsdScript (JSDContext *aCx, J
 
     if (mScript) {
         /* copy the script's information now, so we have it later, when it
          * gets destroyed. */
         JSD_LockScriptSubsystem(mCx);
         mFileName = new nsCString(JSD_GetScriptFilename(mCx, mScript));
         mFunctionName = new nsCString();
         if (mFunctionName) {
-            JSString *str = JSD_GetScriptFunctionName(mCx, mScript);
+            JSString *str = JSD_GetScriptFunctionId(mCx, mScript);
             if (str)
                 AssignToJSString(mFunctionName, str);
         }
         mBaseLineNumber = JSD_GetScriptBaseLineNumber(mCx, mScript);
         mLineExtent = JSD_GetScriptLineExtent(mCx, mScript);
         mFirstPC = JSD_GetClosestPC(mCx, mScript, 0);
         JSD_UnlockScriptSubsystem(mCx);
         
@@ -1902,17 +1902,17 @@ jsdStackFrame::GetExecutionContext(jsdIC
     *_rval = jsdContext::FromPtr (mCx, cx);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 jsdStackFrame::GetFunctionName(nsACString &_rval)
 {
     ASSERT_VALID_EPHEMERAL;
-    JSString *str = JSD_GetNameForStackFrame(mCx, mThreadState, mStackFrameInfo);
+    JSString *str = JSD_GetIdForStackFrame(mCx, mThreadState, mStackFrameInfo);
     if (str)
         return AssignToJSString(&_rval, str);
     
     _rval.Assign("anonymous");
     return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -2234,17 +2234,17 @@ jsdValue::GetJsConstructor (jsdIValue **
     *_rval = jsdValue::FromPtr (mCx, jsdv);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 jsdValue::GetJsFunctionName(nsACString &_rval)
 {
     ASSERT_VALID_EPHEMERAL;
-    return AssignToJSString(&_rval, JSD_GetValueFunctionName(mCx, mValue));
+    return AssignToJSString(&_rval, JSD_GetValueFunctionId(mCx, mValue));
 }
 
 NS_IMETHODIMP
 jsdValue::GetBooleanValue(PRBool *_rval)
 {
     ASSERT_VALID_EPHEMERAL;
     *_rval = JSD_GetValueBoolean (mCx, mValue);
     return NS_OK;
--- a/js/jsd/jsdebug.c
+++ b/js/jsd/jsdebug.c
@@ -298,21 +298,21 @@ JSD_PUBLIC_API(const char*)
 JSD_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_GetScriptFilename(jsdc, jsdscript);
 }
 
 JSD_PUBLIC_API(JSString *)
-JSD_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript)
+JSD_GetScriptFunctionId(JSDContext* jsdc, JSDScript *jsdscript)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
-    return jsd_GetScriptFunctionName(jsdc, jsdscript);
+    return jsd_GetScriptFunctionId(jsdc, jsdscript);
 }
 
 JSD_PUBLIC_API(uintN)
 JSD_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_SCRIPT(jsdscript);
     return jsd_GetScriptBaseLineNumber(jsdc, jsdscript);
@@ -745,22 +745,22 @@ JSD_GetThisForStackFrame(JSDContext* jsd
                          JSDThreadState* jsdthreadstate,
                          JSDStackFrameInfo* jsdframe)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     return jsd_GetThisForStackFrame(jsdc, jsdthreadstate, jsdframe);
 }
 
 JSD_PUBLIC_API(JSString *)
-JSD_GetNameForStackFrame(JSDContext* jsdc,
-                         JSDThreadState* jsdthreadstate,
-                         JSDStackFrameInfo* jsdframe)
+JSD_GetIdForStackFrame(JSDContext* jsdc,
+                       JSDThreadState* jsdthreadstate,
+                       JSDStackFrameInfo* jsdframe)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
-    return jsd_GetNameForStackFrame(jsdc, jsdthreadstate, jsdframe);
+    return jsd_GetIdForStackFrame(jsdc, jsdthreadstate, jsdframe);
 }
 
 JSD_PUBLIC_API(JSBool)
 JSD_IsStackFrameDebugger(JSDContext* jsdc,
                          JSDThreadState* jsdthreadstate,
                          JSDStackFrameInfo* jsdframe)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
@@ -1112,21 +1112,21 @@ JSD_PUBLIC_API(JSString*)
 JSD_GetValueString(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
     return jsd_GetValueString(jsdc, jsdval);
 }
 
 JSD_PUBLIC_API(JSString *)
-JSD_GetValueFunctionName(JSDContext* jsdc, JSDValue* jsdval)
+JSD_GetValueFunctionId(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
-    return jsd_GetValueFunctionName(jsdc, jsdval);
+    return jsd_GetValueFunctionId(jsdc, jsdval);
 }
 
 JSD_PUBLIC_API(JSFunction*)
 JSD_GetValueFunction(JSDContext* jsdc, JSDValue* jsdval)
 {
     JSD_ASSERT_VALID_CONTEXT(jsdc);
     JSD_ASSERT_VALID_VALUE(jsdval);
     return jsd_GetValueFunction(jsdc, jsdval);
--- a/js/jsd/jsdebug.h
+++ b/js/jsd/jsdebug.h
@@ -425,20 +425,21 @@ JSD_IsActiveScript(JSDContext* jsdc, JSD
 /*
 * Get the filename associated with this script
 */
 extern JSD_PUBLIC_API(const char*)
 JSD_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript);
 
 /*
 * Get the function name associated with this script (NULL if not a function).
-* If the function does not have a name the result is an empty string.
+* If the function does not have a name the result is the string "anonymous".
+* *** new for gecko 2.0 ****
 */
 extern JSD_PUBLIC_API(JSString *)
-JSD_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript);
+JSD_GetScriptFunctionId(JSDContext* jsdc, JSDScript *jsdscript);
 
 /*
 * Get the base linenumber of the sourcefile from which this script was loaded.
 * This is one-based -- i.e. the first line of a file is line '1'. This may
 * return 0 if this infomation is unknown.
 */
 extern JSD_PUBLIC_API(uintN)
 JSD_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript);
@@ -956,21 +957,22 @@ JSD_GetScopeChainForStackFrame(JSDContex
 extern JSD_PUBLIC_API(JSDValue*)
 JSD_GetThisForStackFrame(JSDContext* jsdc,
                          JSDThreadState* jsdthreadstate,
                          JSDStackFrameInfo* jsdframe);
 
 /*
 * Get the name of the function executing in this stack frame.  Especially useful
 * for native frames (without script objects.)
+* *** new for gecko 2.0 ****
 */
 extern JSD_PUBLIC_API(JSString *)
-JSD_GetNameForStackFrame(JSDContext* jsdc,
-                         JSDThreadState* jsdthreadstate,
-                         JSDStackFrameInfo* jsdframe);
+JSD_GetIdForStackFrame(JSDContext* jsdc,
+                       JSDThreadState* jsdthreadstate,
+                       JSDStackFrameInfo* jsdframe);
 
 /*
 * True if stack frame represents a frame created as a result of a debugger
 * evaluation.
 */
 extern JSD_PUBLIC_API(JSBool)
 JSD_IsStackFrameDebugger(JSDContext* jsdc,
                          JSDThreadState* jsdthreadstate,
@@ -1288,20 +1290,20 @@ JSD_GetValueDouble(JSDContext* jsdc, JSD
 * JSD_NewValue(jsdc,STRING_TO_JSVAL(str)) if necessary.
 * *** new for version 1.1 ****
 */
 extern JSD_PUBLIC_API(JSString*)
 JSD_GetValueString(JSDContext* jsdc, JSDValue* jsdval);
 
 /*
 * Return name of function IFF JSDValue represents a function.
-* *** new for version 1.1 ****
+* *** new for gecko 2.0 ****
 */
 extern JSD_PUBLIC_API(JSString *)
-JSD_GetValueFunctionName(JSDContext* jsdc, JSDValue* jsdval);
+JSD_GetValueFunctionId(JSDContext* jsdc, JSDValue* jsdval);
 
 /*
 * Return function object IFF JSDValue represents a function or an object
 * wrapping a function.
 * *** new for version 1.1 ****
 */
 extern JSD_PUBLIC_API(JSFunction*)
 JSD_GetValueFunction(JSDContext* jsdc, JSDValue* jsdval);