1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
39 * JavaScript Debugging support - All public functions
44 /***************************************************************************/
45 /* High Level calls */
47 JSD_PUBLIC_API(JSDContext
*)
48 JSD_DebuggerOnForUser(JSRuntime
* jsrt
,
49 JSD_UserCallbacks
* callbacks
,
52 return jsd_DebuggerOnForUser(jsrt
, callbacks
, user
);
55 JSD_PUBLIC_API(JSDContext
*)
58 return jsd_DebuggerOn();
62 JSD_DebuggerOff(JSDContext
* jsdc
)
64 JSD_ASSERT_VALID_CONTEXT(jsdc
);
65 jsd_DebuggerOff(jsdc
);
70 JSD_GetMajorVersion(void)
72 return JSD_MAJOR_VERSION
;
76 JSD_GetMinorVersion(void)
78 return JSD_MINOR_VERSION
;
81 JSD_PUBLIC_API(JSContext
*)
82 JSD_GetDefaultJSContext(JSDContext
* jsdc
)
84 JSD_ASSERT_VALID_CONTEXT(jsdc
);
85 return jsdc
->dumbContext
;
89 JSD_SetUserCallbacks(JSRuntime
* jsrt
, JSD_UserCallbacks
* callbacks
, void* user
)
91 jsd_SetUserCallbacks(jsrt
, callbacks
, user
);
95 JSD_JSContextInUse(JSDContext
* jsdc
, JSContext
* context
)
97 JSD_ASSERT_VALID_CONTEXT(jsdc
);
98 /* we no longer need this information - may need it again in the future */
101 JSD_PUBLIC_API(void *)
102 JSD_SetContextPrivate(JSDContext
*jsdc
, void *data
)
104 JSD_ASSERT_VALID_CONTEXT(jsdc
);
105 return jsd_SetContextPrivate (jsdc
, data
);
108 JSD_PUBLIC_API(void *)
109 JSD_GetContextPrivate(JSDContext
*jsdc
)
111 JSD_ASSERT_VALID_CONTEXT(jsdc
);
112 return jsd_GetContextPrivate (jsdc
);
116 JSD_ClearAllProfileData(JSDContext
*jsdc
)
118 JSD_ASSERT_VALID_CONTEXT(jsdc
);
119 jsd_ClearAllProfileData(jsdc
);
123 JSD_SetContextFlags(JSDContext
*jsdc
, uint32 flags
)
125 JSD_ASSERT_VALID_CONTEXT(jsdc
);
129 JSD_PUBLIC_API(uint32
)
130 JSD_GetContextFlags(JSDContext
*jsdc
)
132 JSD_ASSERT_VALID_CONTEXT(jsdc
);
136 JSD_PUBLIC_API(JSDContext
*)
137 JSD_JSDContextForJSContext(JSContext
* context
)
139 return jsd_JSDContextForJSContext(context
);
142 /***************************************************************************/
143 /* Script functions */
146 JSD_LockScriptSubsystem(JSDContext
* jsdc
)
148 JSD_ASSERT_VALID_CONTEXT(jsdc
);
149 JSD_LOCK_SCRIPTS(jsdc
);
153 JSD_UnlockScriptSubsystem(JSDContext
* jsdc
)
155 JSD_ASSERT_VALID_CONTEXT(jsdc
);
156 JSD_UNLOCK_SCRIPTS(jsdc
);
159 JSD_PUBLIC_API(JSDScript
*)
160 JSD_IterateScripts(JSDContext
* jsdc
, JSDScript
**iterp
)
162 JSD_ASSERT_VALID_CONTEXT(jsdc
);
163 return jsd_IterateScripts(jsdc
, iterp
);
166 JSD_PUBLIC_API(uint32
)
167 JSD_GetScriptFlags(JSDContext
*jsdc
, JSDScript
*script
)
169 JSD_ASSERT_VALID_CONTEXT(jsdc
);
170 return jsd_GetScriptFlags(jsdc
, script
);
174 JSD_SetScriptFlags(JSDContext
*jsdc
, JSDScript
*script
, uint32 flags
)
176 JSD_ASSERT_VALID_CONTEXT(jsdc
);
177 jsd_SetScriptFlags(jsdc
, script
, flags
);
180 JSD_PUBLIC_API(uintN
)
181 JSD_GetScriptCallCount(JSDContext
* jsdc
, JSDScript
*script
)
183 JSD_ASSERT_VALID_CONTEXT(jsdc
);
184 return jsd_GetScriptCallCount(jsdc
, script
);
187 JSD_PUBLIC_API(uintN
)
188 JSD_GetScriptMaxRecurseDepth(JSDContext
* jsdc
, JSDScript
*script
)
190 JSD_ASSERT_VALID_CONTEXT(jsdc
);
191 return jsd_GetScriptMaxRecurseDepth(jsdc
, script
);
195 JSD_PUBLIC_API(jsdouble
)
196 JSD_GetScriptMinExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
198 JSD_ASSERT_VALID_CONTEXT(jsdc
);
199 return jsd_GetScriptMinExecutionTime(jsdc
, script
);
202 JSD_PUBLIC_API(jsdouble
)
203 JSD_GetScriptMaxExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
205 JSD_ASSERT_VALID_CONTEXT(jsdc
);
206 return jsd_GetScriptMaxExecutionTime(jsdc
, script
);
209 JSD_PUBLIC_API(jsdouble
)
210 JSD_GetScriptTotalExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
212 JSD_ASSERT_VALID_CONTEXT(jsdc
);
213 return jsd_GetScriptTotalExecutionTime(jsdc
, script
);
216 JSD_PUBLIC_API(jsdouble
)
217 JSD_GetScriptMinOwnExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
219 JSD_ASSERT_VALID_CONTEXT(jsdc
);
220 return jsd_GetScriptMinOwnExecutionTime(jsdc
, script
);
223 JSD_PUBLIC_API(jsdouble
)
224 JSD_GetScriptMaxOwnExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
226 JSD_ASSERT_VALID_CONTEXT(jsdc
);
227 return jsd_GetScriptMaxOwnExecutionTime(jsdc
, script
);
230 JSD_PUBLIC_API(jsdouble
)
231 JSD_GetScriptTotalOwnExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
233 JSD_ASSERT_VALID_CONTEXT(jsdc
);
234 return jsd_GetScriptTotalOwnExecutionTime(jsdc
, script
);
238 JSD_ClearScriptProfileData(JSDContext
* jsdc
, JSDScript
*script
)
240 JSD_ASSERT_VALID_CONTEXT(jsdc
);
241 jsd_ClearScriptProfileData(jsdc
, script
);
244 JSD_PUBLIC_API(JSScript
*)
245 JSD_GetJSScript(JSDContext
* jsdc
, JSDScript
*script
)
247 return jsd_GetJSScript(jsdc
, script
);
250 JSD_PUBLIC_API(JSFunction
*)
251 JSD_GetJSFunction(JSDContext
* jsdc
, JSDScript
*script
)
253 return jsd_GetJSFunction (jsdc
, script
);
256 JSD_PUBLIC_API(void *)
257 JSD_SetScriptPrivate(JSDScript
*jsdscript
, void *data
)
259 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
260 return jsd_SetScriptPrivate (jsdscript
, data
);
263 JSD_PUBLIC_API(void *)
264 JSD_GetScriptPrivate(JSDScript
*jsdscript
)
266 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
267 return jsd_GetScriptPrivate (jsdscript
);
271 JSD_PUBLIC_API(JSBool
)
272 JSD_IsActiveScript(JSDContext
* jsdc
, JSDScript
*jsdscript
)
274 JSD_ASSERT_VALID_CONTEXT(jsdc
);
275 return jsd_IsActiveScript(jsdc
, jsdscript
);
278 JSD_PUBLIC_API(const char*)
279 JSD_GetScriptFilename(JSDContext
* jsdc
, JSDScript
*jsdscript
)
281 JSD_ASSERT_VALID_CONTEXT(jsdc
);
282 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
283 return jsd_GetScriptFilename(jsdc
, jsdscript
);
286 JSD_PUBLIC_API(const char*)
287 JSD_GetScriptFunctionName(JSDContext
* jsdc
, JSDScript
*jsdscript
)
289 JSD_ASSERT_VALID_CONTEXT(jsdc
);
290 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
291 return jsd_GetScriptFunctionName(jsdc
, jsdscript
);
294 JSD_PUBLIC_API(uintN
)
295 JSD_GetScriptBaseLineNumber(JSDContext
* jsdc
, JSDScript
*jsdscript
)
297 JSD_ASSERT_VALID_CONTEXT(jsdc
);
298 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
299 return jsd_GetScriptBaseLineNumber(jsdc
, jsdscript
);
302 JSD_PUBLIC_API(uintN
)
303 JSD_GetScriptLineExtent(JSDContext
* jsdc
, JSDScript
*jsdscript
)
305 JSD_ASSERT_VALID_CONTEXT(jsdc
);
306 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
307 return jsd_GetScriptLineExtent(jsdc
, jsdscript
);
310 JSD_PUBLIC_API(JSBool
)
311 JSD_SetScriptHook(JSDContext
* jsdc
, JSD_ScriptHookProc hook
, void* callerdata
)
313 JSD_ASSERT_VALID_CONTEXT(jsdc
);
314 return jsd_SetScriptHook(jsdc
, hook
, callerdata
);
317 JSD_PUBLIC_API(JSBool
)
318 JSD_GetScriptHook(JSDContext
* jsdc
, JSD_ScriptHookProc
* hook
, void** callerdata
)
320 JSD_ASSERT_VALID_CONTEXT(jsdc
);
321 return jsd_GetScriptHook(jsdc
, hook
, callerdata
);
324 JSD_PUBLIC_API(jsuword
)
325 JSD_GetClosestPC(JSDContext
* jsdc
, JSDScript
* jsdscript
, uintN line
)
327 JSD_ASSERT_VALID_CONTEXT(jsdc
);
328 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
329 return jsd_GetClosestPC(jsdc
, jsdscript
, line
);
332 JSD_PUBLIC_API(uintN
)
333 JSD_GetClosestLine(JSDContext
* jsdc
, JSDScript
* jsdscript
, jsuword pc
)
335 JSD_ASSERT_VALID_CONTEXT(jsdc
);
336 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
337 return jsd_GetClosestLine(jsdc
, jsdscript
, pc
);
341 JSD_ScriptCreated(JSDContext
* jsdc
,
343 const char *filename
, /* URL this script loads from */
344 uintN lineno
, /* line where this script starts */
348 JSD_ASSERT_VALID_CONTEXT(jsdc
);
349 jsd_ScriptCreated(jsdc
, cx
, filename
, lineno
, script
, fun
);
353 JSD_ScriptDestroyed(JSDContext
* jsdc
,
357 JSD_ASSERT_VALID_CONTEXT(jsdc
);
358 jsd_ScriptDestroyed(jsdc
, cx
, script
);
361 /***************************************************************************/
362 /* Source Text functions */
365 JSD_LockSourceTextSubsystem(JSDContext
* jsdc
)
367 JSD_ASSERT_VALID_CONTEXT(jsdc
);
368 JSD_LOCK_SOURCE_TEXT(jsdc
);
372 JSD_UnlockSourceTextSubsystem(JSDContext
* jsdc
)
374 JSD_ASSERT_VALID_CONTEXT(jsdc
);
375 JSD_UNLOCK_SOURCE_TEXT(jsdc
);
378 JSD_PUBLIC_API(JSDSourceText
*)
379 JSD_IterateSources(JSDContext
* jsdc
, JSDSourceText
**iterp
)
381 JSD_ASSERT_VALID_CONTEXT(jsdc
);
382 return jsd_IterateSources(jsdc
, iterp
);
385 JSD_PUBLIC_API(JSDSourceText
*)
386 JSD_FindSourceForURL(JSDContext
* jsdc
, const char* url
)
388 JSD_ASSERT_VALID_CONTEXT(jsdc
);
390 return jsd_FindSourceForURL(jsdc
, url
);
393 JSD_PUBLIC_API(const char*)
394 JSD_GetSourceURL(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
396 JSD_ASSERT_VALID_CONTEXT(jsdc
);
397 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
398 return jsd_GetSourceURL(jsdc
,jsdsrc
);
401 JSD_PUBLIC_API(JSBool
)
402 JSD_GetSourceText(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
,
403 const char** ppBuf
, intN
* pLen
)
405 JSD_ASSERT_VALID_CONTEXT(jsdc
);
406 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
409 return jsd_GetSourceText(jsdc
, jsdsrc
, ppBuf
, pLen
);
413 JSD_ClearSourceText(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
415 JSD_ASSERT_VALID_CONTEXT(jsdc
);
416 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
417 jsd_ClearSourceText(jsdc
, jsdsrc
);
421 JSD_PUBLIC_API(JSDSourceStatus
)
422 JSD_GetSourceStatus(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
424 JSD_ASSERT_VALID_CONTEXT(jsdc
);
425 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
426 return jsd_GetSourceStatus(jsdc
, jsdsrc
);
429 JSD_PUBLIC_API(JSBool
)
430 JSD_IsSourceDirty(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
432 JSD_ASSERT_VALID_CONTEXT(jsdc
);
433 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
434 return jsd_IsSourceDirty(jsdc
, jsdsrc
);
438 JSD_SetSourceDirty(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
, JSBool dirty
)
440 JSD_ASSERT_VALID_CONTEXT(jsdc
);
441 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
442 jsd_SetSourceDirty(jsdc
, jsdsrc
, dirty
);
445 JSD_PUBLIC_API(uintN
)
446 JSD_GetSourceAlterCount(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
448 JSD_ASSERT_VALID_CONTEXT(jsdc
);
449 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
450 return jsd_GetSourceAlterCount(jsdc
, jsdsrc
);
453 JSD_PUBLIC_API(uintN
)
454 JSD_IncrementSourceAlterCount(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
456 JSD_ASSERT_VALID_CONTEXT(jsdc
);
457 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
458 return jsd_IncrementSourceAlterCount(jsdc
, jsdsrc
);
462 JSD_DestroyAllSources( JSDContext
* jsdc
)
464 JSD_ASSERT_VALID_CONTEXT(jsdc
);
465 jsd_DestroyAllSources(jsdc
);
468 JSD_PUBLIC_API(JSDSourceText
*)
469 JSD_NewSourceText(JSDContext
* jsdc
, const char* url
)
471 JSD_ASSERT_VALID_CONTEXT(jsdc
);
473 return jsd_NewSourceText(jsdc
, url
);
476 JSD_PUBLIC_API(JSDSourceText
*)
477 JSD_AppendSourceText(JSDContext
* jsdc
,
478 JSDSourceText
* jsdsrc
,
479 const char* text
, /* *not* zero terminated */
481 JSDSourceStatus status
)
483 JSD_ASSERT_VALID_CONTEXT(jsdc
);
484 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
485 return jsd_AppendSourceText(jsdc
, jsdsrc
, text
, length
, status
);
488 extern JSD_PUBLIC_API(JSDSourceText
*)
489 JSD_AppendUCSourceText(JSDContext
* jsdc
,
490 JSDSourceText
* jsdsrc
,
491 const jschar
* text
, /* *not* zero terminated */
493 JSDSourceStatus status
)
495 JSD_ASSERT_VALID_CONTEXT(jsdc
);
496 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
497 return jsd_AppendUCSourceText(jsdc
, jsdsrc
, text
, length
, status
);
500 JSD_PUBLIC_API(JSBool
)
501 JSD_AddFullSourceText(JSDContext
* jsdc
,
502 const char* text
, /* *not* zero terminated */
506 JSD_ASSERT_VALID_CONTEXT(jsdc
);
508 return jsd_AddFullSourceText(jsdc
, text
, length
, url
);
511 /***************************************************************************/
512 /* Execution/Interrupt Hook functions */
514 JSD_PUBLIC_API(JSBool
)
515 JSD_SetExecutionHook(JSDContext
* jsdc
,
516 JSDScript
* jsdscript
,
518 JSD_ExecutionHookProc hook
,
521 JSD_ASSERT_VALID_CONTEXT(jsdc
);
522 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
523 return jsd_SetExecutionHook(jsdc
, jsdscript
, pc
, hook
, callerdata
);
526 JSD_PUBLIC_API(JSBool
)
527 JSD_ClearExecutionHook(JSDContext
* jsdc
,
528 JSDScript
* jsdscript
,
531 JSD_ASSERT_VALID_CONTEXT(jsdc
);
532 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
533 return jsd_ClearExecutionHook(jsdc
, jsdscript
, pc
);
536 JSD_PUBLIC_API(JSBool
)
537 JSD_ClearAllExecutionHooksForScript(JSDContext
* jsdc
, JSDScript
* jsdscript
)
539 JSD_ASSERT_VALID_CONTEXT(jsdc
);
540 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
541 return jsd_ClearAllExecutionHooksForScript(jsdc
, jsdscript
);
544 JSD_PUBLIC_API(JSBool
)
545 JSD_ClearAllExecutionHooks(JSDContext
* jsdc
)
547 JSD_ASSERT_VALID_CONTEXT(jsdc
);
548 return jsd_ClearAllExecutionHooks(jsdc
);
551 JSD_PUBLIC_API(JSBool
)
552 JSD_SetInterruptHook(JSDContext
* jsdc
,
553 JSD_ExecutionHookProc hook
,
556 JSD_ASSERT_VALID_CONTEXT(jsdc
);
557 return jsd_SetInterruptHook(jsdc
, hook
, callerdata
);
560 JSD_PUBLIC_API(JSBool
)
561 JSD_ClearInterruptHook(JSDContext
* jsdc
)
563 JSD_ASSERT_VALID_CONTEXT(jsdc
);
564 return jsd_ClearInterruptHook(jsdc
);
567 JSD_PUBLIC_API(JSBool
)
568 JSD_SetDebugBreakHook(JSDContext
* jsdc
,
569 JSD_ExecutionHookProc hook
,
572 JSD_ASSERT_VALID_CONTEXT(jsdc
);
573 return jsd_SetDebugBreakHook(jsdc
, hook
, callerdata
);
576 JSD_PUBLIC_API(JSBool
)
577 JSD_ClearDebugBreakHook(JSDContext
* jsdc
)
579 JSD_ASSERT_VALID_CONTEXT(jsdc
);
580 return jsd_ClearDebugBreakHook(jsdc
);
583 JSD_PUBLIC_API(JSBool
)
584 JSD_SetDebuggerHook(JSDContext
* jsdc
,
585 JSD_ExecutionHookProc hook
,
588 JSD_ASSERT_VALID_CONTEXT(jsdc
);
589 return jsd_SetDebuggerHook(jsdc
, hook
, callerdata
);
592 JSD_PUBLIC_API(JSBool
)
593 JSD_ClearDebuggerHook(JSDContext
* jsdc
)
595 JSD_ASSERT_VALID_CONTEXT(jsdc
);
596 return jsd_ClearDebuggerHook(jsdc
);
599 JSD_PUBLIC_API(JSBool
)
600 JSD_SetThrowHook(JSDContext
* jsdc
,
601 JSD_ExecutionHookProc hook
,
604 JSD_ASSERT_VALID_CONTEXT(jsdc
);
605 return jsd_SetThrowHook(jsdc
, hook
, callerdata
);
608 JSD_PUBLIC_API(JSBool
)
609 JSD_ClearThrowHook(JSDContext
* jsdc
)
611 JSD_ASSERT_VALID_CONTEXT(jsdc
);
612 return jsd_ClearThrowHook(jsdc
);
615 JSD_PUBLIC_API(JSBool
)
616 JSD_SetTopLevelHook(JSDContext
* jsdc
,
617 JSD_CallHookProc hook
,
620 JSD_ASSERT_VALID_CONTEXT(jsdc
);
621 return jsd_SetTopLevelHook(jsdc
, hook
, callerdata
);
624 JSD_PUBLIC_API(JSBool
)
625 JSD_ClearTopLevelHook(JSDContext
* jsdc
)
627 JSD_ASSERT_VALID_CONTEXT(jsdc
);
628 return jsd_ClearTopLevelHook(jsdc
);
631 JSD_PUBLIC_API(JSBool
)
632 JSD_SetFunctionHook(JSDContext
* jsdc
,
633 JSD_CallHookProc hook
,
636 JSD_ASSERT_VALID_CONTEXT(jsdc
);
637 return jsd_SetFunctionHook(jsdc
, hook
, callerdata
);
640 JSD_PUBLIC_API(JSBool
)
641 JSD_ClearFunctionHook(JSDContext
* jsdc
)
643 JSD_ASSERT_VALID_CONTEXT(jsdc
);
644 return jsd_ClearFunctionHook(jsdc
);
647 /***************************************************************************/
648 /* Stack Frame functions */
650 JSD_PUBLIC_API(uintN
)
651 JSD_GetCountOfStackFrames(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
653 JSD_ASSERT_VALID_CONTEXT(jsdc
);
654 return jsd_GetCountOfStackFrames(jsdc
, jsdthreadstate
);
657 JSD_PUBLIC_API(JSDStackFrameInfo
*)
658 JSD_GetStackFrame(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
660 JSD_ASSERT_VALID_CONTEXT(jsdc
);
661 return jsd_GetStackFrame(jsdc
, jsdthreadstate
);
664 JSD_PUBLIC_API(JSContext
*)
665 JSD_GetJSContext(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
667 JSD_ASSERT_VALID_CONTEXT(jsdc
);
668 return jsd_GetJSContext(jsdc
, jsdthreadstate
);
671 JSD_PUBLIC_API(JSDStackFrameInfo
*)
672 JSD_GetCallingStackFrame(JSDContext
* jsdc
,
673 JSDThreadState
* jsdthreadstate
,
674 JSDStackFrameInfo
* jsdframe
)
676 JSD_ASSERT_VALID_CONTEXT(jsdc
);
677 return jsd_GetCallingStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
680 JSD_PUBLIC_API(JSDScript
*)
681 JSD_GetScriptForStackFrame(JSDContext
* jsdc
,
682 JSDThreadState
* jsdthreadstate
,
683 JSDStackFrameInfo
* jsdframe
)
685 JSD_ASSERT_VALID_CONTEXT(jsdc
);
686 return jsd_GetScriptForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
689 JSD_PUBLIC_API(jsuword
)
690 JSD_GetPCForStackFrame(JSDContext
* jsdc
,
691 JSDThreadState
* jsdthreadstate
,
692 JSDStackFrameInfo
* jsdframe
)
694 JSD_ASSERT_VALID_CONTEXT(jsdc
);
695 return jsd_GetPCForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
698 JSD_PUBLIC_API(JSDValue
*)
699 JSD_GetCallObjectForStackFrame(JSDContext
* jsdc
,
700 JSDThreadState
* jsdthreadstate
,
701 JSDStackFrameInfo
* jsdframe
)
703 JSD_ASSERT_VALID_CONTEXT(jsdc
);
704 return jsd_GetCallObjectForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
707 JSD_PUBLIC_API(JSDValue
*)
708 JSD_GetScopeChainForStackFrame(JSDContext
* jsdc
,
709 JSDThreadState
* jsdthreadstate
,
710 JSDStackFrameInfo
* jsdframe
)
712 JSD_ASSERT_VALID_CONTEXT(jsdc
);
713 return jsd_GetScopeChainForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
716 JSD_PUBLIC_API(JSDValue
*)
717 JSD_GetThisForStackFrame(JSDContext
* jsdc
,
718 JSDThreadState
* jsdthreadstate
,
719 JSDStackFrameInfo
* jsdframe
)
721 JSD_ASSERT_VALID_CONTEXT(jsdc
);
722 return jsd_GetThisForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
725 JSD_PUBLIC_API(const char*)
726 JSD_GetNameForStackFrame(JSDContext
* jsdc
,
727 JSDThreadState
* jsdthreadstate
,
728 JSDStackFrameInfo
* jsdframe
)
730 JSD_ASSERT_VALID_CONTEXT(jsdc
);
731 return jsd_GetNameForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
734 JSD_PUBLIC_API(JSBool
)
735 JSD_IsStackFrameNative(JSDContext
* jsdc
,
736 JSDThreadState
* jsdthreadstate
,
737 JSDStackFrameInfo
* jsdframe
)
739 JSD_ASSERT_VALID_CONTEXT(jsdc
);
740 return jsd_IsStackFrameNative(jsdc
, jsdthreadstate
, jsdframe
);
743 JSD_PUBLIC_API(JSBool
)
744 JSD_IsStackFrameDebugger(JSDContext
* jsdc
,
745 JSDThreadState
* jsdthreadstate
,
746 JSDStackFrameInfo
* jsdframe
)
748 JSD_ASSERT_VALID_CONTEXT(jsdc
);
749 return jsd_IsStackFrameDebugger(jsdc
, jsdthreadstate
, jsdframe
);
752 JSD_PUBLIC_API(JSBool
)
753 JSD_IsStackFrameConstructing(JSDContext
* jsdc
,
754 JSDThreadState
* jsdthreadstate
,
755 JSDStackFrameInfo
* jsdframe
)
757 JSD_ASSERT_VALID_CONTEXT(jsdc
);
758 return jsd_IsStackFrameConstructing(jsdc
, jsdthreadstate
, jsdframe
);
761 JSD_PUBLIC_API(JSBool
)
762 JSD_EvaluateUCScriptInStackFrame(JSDContext
* jsdc
,
763 JSDThreadState
* jsdthreadstate
,
764 JSDStackFrameInfo
* jsdframe
,
765 const jschar
*bytes
, uintN length
,
766 const char *filename
, uintN lineno
, jsval
*rval
)
768 JSD_ASSERT_VALID_CONTEXT(jsdc
);
774 return jsd_EvaluateUCScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
775 bytes
, length
, filename
, lineno
,
779 JSD_PUBLIC_API(JSBool
)
780 JSD_AttemptUCScriptInStackFrame(JSDContext
* jsdc
,
781 JSDThreadState
* jsdthreadstate
,
782 JSDStackFrameInfo
* jsdframe
,
783 const jschar
*bytes
, uintN length
,
784 const char *filename
, uintN lineno
,
787 JSD_ASSERT_VALID_CONTEXT(jsdc
);
793 return jsd_EvaluateUCScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
794 bytes
, length
, filename
, lineno
,
798 JSD_PUBLIC_API(JSBool
)
799 JSD_EvaluateScriptInStackFrame(JSDContext
* jsdc
,
800 JSDThreadState
* jsdthreadstate
,
801 JSDStackFrameInfo
* jsdframe
,
802 const char *bytes
, uintN length
,
803 const char *filename
, uintN lineno
, jsval
*rval
)
805 JSD_ASSERT_VALID_CONTEXT(jsdc
);
811 return jsd_EvaluateScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
813 filename
, lineno
, JS_TRUE
, rval
);
816 JSD_PUBLIC_API(JSBool
)
817 JSD_AttemptScriptInStackFrame(JSDContext
* jsdc
,
818 JSDThreadState
* jsdthreadstate
,
819 JSDStackFrameInfo
* jsdframe
,
820 const char *bytes
, uintN length
,
821 const char *filename
, uintN lineno
, jsval
*rval
)
823 JSD_ASSERT_VALID_CONTEXT(jsdc
);
829 return jsd_EvaluateScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
831 filename
, lineno
, JS_FALSE
, rval
);
834 JSD_PUBLIC_API(JSString
*)
835 JSD_ValToStringInStackFrame(JSDContext
* jsdc
,
836 JSDThreadState
* jsdthreadstate
,
837 JSDStackFrameInfo
* jsdframe
,
840 JSD_ASSERT_VALID_CONTEXT(jsdc
);
841 return jsd_ValToStringInStackFrame(jsdc
, jsdthreadstate
, jsdframe
, val
);
844 JSD_PUBLIC_API(JSDValue
*)
845 JSD_GetException(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
847 JSD_ASSERT_VALID_CONTEXT(jsdc
);
848 return jsd_GetException(jsdc
, jsdthreadstate
);
851 extern JSD_PUBLIC_API(JSBool
)
852 JSD_SetException(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
,
855 JSD_ASSERT_VALID_CONTEXT(jsdc
);
856 return jsd_SetException(jsdc
, jsdthreadstate
, jsdval
);
859 /***************************************************************************/
861 JSD_PUBLIC_API(JSBool
)
862 JSD_SetErrorReporter(JSDContext
* jsdc
,
863 JSD_ErrorReporter reporter
,
866 JSD_ASSERT_VALID_CONTEXT(jsdc
);
867 return jsd_SetErrorReporter(jsdc
, reporter
, callerdata
);
870 JSD_PUBLIC_API(JSBool
)
871 JSD_GetErrorReporter(JSDContext
* jsdc
,
872 JSD_ErrorReporter
* reporter
,
875 JSD_ASSERT_VALID_CONTEXT(jsdc
);
876 return jsd_GetErrorReporter(jsdc
, reporter
, callerdata
);
879 /***************************************************************************/
881 JSD_PUBLIC_API(JSBool
)
882 JSD_IsLockingAndThreadIdSupported()
884 #ifdef JSD_THREADSAFE
891 JSD_PUBLIC_API(void*)
894 #ifdef JSD_THREADSAFE
895 return jsd_CreateLock();
904 #ifdef JSD_THREADSAFE
910 JSD_Unlock(void* lock
)
912 #ifdef JSD_THREADSAFE
917 JSD_PUBLIC_API(JSBool
)
918 JSD_IsLocked(void* lock
)
920 #if defined(JSD_THREADSAFE) && defined(DEBUG)
921 return jsd_IsLocked(lock
);
927 JSD_PUBLIC_API(JSBool
)
928 JSD_IsUnlocked(void* lock
)
930 #if defined(JSD_THREADSAFE) && defined(DEBUG)
931 return ! jsd_IsLocked(lock
);
937 JSD_PUBLIC_API(void*)
940 return JSD_CURRENT_THREAD();
943 /***************************************************************************/
944 /* Value and Property Functions */
946 JSD_PUBLIC_API(JSDValue
*)
947 JSD_NewValue(JSDContext
* jsdc
, jsval val
)
949 JSD_ASSERT_VALID_CONTEXT(jsdc
);
950 return jsd_NewValue(jsdc
, val
);
954 JSD_DropValue(JSDContext
* jsdc
, JSDValue
* jsdval
)
956 JSD_ASSERT_VALID_CONTEXT(jsdc
);
957 JSD_ASSERT_VALID_VALUE(jsdval
);
958 jsd_DropValue(jsdc
, jsdval
);
961 JSD_PUBLIC_API(jsval
)
962 JSD_GetValueWrappedJSVal(JSDContext
* jsdc
, JSDValue
* jsdval
)
964 JSD_ASSERT_VALID_CONTEXT(jsdc
);
965 JSD_ASSERT_VALID_VALUE(jsdval
);
966 return jsd_GetValueWrappedJSVal(jsdc
, jsdval
);
970 JSD_RefreshValue(JSDContext
* jsdc
, JSDValue
* jsdval
)
972 JSD_ASSERT_VALID_CONTEXT(jsdc
);
973 JSD_ASSERT_VALID_VALUE(jsdval
);
974 jsd_RefreshValue(jsdc
, jsdval
);
977 /**************************************************/
979 JSD_PUBLIC_API(JSBool
)
980 JSD_IsValueObject(JSDContext
* jsdc
, JSDValue
* jsdval
)
982 JSD_ASSERT_VALID_CONTEXT(jsdc
);
983 JSD_ASSERT_VALID_VALUE(jsdval
);
984 return jsd_IsValueObject(jsdc
, jsdval
);
987 JSD_PUBLIC_API(JSBool
)
988 JSD_IsValueNumber(JSDContext
* jsdc
, JSDValue
* jsdval
)
990 JSD_ASSERT_VALID_CONTEXT(jsdc
);
991 JSD_ASSERT_VALID_VALUE(jsdval
);
992 return jsd_IsValueNumber(jsdc
, jsdval
);
995 JSD_PUBLIC_API(JSBool
)
996 JSD_IsValueInt(JSDContext
* jsdc
, JSDValue
* jsdval
)
998 JSD_ASSERT_VALID_CONTEXT(jsdc
);
999 JSD_ASSERT_VALID_VALUE(jsdval
);
1000 return jsd_IsValueInt(jsdc
, jsdval
);
1003 JSD_PUBLIC_API(JSBool
)
1004 JSD_IsValueDouble(JSDContext
* jsdc
, JSDValue
* jsdval
)
1006 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1007 JSD_ASSERT_VALID_VALUE(jsdval
);
1008 return jsd_IsValueDouble(jsdc
, jsdval
);
1011 JSD_PUBLIC_API(JSBool
)
1012 JSD_IsValueString(JSDContext
* jsdc
, JSDValue
* jsdval
)
1014 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1015 JSD_ASSERT_VALID_VALUE(jsdval
);
1016 return jsd_IsValueString(jsdc
, jsdval
);
1019 JSD_PUBLIC_API(JSBool
)
1020 JSD_IsValueBoolean(JSDContext
* jsdc
, JSDValue
* jsdval
)
1022 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1023 JSD_ASSERT_VALID_VALUE(jsdval
);
1024 return jsd_IsValueBoolean(jsdc
, jsdval
);
1027 JSD_PUBLIC_API(JSBool
)
1028 JSD_IsValueNull(JSDContext
* jsdc
, JSDValue
* jsdval
)
1030 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1031 JSD_ASSERT_VALID_VALUE(jsdval
);
1032 return jsd_IsValueNull(jsdc
, jsdval
);
1035 JSD_PUBLIC_API(JSBool
)
1036 JSD_IsValueVoid(JSDContext
* jsdc
, JSDValue
* jsdval
)
1038 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1039 JSD_ASSERT_VALID_VALUE(jsdval
);
1040 return jsd_IsValueVoid(jsdc
, jsdval
);
1043 JSD_PUBLIC_API(JSBool
)
1044 JSD_IsValuePrimitive(JSDContext
* jsdc
, JSDValue
* jsdval
)
1046 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1047 JSD_ASSERT_VALID_VALUE(jsdval
);
1048 return jsd_IsValuePrimitive(jsdc
, jsdval
);
1051 JSD_PUBLIC_API(JSBool
)
1052 JSD_IsValueFunction(JSDContext
* jsdc
, JSDValue
* jsdval
)
1054 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1055 JSD_ASSERT_VALID_VALUE(jsdval
);
1056 return jsd_IsValueFunction(jsdc
, jsdval
);
1059 JSD_PUBLIC_API(JSBool
)
1060 JSD_IsValueNative(JSDContext
* jsdc
, JSDValue
* jsdval
)
1062 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1063 JSD_ASSERT_VALID_VALUE(jsdval
);
1064 return jsd_IsValueNative(jsdc
, jsdval
);
1067 /**************************************************/
1069 JSD_PUBLIC_API(JSBool
)
1070 JSD_GetValueBoolean(JSDContext
* jsdc
, JSDValue
* jsdval
)
1072 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1073 JSD_ASSERT_VALID_VALUE(jsdval
);
1074 return jsd_GetValueBoolean(jsdc
, jsdval
);
1077 JSD_PUBLIC_API(int32
)
1078 JSD_GetValueInt(JSDContext
* jsdc
, JSDValue
* jsdval
)
1080 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1081 JSD_ASSERT_VALID_VALUE(jsdval
);
1082 return jsd_GetValueInt(jsdc
, jsdval
);
1085 JSD_PUBLIC_API(jsdouble
*)
1086 JSD_GetValueDouble(JSDContext
* jsdc
, JSDValue
* jsdval
)
1088 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1089 JSD_ASSERT_VALID_VALUE(jsdval
);
1090 return jsd_GetValueDouble(jsdc
, jsdval
);
1093 JSD_PUBLIC_API(JSString
*)
1094 JSD_GetValueString(JSDContext
* jsdc
, JSDValue
* jsdval
)
1096 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1097 JSD_ASSERT_VALID_VALUE(jsdval
);
1098 return jsd_GetValueString(jsdc
, jsdval
);
1101 JSD_PUBLIC_API(const char*)
1102 JSD_GetValueFunctionName(JSDContext
* jsdc
, JSDValue
* jsdval
)
1104 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1105 JSD_ASSERT_VALID_VALUE(jsdval
);
1106 return jsd_GetValueFunctionName(jsdc
, jsdval
);
1109 /**************************************************/
1111 JSD_PUBLIC_API(uintN
)
1112 JSD_GetCountOfProperties(JSDContext
* jsdc
, JSDValue
* jsdval
)
1114 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1115 JSD_ASSERT_VALID_VALUE(jsdval
);
1116 return jsd_GetCountOfProperties(jsdc
, jsdval
);
1119 JSD_PUBLIC_API(JSDProperty
*)
1120 JSD_IterateProperties(JSDContext
* jsdc
, JSDValue
* jsdval
, JSDProperty
**iterp
)
1122 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1123 JSD_ASSERT_VALID_VALUE(jsdval
);
1125 return jsd_IterateProperties(jsdc
, jsdval
, iterp
);
1128 JSD_PUBLIC_API(JSDProperty
*)
1129 JSD_GetValueProperty(JSDContext
* jsdc
, JSDValue
* jsdval
, JSString
* name
)
1131 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1132 JSD_ASSERT_VALID_VALUE(jsdval
);
1134 return jsd_GetValueProperty(jsdc
, jsdval
, name
);
1137 JSD_PUBLIC_API(JSDValue
*)
1138 JSD_GetValuePrototype(JSDContext
* jsdc
, JSDValue
* jsdval
)
1140 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1141 JSD_ASSERT_VALID_VALUE(jsdval
);
1142 return jsd_GetValuePrototype(jsdc
, jsdval
);
1145 JSD_PUBLIC_API(JSDValue
*)
1146 JSD_GetValueParent(JSDContext
* jsdc
, JSDValue
* jsdval
)
1148 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1149 JSD_ASSERT_VALID_VALUE(jsdval
);
1150 return jsd_GetValueParent(jsdc
, jsdval
);
1153 JSD_PUBLIC_API(JSDValue
*)
1154 JSD_GetValueConstructor(JSDContext
* jsdc
, JSDValue
* jsdval
)
1156 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1157 JSD_ASSERT_VALID_VALUE(jsdval
);
1158 return jsd_GetValueConstructor(jsdc
, jsdval
);
1161 JSD_PUBLIC_API(const char*)
1162 JSD_GetValueClassName(JSDContext
* jsdc
, JSDValue
* jsdval
)
1164 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1165 JSD_ASSERT_VALID_VALUE(jsdval
);
1166 return jsd_GetValueClassName(jsdc
, jsdval
);
1169 /**************************************************/
1171 JSD_PUBLIC_API(void)
1172 JSD_DropProperty(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1174 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1175 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1176 jsd_DropProperty(jsdc
, jsdprop
);
1180 JSD_PUBLIC_API(JSDValue
*)
1181 JSD_GetPropertyName(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1183 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1184 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1185 return jsd_GetPropertyName(jsdc
, jsdprop
);
1188 JSD_PUBLIC_API(JSDValue
*)
1189 JSD_GetPropertyValue(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1191 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1192 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1193 return jsd_GetPropertyValue(jsdc
, jsdprop
);
1196 JSD_PUBLIC_API(JSDValue
*)
1197 JSD_GetPropertyAlias(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1199 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1200 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1201 return jsd_GetPropertyAlias(jsdc
, jsdprop
);
1204 JSD_PUBLIC_API(uintN
)
1205 JSD_GetPropertyFlags(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1207 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1208 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1209 return jsd_GetPropertyFlags(jsdc
, jsdprop
);
1212 JSD_PUBLIC_API(uintN
)
1213 JSD_GetPropertyVarArgSlot(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1215 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1216 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1217 return jsd_GetPropertyVarArgSlot(jsdc
, jsdprop
);
1220 /**************************************************/
1221 /* Object Functions */
1223 JSD_PUBLIC_API(void)
1224 JSD_LockObjectSubsystem(JSDContext
* jsdc
)
1226 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1227 JSD_LOCK_OBJECTS(jsdc
);
1230 JSD_PUBLIC_API(void)
1231 JSD_UnlockObjectSubsystem(JSDContext
* jsdc
)
1233 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1234 JSD_UNLOCK_OBJECTS(jsdc
);
1237 JSD_PUBLIC_API(JSDObject
*)
1238 JSD_IterateObjects(JSDContext
* jsdc
, JSDObject
** iterp
)
1240 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1241 return jsd_IterateObjects(jsdc
, iterp
);
1244 JSD_PUBLIC_API(JSObject
*)
1245 JSD_GetWrappedObject(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1247 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1248 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1249 return jsd_GetWrappedObject(jsdc
, jsdobj
);
1253 JSD_PUBLIC_API(const char*)
1254 JSD_GetObjectNewURL(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1256 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1257 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1258 return jsd_GetObjectNewURL(jsdc
, jsdobj
);
1261 JSD_PUBLIC_API(uintN
)
1262 JSD_GetObjectNewLineNumber(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1264 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1265 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1266 return jsd_GetObjectNewLineNumber(jsdc
, jsdobj
);
1269 JSD_PUBLIC_API(const char*)
1270 JSD_GetObjectConstructorURL(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1272 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1273 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1274 return jsd_GetObjectConstructorURL(jsdc
, jsdobj
);
1277 JSD_PUBLIC_API(uintN
)
1278 JSD_GetObjectConstructorLineNumber(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1280 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1281 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1282 return jsd_GetObjectConstructorLineNumber(jsdc
, jsdobj
);
1285 JSD_PUBLIC_API(const char*)
1286 JSD_GetObjectConstructorName(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1288 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1289 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1290 return jsd_GetObjectConstructorName(jsdc
, jsdobj
);
1293 JSD_PUBLIC_API(JSDObject
*)
1294 JSD_GetJSDObjectForJSObject(JSDContext
* jsdc
, JSObject
* jsobj
)
1296 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1298 return jsd_GetJSDObjectForJSObject(jsdc
, jsobj
);
1301 JSD_PUBLIC_API(JSDObject
*)
1302 JSD_GetObjectForValue(JSDContext
* jsdc
, JSDValue
* jsdval
)
1304 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1305 JSD_ASSERT_VALID_VALUE(jsdval
);
1306 return jsd_GetObjectForValue(jsdc
, jsdval
);
1309 JSD_PUBLIC_API(JSDValue
*)
1310 JSD_GetValueForObject(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1312 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1313 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1314 return jsd_GetValueForObject(jsdc
, jsdobj
);
1317 /***************************************************************************/
1318 /* Livewire specific API */
1321 JSD_PUBLIC_API(LWDBGScript
*)
1322 JSDLW_GetLWScript(JSDContext
* jsdc
, JSDScript
* jsdscript
)
1324 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1325 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
1326 return jsdlw_GetLWScript(jsdc
, jsdscript
);
1329 JSD_PUBLIC_API(JSDSourceText
*)
1330 JSDLW_PreLoadSource( JSDContext
* jsdc
, LWDBGApp
* app
,
1331 const char* filename
, JSBool clear
)
1333 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1335 JS_ASSERT(filename
);
1336 return jsdlw_PreLoadSource(jsdc
, app
, filename
, clear
);
1339 JSD_PUBLIC_API(JSDSourceText
*)
1340 JSDLW_ForceLoadSource( JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
1342 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1343 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
1344 return jsdlw_ForceLoadSource(jsdc
, jsdsrc
);
1347 JSD_PUBLIC_API(JSBool
)
1348 JSDLW_RawToProcessedLineNumber(JSDContext
* jsdc
, JSDScript
* jsdscript
,
1349 uintN lineIn
, uintN
* lineOut
)
1351 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1352 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
1353 return jsdlw_RawToProcessedLineNumber(jsdc
, jsdscript
, lineIn
, lineOut
);
1356 JSD_PUBLIC_API(JSBool
)
1357 JSDLW_ProcessedToRawLineNumber(JSDContext
* jsdc
, JSDScript
* jsdscript
,
1358 uintN lineIn
, uintN
* lineOut
)
1360 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1361 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
1362 return jsdlw_ProcessedToRawLineNumber(jsdc
, jsdscript
, lineIn
, lineOut
);
1366 /***************************************************************************/