Re: What's the point of jsdebug.c?

John Bandhauer <[email protected]> Wed, 09 Dec 2009 10:21:28 -0800
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
jsdebug.[h,c] exists for the same reason that jsapi.[h,c] exists... To 
create a clear and well defined delineation between the relatively 
static public API and the private parts of the module and to supply a 
layer where calls from the outside can be sanity checked before 
proceeding into the internal code. The idea is (or, was 13 years ago) 
that external callers need only include jsdebug.h and interact with code 
there and need not use any lower level code in jsd directly. "External 
callers" also includes the implementation of layers like the old Java 
and currently used C++ xpcom interface to jsd. Though you might think of 
the xpcom interface to jsd as *being* jsd, in fact it is just a layer 
around the core functionality supplied by jsdebug (and the engine's 
jsdbgapi).

John.

John J Barton wrote:
> Does anyone understand why jsdebug.c exists? It has functions like
> ---
>  JSD_PUBLIC_API(JSBool)
>  JSD_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* 
> callerdata)
>  {
>      JSD_ASSERT_VALID_CONTEXT(jsdc);
>      return jsd_SetScriptHook(jsdc, hook, callerdata);
>  }
> ----
> Why?
> 
> jjb