1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 * JavaScript Debugging support - All public functions
12 /***************************************************************************/
13 /* High Level calls */
15 JSD_PUBLIC_API(JSDContext
*)
16 JSD_DebuggerOnForUser(JSRuntime
* jsrt
,
17 JSD_UserCallbacks
* callbacks
,
20 return jsd_DebuggerOnForUser(jsrt
, callbacks
, user
, NULL
);
23 JSD_PUBLIC_API(JSDContext
*)
26 return jsd_DebuggerOn();
30 JSD_DebuggerOff(JSDContext
* jsdc
)
32 JSD_ASSERT_VALID_CONTEXT(jsdc
);
33 jsd_DebuggerOff(jsdc
);
37 JSD_DebuggerPause(JSDContext
* jsdc
)
39 JSD_ASSERT_VALID_CONTEXT(jsdc
);
40 jsd_DebuggerPause(jsdc
, JS_FALSE
);
44 JSD_DebuggerUnpause(JSDContext
* jsdc
)
46 JSD_ASSERT_VALID_CONTEXT(jsdc
);
47 jsd_DebuggerUnpause(jsdc
);
50 JSD_PUBLIC_API(unsigned)
51 JSD_GetMajorVersion(void)
53 return JSD_MAJOR_VERSION
;
56 JSD_PUBLIC_API(unsigned)
57 JSD_GetMinorVersion(void)
59 return JSD_MINOR_VERSION
;
62 JSD_PUBLIC_API(JSContext
*)
63 JSD_GetDefaultJSContext(JSDContext
* jsdc
)
65 JSD_ASSERT_VALID_CONTEXT(jsdc
);
66 return jsdc
->dumbContext
;
69 JSD_PUBLIC_API(JSRuntime
*)
70 JSD_GetJSRuntime(JSDContext
* jsdc
)
72 JSD_ASSERT_VALID_CONTEXT(jsdc
);
77 JSD_SetUserCallbacks(JSRuntime
* jsrt
, JSD_UserCallbacks
* callbacks
, void* user
)
79 jsd_SetUserCallbacks(jsrt
, callbacks
, user
);
83 JSD_JSContextInUse(JSDContext
* jsdc
, JSContext
* context
)
85 JSD_ASSERT_VALID_CONTEXT(jsdc
);
86 /* we no longer need this information - may need it again in the future */
89 JSD_PUBLIC_API(void *)
90 JSD_SetContextPrivate(JSDContext
*jsdc
, void *data
)
92 JSD_ASSERT_VALID_CONTEXT(jsdc
);
93 return jsd_SetContextPrivate (jsdc
, data
);
96 JSD_PUBLIC_API(void *)
97 JSD_GetContextPrivate(JSDContext
*jsdc
)
99 JSD_ASSERT_VALID_CONTEXT(jsdc
);
100 return jsd_GetContextPrivate (jsdc
);
104 JSD_ClearAllProfileData(JSDContext
*jsdc
)
106 JSD_ASSERT_VALID_CONTEXT(jsdc
);
107 jsd_ClearAllProfileData(jsdc
);
111 JSD_SetContextFlags(JSDContext
*jsdc
, uint32_t flags
)
113 JSD_ASSERT_VALID_CONTEXT(jsdc
);
115 if (flags
& JSD_COLLECT_PROFILE_DATA
) {
116 /* Need to reenable our call hooks now */
117 JS_SetExecuteHook(jsdc
->jsrt
, jsd_TopLevelCallHook
, jsdc
);
118 JS_SetCallHook(jsdc
->jsrt
, jsd_FunctionCallHook
, jsdc
);
122 JSD_PUBLIC_API(uint32_t)
123 JSD_GetContextFlags(JSDContext
*jsdc
)
125 JSD_ASSERT_VALID_CONTEXT(jsdc
);
129 JSD_PUBLIC_API(JSDContext
*)
130 JSD_JSDContextForJSContext(JSContext
* context
)
132 return jsd_JSDContextForJSContext(context
);
135 /***************************************************************************/
136 /* Script functions */
139 JSD_LockScriptSubsystem(JSDContext
* jsdc
)
141 JSD_ASSERT_VALID_CONTEXT(jsdc
);
142 JSD_LOCK_SCRIPTS(jsdc
);
146 JSD_UnlockScriptSubsystem(JSDContext
* jsdc
)
148 JSD_ASSERT_VALID_CONTEXT(jsdc
);
149 JSD_UNLOCK_SCRIPTS(jsdc
);
152 JSD_PUBLIC_API(JSDScript
*)
153 JSD_IterateScripts(JSDContext
* jsdc
, JSDScript
**iterp
)
155 JSD_ASSERT_VALID_CONTEXT(jsdc
);
156 return jsd_IterateScripts(jsdc
, iterp
);
159 JSD_PUBLIC_API(uint32_t)
160 JSD_GetScriptFlags(JSDContext
*jsdc
, JSDScript
*script
)
162 JSD_ASSERT_VALID_CONTEXT(jsdc
);
163 return jsd_GetScriptFlags(jsdc
, script
);
167 JSD_SetScriptFlags(JSDContext
*jsdc
, JSDScript
*script
, uint32_t flags
)
169 JSD_ASSERT_VALID_CONTEXT(jsdc
);
170 jsd_SetScriptFlags(jsdc
, script
, flags
);
173 JSD_PUBLIC_API(unsigned)
174 JSD_GetScriptCallCount(JSDContext
* jsdc
, JSDScript
*script
)
176 JSD_ASSERT_VALID_CONTEXT(jsdc
);
177 return jsd_GetScriptCallCount(jsdc
, script
);
180 JSD_PUBLIC_API(unsigned)
181 JSD_GetScriptMaxRecurseDepth(JSDContext
* jsdc
, JSDScript
*script
)
183 JSD_ASSERT_VALID_CONTEXT(jsdc
);
184 return jsd_GetScriptMaxRecurseDepth(jsdc
, script
);
188 JSD_PUBLIC_API(double)
189 JSD_GetScriptMinExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
191 JSD_ASSERT_VALID_CONTEXT(jsdc
);
192 return jsd_GetScriptMinExecutionTime(jsdc
, script
);
195 JSD_PUBLIC_API(double)
196 JSD_GetScriptMaxExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
198 JSD_ASSERT_VALID_CONTEXT(jsdc
);
199 return jsd_GetScriptMaxExecutionTime(jsdc
, script
);
202 JSD_PUBLIC_API(double)
203 JSD_GetScriptTotalExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
205 JSD_ASSERT_VALID_CONTEXT(jsdc
);
206 return jsd_GetScriptTotalExecutionTime(jsdc
, script
);
209 JSD_PUBLIC_API(double)
210 JSD_GetScriptMinOwnExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
212 JSD_ASSERT_VALID_CONTEXT(jsdc
);
213 return jsd_GetScriptMinOwnExecutionTime(jsdc
, script
);
216 JSD_PUBLIC_API(double)
217 JSD_GetScriptMaxOwnExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
219 JSD_ASSERT_VALID_CONTEXT(jsdc
);
220 return jsd_GetScriptMaxOwnExecutionTime(jsdc
, script
);
223 JSD_PUBLIC_API(double)
224 JSD_GetScriptTotalOwnExecutionTime(JSDContext
* jsdc
, JSDScript
*script
)
226 JSD_ASSERT_VALID_CONTEXT(jsdc
);
227 return jsd_GetScriptTotalOwnExecutionTime(jsdc
, script
);
231 JSD_ClearScriptProfileData(JSDContext
* jsdc
, JSDScript
*script
)
233 JSD_ASSERT_VALID_CONTEXT(jsdc
);
234 jsd_ClearScriptProfileData(jsdc
, script
);
237 JSD_PUBLIC_API(JSScript
*)
238 JSD_GetJSScript(JSDContext
* jsdc
, JSDScript
*script
)
240 return jsd_GetJSScript(jsdc
, script
);
243 JSD_PUBLIC_API(JSFunction
*)
244 JSD_GetJSFunction(JSDContext
* jsdc
, JSDScript
*script
)
246 return jsd_GetJSFunction (jsdc
, script
);
249 JSD_PUBLIC_API(void *)
250 JSD_SetScriptPrivate(JSDScript
*jsdscript
, void *data
)
252 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
253 return jsd_SetScriptPrivate (jsdscript
, data
);
256 JSD_PUBLIC_API(void *)
257 JSD_GetScriptPrivate(JSDScript
*jsdscript
)
259 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
260 return jsd_GetScriptPrivate (jsdscript
);
264 JSD_PUBLIC_API(JSBool
)
265 JSD_IsActiveScript(JSDContext
* jsdc
, JSDScript
*jsdscript
)
267 JSD_ASSERT_VALID_CONTEXT(jsdc
);
268 return jsd_IsActiveScript(jsdc
, jsdscript
);
271 JSD_PUBLIC_API(const char*)
272 JSD_GetScriptFilename(JSDContext
* jsdc
, JSDScript
*jsdscript
)
274 JSD_ASSERT_VALID_CONTEXT(jsdc
);
275 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
276 return jsd_GetScriptFilename(jsdc
, jsdscript
);
279 JSD_PUBLIC_API(JSString
*)
280 JSD_GetScriptFunctionId(JSDContext
* jsdc
, JSDScript
*jsdscript
)
282 JSD_ASSERT_VALID_CONTEXT(jsdc
);
283 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
284 return jsd_GetScriptFunctionId(jsdc
, jsdscript
);
287 JSD_PUBLIC_API(unsigned)
288 JSD_GetScriptBaseLineNumber(JSDContext
* jsdc
, JSDScript
*jsdscript
)
290 JSD_ASSERT_VALID_CONTEXT(jsdc
);
291 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
292 return jsd_GetScriptBaseLineNumber(jsdc
, jsdscript
);
295 JSD_PUBLIC_API(unsigned)
296 JSD_GetScriptLineExtent(JSDContext
* jsdc
, JSDScript
*jsdscript
)
298 JSD_ASSERT_VALID_CONTEXT(jsdc
);
299 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
300 return jsd_GetScriptLineExtent(jsdc
, jsdscript
);
303 JSD_PUBLIC_API(JSBool
)
304 JSD_SetScriptHook(JSDContext
* jsdc
, JSD_ScriptHookProc hook
, void* callerdata
)
306 JSD_ASSERT_VALID_CONTEXT(jsdc
);
307 return jsd_SetScriptHook(jsdc
, hook
, callerdata
);
310 JSD_PUBLIC_API(JSBool
)
311 JSD_GetScriptHook(JSDContext
* jsdc
, JSD_ScriptHookProc
* hook
, void** callerdata
)
313 JSD_ASSERT_VALID_CONTEXT(jsdc
);
314 return jsd_GetScriptHook(jsdc
, hook
, callerdata
);
317 JSD_PUBLIC_API(uintptr_t)
318 JSD_GetClosestPC(JSDContext
* jsdc
, JSDScript
* jsdscript
, unsigned line
)
320 JSD_ASSERT_VALID_CONTEXT(jsdc
);
321 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
322 return jsd_GetClosestPC(jsdc
, jsdscript
, line
);
325 JSD_PUBLIC_API(unsigned)
326 JSD_GetClosestLine(JSDContext
* jsdc
, JSDScript
* jsdscript
, uintptr_t pc
)
328 JSD_ASSERT_VALID_CONTEXT(jsdc
);
329 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
330 return jsd_GetClosestLine(jsdc
, jsdscript
, pc
);
333 JSD_PUBLIC_API(JSBool
)
334 JSD_GetLinePCs(JSDContext
* jsdc
, JSDScript
* jsdscript
,
335 unsigned startLine
, unsigned maxLines
,
336 unsigned* count
, unsigned** lines
, uintptr_t** pcs
)
338 JSD_ASSERT_VALID_CONTEXT(jsdc
);
339 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
340 return jsd_GetLinePCs(jsdc
, jsdscript
, startLine
, maxLines
, count
, lines
, pcs
);
344 JSD_ScriptCreated(JSDContext
* jsdc
,
346 const char *filename
, /* URL this script loads from */
347 unsigned lineno
, /* line where this script starts */
351 JSD_ASSERT_VALID_CONTEXT(jsdc
);
352 jsd_ScriptCreated(jsdc
, cx
, filename
, lineno
, script
, fun
);
356 JSD_ScriptDestroyed(JSDContext
* jsdc
,
360 JSD_ASSERT_VALID_CONTEXT(jsdc
);
361 jsd_ScriptDestroyed(jsdc
, fop
, script
);
364 /***************************************************************************/
365 /* Source Text functions */
368 JSD_LockSourceTextSubsystem(JSDContext
* jsdc
)
370 JSD_ASSERT_VALID_CONTEXT(jsdc
);
371 JSD_LOCK_SOURCE_TEXT(jsdc
);
375 JSD_UnlockSourceTextSubsystem(JSDContext
* jsdc
)
377 JSD_ASSERT_VALID_CONTEXT(jsdc
);
378 JSD_UNLOCK_SOURCE_TEXT(jsdc
);
381 JSD_PUBLIC_API(JSDSourceText
*)
382 JSD_IterateSources(JSDContext
* jsdc
, JSDSourceText
**iterp
)
384 JSD_ASSERT_VALID_CONTEXT(jsdc
);
385 return jsd_IterateSources(jsdc
, iterp
);
388 JSD_PUBLIC_API(JSDSourceText
*)
389 JSD_FindSourceForURL(JSDContext
* jsdc
, const char* url
)
391 JSD_ASSERT_VALID_CONTEXT(jsdc
);
393 return jsd_FindSourceForURL(jsdc
, url
);
396 JSD_PUBLIC_API(const char*)
397 JSD_GetSourceURL(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
399 JSD_ASSERT_VALID_CONTEXT(jsdc
);
400 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
401 return jsd_GetSourceURL(jsdc
,jsdsrc
);
404 JSD_PUBLIC_API(JSBool
)
405 JSD_GetSourceText(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
,
406 const char** ppBuf
, int* pLen
)
408 JSD_ASSERT_VALID_CONTEXT(jsdc
);
409 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
412 return jsd_GetSourceText(jsdc
, jsdsrc
, ppBuf
, pLen
);
416 JSD_ClearSourceText(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
418 JSD_ASSERT_VALID_CONTEXT(jsdc
);
419 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
420 jsd_ClearSourceText(jsdc
, jsdsrc
);
424 JSD_PUBLIC_API(JSDSourceStatus
)
425 JSD_GetSourceStatus(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
427 JSD_ASSERT_VALID_CONTEXT(jsdc
);
428 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
429 return jsd_GetSourceStatus(jsdc
, jsdsrc
);
432 JSD_PUBLIC_API(JSBool
)
433 JSD_IsSourceDirty(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
435 JSD_ASSERT_VALID_CONTEXT(jsdc
);
436 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
437 return jsd_IsSourceDirty(jsdc
, jsdsrc
);
441 JSD_SetSourceDirty(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
, JSBool dirty
)
443 JSD_ASSERT_VALID_CONTEXT(jsdc
);
444 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
445 jsd_SetSourceDirty(jsdc
, jsdsrc
, dirty
);
448 JSD_PUBLIC_API(unsigned)
449 JSD_GetSourceAlterCount(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
451 JSD_ASSERT_VALID_CONTEXT(jsdc
);
452 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
453 return jsd_GetSourceAlterCount(jsdc
, jsdsrc
);
456 JSD_PUBLIC_API(unsigned)
457 JSD_IncrementSourceAlterCount(JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
459 JSD_ASSERT_VALID_CONTEXT(jsdc
);
460 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
461 return jsd_IncrementSourceAlterCount(jsdc
, jsdsrc
);
465 JSD_DestroyAllSources( JSDContext
* jsdc
)
467 JSD_ASSERT_VALID_CONTEXT(jsdc
);
468 jsd_DestroyAllSources(jsdc
);
471 JSD_PUBLIC_API(JSDSourceText
*)
472 JSD_NewSourceText(JSDContext
* jsdc
, const char* url
)
474 JSD_ASSERT_VALID_CONTEXT(jsdc
);
476 return jsd_NewSourceText(jsdc
, url
);
479 JSD_PUBLIC_API(JSDSourceText
*)
480 JSD_AppendSourceText(JSDContext
* jsdc
,
481 JSDSourceText
* jsdsrc
,
482 const char* text
, /* *not* zero terminated */
484 JSDSourceStatus status
)
486 JSD_ASSERT_VALID_CONTEXT(jsdc
);
487 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
488 return jsd_AppendSourceText(jsdc
, jsdsrc
, text
, length
, status
);
491 extern JSD_PUBLIC_API(JSDSourceText
*)
492 JSD_AppendUCSourceText(JSDContext
* jsdc
,
493 JSDSourceText
* jsdsrc
,
494 const jschar
* text
, /* *not* zero terminated */
496 JSDSourceStatus status
)
498 JSD_ASSERT_VALID_CONTEXT(jsdc
);
499 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
500 return jsd_AppendUCSourceText(jsdc
, jsdsrc
, text
, length
, status
);
503 JSD_PUBLIC_API(JSBool
)
504 JSD_AddFullSourceText(JSDContext
* jsdc
,
505 const char* text
, /* *not* zero terminated */
509 JSD_ASSERT_VALID_CONTEXT(jsdc
);
511 return jsd_AddFullSourceText(jsdc
, text
, length
, url
);
514 /***************************************************************************/
515 /* Execution/Interrupt Hook functions */
517 JSD_PUBLIC_API(JSBool
)
518 JSD_SetExecutionHook(JSDContext
* jsdc
,
519 JSDScript
* jsdscript
,
521 JSD_ExecutionHookProc hook
,
524 JSD_ASSERT_VALID_CONTEXT(jsdc
);
525 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
526 return jsd_SetExecutionHook(jsdc
, jsdscript
, pc
, hook
, callerdata
);
529 JSD_PUBLIC_API(JSBool
)
530 JSD_ClearExecutionHook(JSDContext
* jsdc
,
531 JSDScript
* jsdscript
,
534 JSD_ASSERT_VALID_CONTEXT(jsdc
);
535 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
536 return jsd_ClearExecutionHook(jsdc
, jsdscript
, pc
);
539 JSD_PUBLIC_API(JSBool
)
540 JSD_ClearAllExecutionHooksForScript(JSDContext
* jsdc
, JSDScript
* jsdscript
)
542 JSD_ASSERT_VALID_CONTEXT(jsdc
);
543 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
544 return jsd_ClearAllExecutionHooksForScript(jsdc
, jsdscript
);
547 JSD_PUBLIC_API(JSBool
)
548 JSD_ClearAllExecutionHooks(JSDContext
* jsdc
)
550 JSD_ASSERT_VALID_CONTEXT(jsdc
);
551 return jsd_ClearAllExecutionHooks(jsdc
);
554 JSD_PUBLIC_API(JSBool
)
555 JSD_SetInterruptHook(JSDContext
* jsdc
,
556 JSD_ExecutionHookProc hook
,
559 JSD_ASSERT_VALID_CONTEXT(jsdc
);
560 return jsd_SetInterruptHook(jsdc
, hook
, callerdata
);
563 JSD_PUBLIC_API(JSBool
)
564 JSD_EnableSingleStepInterrupts(JSDContext
* jsdc
, JSDScript
* jsdscript
, JSBool enable
)
566 JSD_ASSERT_VALID_CONTEXT(jsdc
);
567 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
568 return jsd_EnableSingleStepInterrupts(jsdc
, jsdscript
, enable
);
571 JSD_PUBLIC_API(JSBool
)
572 JSD_ClearInterruptHook(JSDContext
* jsdc
)
574 JSD_ASSERT_VALID_CONTEXT(jsdc
);
575 return jsd_ClearInterruptHook(jsdc
);
578 JSD_PUBLIC_API(JSBool
)
579 JSD_SetDebugBreakHook(JSDContext
* jsdc
,
580 JSD_ExecutionHookProc hook
,
583 JSD_ASSERT_VALID_CONTEXT(jsdc
);
584 return jsd_SetDebugBreakHook(jsdc
, hook
, callerdata
);
587 JSD_PUBLIC_API(JSBool
)
588 JSD_ClearDebugBreakHook(JSDContext
* jsdc
)
590 JSD_ASSERT_VALID_CONTEXT(jsdc
);
591 return jsd_ClearDebugBreakHook(jsdc
);
594 JSD_PUBLIC_API(JSBool
)
595 JSD_SetDebuggerHook(JSDContext
* jsdc
,
596 JSD_ExecutionHookProc hook
,
599 JSD_ASSERT_VALID_CONTEXT(jsdc
);
600 return jsd_SetDebuggerHook(jsdc
, hook
, callerdata
);
603 JSD_PUBLIC_API(JSBool
)
604 JSD_ClearDebuggerHook(JSDContext
* jsdc
)
606 JSD_ASSERT_VALID_CONTEXT(jsdc
);
607 return jsd_ClearDebuggerHook(jsdc
);
610 JSD_PUBLIC_API(JSBool
)
611 JSD_SetThrowHook(JSDContext
* jsdc
,
612 JSD_ExecutionHookProc hook
,
615 JSD_ASSERT_VALID_CONTEXT(jsdc
);
616 return jsd_SetThrowHook(jsdc
, hook
, callerdata
);
619 JSD_PUBLIC_API(JSBool
)
620 JSD_ClearThrowHook(JSDContext
* jsdc
)
622 JSD_ASSERT_VALID_CONTEXT(jsdc
);
623 return jsd_ClearThrowHook(jsdc
);
626 JSD_PUBLIC_API(JSBool
)
627 JSD_SetTopLevelHook(JSDContext
* jsdc
,
628 JSD_CallHookProc hook
,
631 JSD_ASSERT_VALID_CONTEXT(jsdc
);
632 return jsd_SetTopLevelHook(jsdc
, hook
, callerdata
);
635 JSD_PUBLIC_API(JSBool
)
636 JSD_ClearTopLevelHook(JSDContext
* jsdc
)
638 JSD_ASSERT_VALID_CONTEXT(jsdc
);
639 return jsd_ClearTopLevelHook(jsdc
);
642 JSD_PUBLIC_API(JSBool
)
643 JSD_SetFunctionHook(JSDContext
* jsdc
,
644 JSD_CallHookProc hook
,
647 JSD_ASSERT_VALID_CONTEXT(jsdc
);
648 return jsd_SetFunctionHook(jsdc
, hook
, callerdata
);
651 JSD_PUBLIC_API(JSBool
)
652 JSD_ClearFunctionHook(JSDContext
* jsdc
)
654 JSD_ASSERT_VALID_CONTEXT(jsdc
);
655 return jsd_ClearFunctionHook(jsdc
);
658 /***************************************************************************/
659 /* Stack Frame functions */
661 JSD_PUBLIC_API(unsigned)
662 JSD_GetCountOfStackFrames(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
664 JSD_ASSERT_VALID_CONTEXT(jsdc
);
665 return jsd_GetCountOfStackFrames(jsdc
, jsdthreadstate
);
668 JSD_PUBLIC_API(JSDStackFrameInfo
*)
669 JSD_GetStackFrame(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
671 JSD_ASSERT_VALID_CONTEXT(jsdc
);
672 return jsd_GetStackFrame(jsdc
, jsdthreadstate
);
675 JSD_PUBLIC_API(JSContext
*)
676 JSD_GetJSContext(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
678 JSD_ASSERT_VALID_CONTEXT(jsdc
);
679 return jsd_GetJSContext(jsdc
, jsdthreadstate
);
682 JSD_PUBLIC_API(JSDStackFrameInfo
*)
683 JSD_GetCallingStackFrame(JSDContext
* jsdc
,
684 JSDThreadState
* jsdthreadstate
,
685 JSDStackFrameInfo
* jsdframe
)
687 JSD_ASSERT_VALID_CONTEXT(jsdc
);
688 return jsd_GetCallingStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
691 JSD_PUBLIC_API(JSDScript
*)
692 JSD_GetScriptForStackFrame(JSDContext
* jsdc
,
693 JSDThreadState
* jsdthreadstate
,
694 JSDStackFrameInfo
* jsdframe
)
696 JSD_ASSERT_VALID_CONTEXT(jsdc
);
697 return jsd_GetScriptForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
700 JSD_PUBLIC_API(uintptr_t)
701 JSD_GetPCForStackFrame(JSDContext
* jsdc
,
702 JSDThreadState
* jsdthreadstate
,
703 JSDStackFrameInfo
* jsdframe
)
705 JSD_ASSERT_VALID_CONTEXT(jsdc
);
706 return jsd_GetPCForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
709 JSD_PUBLIC_API(JSDValue
*)
710 JSD_GetCallObjectForStackFrame(JSDContext
* jsdc
,
711 JSDThreadState
* jsdthreadstate
,
712 JSDStackFrameInfo
* jsdframe
)
714 JSD_ASSERT_VALID_CONTEXT(jsdc
);
715 return jsd_GetCallObjectForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
718 JSD_PUBLIC_API(JSDValue
*)
719 JSD_GetScopeChainForStackFrame(JSDContext
* jsdc
,
720 JSDThreadState
* jsdthreadstate
,
721 JSDStackFrameInfo
* jsdframe
)
723 JSD_ASSERT_VALID_CONTEXT(jsdc
);
724 return jsd_GetScopeChainForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
727 JSD_PUBLIC_API(JSDValue
*)
728 JSD_GetThisForStackFrame(JSDContext
* jsdc
,
729 JSDThreadState
* jsdthreadstate
,
730 JSDStackFrameInfo
* jsdframe
)
732 JSD_ASSERT_VALID_CONTEXT(jsdc
);
733 return jsd_GetThisForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
736 JSD_PUBLIC_API(JSString
*)
737 JSD_GetIdForStackFrame(JSDContext
* jsdc
,
738 JSDThreadState
* jsdthreadstate
,
739 JSDStackFrameInfo
* jsdframe
)
741 JSD_ASSERT_VALID_CONTEXT(jsdc
);
742 return jsd_GetIdForStackFrame(jsdc
, jsdthreadstate
, jsdframe
);
745 JSD_PUBLIC_API(JSBool
)
746 JSD_IsStackFrameDebugger(JSDContext
* jsdc
,
747 JSDThreadState
* jsdthreadstate
,
748 JSDStackFrameInfo
* jsdframe
)
750 JSD_ASSERT_VALID_CONTEXT(jsdc
);
751 return jsd_IsStackFrameDebugger(jsdc
, jsdthreadstate
, jsdframe
);
754 JSD_PUBLIC_API(JSBool
)
755 JSD_IsStackFrameConstructing(JSDContext
* jsdc
,
756 JSDThreadState
* jsdthreadstate
,
757 JSDStackFrameInfo
* jsdframe
)
759 JSD_ASSERT_VALID_CONTEXT(jsdc
);
760 return jsd_IsStackFrameConstructing(jsdc
, jsdthreadstate
, jsdframe
);
763 JSD_PUBLIC_API(JSBool
)
764 JSD_EvaluateUCScriptInStackFrame(JSDContext
* jsdc
,
765 JSDThreadState
* jsdthreadstate
,
766 JSDStackFrameInfo
* jsdframe
,
767 const jschar
*bytes
, unsigned length
,
768 const char *filename
, unsigned lineno
, jsval
*rval
)
770 JSD_ASSERT_VALID_CONTEXT(jsdc
);
776 return jsd_EvaluateUCScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
777 bytes
, length
, filename
, lineno
,
781 JSD_PUBLIC_API(JSBool
)
782 JSD_AttemptUCScriptInStackFrame(JSDContext
* jsdc
,
783 JSDThreadState
* jsdthreadstate
,
784 JSDStackFrameInfo
* jsdframe
,
785 const jschar
*bytes
, unsigned length
,
786 const char *filename
, unsigned lineno
,
789 JSD_ASSERT_VALID_CONTEXT(jsdc
);
795 return jsd_EvaluateUCScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
796 bytes
, length
, filename
, lineno
,
800 JSD_PUBLIC_API(JSBool
)
801 JSD_EvaluateScriptInStackFrame(JSDContext
* jsdc
,
802 JSDThreadState
* jsdthreadstate
,
803 JSDStackFrameInfo
* jsdframe
,
804 const char *bytes
, unsigned length
,
805 const char *filename
, unsigned lineno
, jsval
*rval
)
807 JSD_ASSERT_VALID_CONTEXT(jsdc
);
813 return jsd_EvaluateScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
815 filename
, lineno
, JS_TRUE
, rval
);
818 JSD_PUBLIC_API(JSBool
)
819 JSD_AttemptScriptInStackFrame(JSDContext
* jsdc
,
820 JSDThreadState
* jsdthreadstate
,
821 JSDStackFrameInfo
* jsdframe
,
822 const char *bytes
, unsigned length
,
823 const char *filename
, unsigned lineno
, jsval
*rval
)
825 JSD_ASSERT_VALID_CONTEXT(jsdc
);
831 return jsd_EvaluateScriptInStackFrame(jsdc
, jsdthreadstate
,jsdframe
,
833 filename
, lineno
, JS_FALSE
, rval
);
836 JSD_PUBLIC_API(JSString
*)
837 JSD_ValToStringInStackFrame(JSDContext
* jsdc
,
838 JSDThreadState
* jsdthreadstate
,
839 JSDStackFrameInfo
* jsdframe
,
842 JSD_ASSERT_VALID_CONTEXT(jsdc
);
843 return jsd_ValToStringInStackFrame(jsdc
, jsdthreadstate
, jsdframe
, val
);
846 JSD_PUBLIC_API(JSDValue
*)
847 JSD_GetException(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
)
849 JSD_ASSERT_VALID_CONTEXT(jsdc
);
850 return jsd_GetException(jsdc
, jsdthreadstate
);
853 extern JSD_PUBLIC_API(JSBool
)
854 JSD_SetException(JSDContext
* jsdc
, JSDThreadState
* jsdthreadstate
,
857 JSD_ASSERT_VALID_CONTEXT(jsdc
);
858 return jsd_SetException(jsdc
, jsdthreadstate
, jsdval
);
861 /***************************************************************************/
863 JSD_PUBLIC_API(JSBool
)
864 JSD_SetErrorReporter(JSDContext
* jsdc
,
865 JSD_ErrorReporter reporter
,
868 JSD_ASSERT_VALID_CONTEXT(jsdc
);
869 return jsd_SetErrorReporter(jsdc
, reporter
, callerdata
);
872 JSD_PUBLIC_API(JSBool
)
873 JSD_GetErrorReporter(JSDContext
* jsdc
,
874 JSD_ErrorReporter
* reporter
,
877 JSD_ASSERT_VALID_CONTEXT(jsdc
);
878 return jsd_GetErrorReporter(jsdc
, reporter
, callerdata
);
881 /***************************************************************************/
883 JSD_PUBLIC_API(JSBool
)
884 JSD_IsLockingAndThreadIdSupported()
886 #ifdef JSD_THREADSAFE
893 JSD_PUBLIC_API(JSDStaticLock
*)
896 #ifdef JSD_THREADSAFE
897 return jsd_CreateLock();
904 JSD_Lock(JSDStaticLock
* lock
)
906 #ifdef JSD_THREADSAFE
912 JSD_Unlock(JSDStaticLock
* lock
)
914 #ifdef JSD_THREADSAFE
919 JSD_PUBLIC_API(JSBool
)
920 JSD_IsLocked(JSDStaticLock
* lock
)
922 #if defined(JSD_THREADSAFE) && defined(DEBUG)
923 return jsd_IsLocked(lock
);
929 JSD_PUBLIC_API(JSBool
)
930 JSD_IsUnlocked(JSDStaticLock
* lock
)
932 #if defined(JSD_THREADSAFE) && defined(DEBUG)
933 return ! jsd_IsLocked(lock
);
939 JSD_PUBLIC_API(void*)
942 return JSD_CURRENT_THREAD();
945 /***************************************************************************/
946 /* Value and Property Functions */
948 JSD_PUBLIC_API(JSDValue
*)
949 JSD_NewValue(JSDContext
* jsdc
, jsval val
)
951 JSD_ASSERT_VALID_CONTEXT(jsdc
);
952 return jsd_NewValue(jsdc
, val
);
956 JSD_DropValue(JSDContext
* jsdc
, JSDValue
* jsdval
)
958 JSD_ASSERT_VALID_CONTEXT(jsdc
);
959 JSD_ASSERT_VALID_VALUE(jsdval
);
960 jsd_DropValue(jsdc
, jsdval
);
963 JSD_PUBLIC_API(jsval
)
964 JSD_GetValueWrappedJSVal(JSDContext
* jsdc
, JSDValue
* jsdval
)
966 JSD_ASSERT_VALID_CONTEXT(jsdc
);
967 JSD_ASSERT_VALID_VALUE(jsdval
);
968 return jsd_GetValueWrappedJSVal(jsdc
, jsdval
);
972 JSD_RefreshValue(JSDContext
* jsdc
, JSDValue
* jsdval
)
974 JSD_ASSERT_VALID_CONTEXT(jsdc
);
975 JSD_ASSERT_VALID_VALUE(jsdval
);
976 jsd_RefreshValue(jsdc
, jsdval
);
979 /**************************************************/
981 JSD_PUBLIC_API(JSBool
)
982 JSD_IsValueObject(JSDContext
* jsdc
, JSDValue
* jsdval
)
984 JSD_ASSERT_VALID_CONTEXT(jsdc
);
985 JSD_ASSERT_VALID_VALUE(jsdval
);
986 return jsd_IsValueObject(jsdc
, jsdval
);
989 JSD_PUBLIC_API(JSBool
)
990 JSD_IsValueNumber(JSDContext
* jsdc
, JSDValue
* jsdval
)
992 JSD_ASSERT_VALID_CONTEXT(jsdc
);
993 JSD_ASSERT_VALID_VALUE(jsdval
);
994 return jsd_IsValueNumber(jsdc
, jsdval
);
997 JSD_PUBLIC_API(JSBool
)
998 JSD_IsValueInt(JSDContext
* jsdc
, JSDValue
* jsdval
)
1000 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1001 JSD_ASSERT_VALID_VALUE(jsdval
);
1002 return jsd_IsValueInt(jsdc
, jsdval
);
1005 JSD_PUBLIC_API(JSBool
)
1006 JSD_IsValueDouble(JSDContext
* jsdc
, JSDValue
* jsdval
)
1008 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1009 JSD_ASSERT_VALID_VALUE(jsdval
);
1010 return jsd_IsValueDouble(jsdc
, jsdval
);
1013 JSD_PUBLIC_API(JSBool
)
1014 JSD_IsValueString(JSDContext
* jsdc
, JSDValue
* jsdval
)
1016 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1017 JSD_ASSERT_VALID_VALUE(jsdval
);
1018 return jsd_IsValueString(jsdc
, jsdval
);
1021 JSD_PUBLIC_API(JSBool
)
1022 JSD_IsValueBoolean(JSDContext
* jsdc
, JSDValue
* jsdval
)
1024 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1025 JSD_ASSERT_VALID_VALUE(jsdval
);
1026 return jsd_IsValueBoolean(jsdc
, jsdval
);
1029 JSD_PUBLIC_API(JSBool
)
1030 JSD_IsValueNull(JSDContext
* jsdc
, JSDValue
* jsdval
)
1032 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1033 JSD_ASSERT_VALID_VALUE(jsdval
);
1034 return jsd_IsValueNull(jsdc
, jsdval
);
1037 JSD_PUBLIC_API(JSBool
)
1038 JSD_IsValueVoid(JSDContext
* jsdc
, JSDValue
* jsdval
)
1040 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1041 JSD_ASSERT_VALID_VALUE(jsdval
);
1042 return jsd_IsValueVoid(jsdc
, jsdval
);
1045 JSD_PUBLIC_API(JSBool
)
1046 JSD_IsValuePrimitive(JSDContext
* jsdc
, JSDValue
* jsdval
)
1048 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1049 JSD_ASSERT_VALID_VALUE(jsdval
);
1050 return jsd_IsValuePrimitive(jsdc
, jsdval
);
1053 JSD_PUBLIC_API(JSBool
)
1054 JSD_IsValueFunction(JSDContext
* jsdc
, JSDValue
* jsdval
)
1056 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1057 JSD_ASSERT_VALID_VALUE(jsdval
);
1058 return jsd_IsValueFunction(jsdc
, jsdval
);
1061 JSD_PUBLIC_API(JSBool
)
1062 JSD_IsValueNative(JSDContext
* jsdc
, JSDValue
* jsdval
)
1064 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1065 JSD_ASSERT_VALID_VALUE(jsdval
);
1066 return jsd_IsValueNative(jsdc
, jsdval
);
1069 /**************************************************/
1071 JSD_PUBLIC_API(JSBool
)
1072 JSD_GetValueBoolean(JSDContext
* jsdc
, JSDValue
* jsdval
)
1074 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1075 JSD_ASSERT_VALID_VALUE(jsdval
);
1076 return jsd_GetValueBoolean(jsdc
, jsdval
);
1079 JSD_PUBLIC_API(int32_t)
1080 JSD_GetValueInt(JSDContext
* jsdc
, JSDValue
* jsdval
)
1082 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1083 JSD_ASSERT_VALID_VALUE(jsdval
);
1084 return jsd_GetValueInt(jsdc
, jsdval
);
1087 JSD_PUBLIC_API(double)
1088 JSD_GetValueDouble(JSDContext
* jsdc
, JSDValue
* jsdval
)
1090 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1091 JSD_ASSERT_VALID_VALUE(jsdval
);
1092 return jsd_GetValueDouble(jsdc
, jsdval
);
1095 JSD_PUBLIC_API(JSString
*)
1096 JSD_GetValueString(JSDContext
* jsdc
, JSDValue
* jsdval
)
1098 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1099 JSD_ASSERT_VALID_VALUE(jsdval
);
1100 return jsd_GetValueString(jsdc
, jsdval
);
1103 JSD_PUBLIC_API(JSString
*)
1104 JSD_GetValueFunctionId(JSDContext
* jsdc
, JSDValue
* jsdval
)
1106 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1107 JSD_ASSERT_VALID_VALUE(jsdval
);
1108 return jsd_GetValueFunctionId(jsdc
, jsdval
);
1111 JSD_PUBLIC_API(JSFunction
*)
1112 JSD_GetValueFunction(JSDContext
* jsdc
, JSDValue
* jsdval
)
1114 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1115 JSD_ASSERT_VALID_VALUE(jsdval
);
1116 return jsd_GetValueFunction(jsdc
, jsdval
);
1119 /**************************************************/
1121 JSD_PUBLIC_API(unsigned)
1122 JSD_GetCountOfProperties(JSDContext
* jsdc
, JSDValue
* jsdval
)
1124 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1125 JSD_ASSERT_VALID_VALUE(jsdval
);
1126 return jsd_GetCountOfProperties(jsdc
, jsdval
);
1129 JSD_PUBLIC_API(JSDProperty
*)
1130 JSD_IterateProperties(JSDContext
* jsdc
, JSDValue
* jsdval
, JSDProperty
**iterp
)
1132 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1133 JSD_ASSERT_VALID_VALUE(jsdval
);
1135 return jsd_IterateProperties(jsdc
, jsdval
, iterp
);
1138 JSD_PUBLIC_API(JSDProperty
*)
1139 JSD_GetValueProperty(JSDContext
* jsdc
, JSDValue
* jsdval
, JSString
* name
)
1141 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1142 JSD_ASSERT_VALID_VALUE(jsdval
);
1144 return jsd_GetValueProperty(jsdc
, jsdval
, name
);
1147 JSD_PUBLIC_API(JSDValue
*)
1148 JSD_GetValuePrototype(JSDContext
* jsdc
, JSDValue
* jsdval
)
1150 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1151 JSD_ASSERT_VALID_VALUE(jsdval
);
1152 return jsd_GetValuePrototype(jsdc
, jsdval
);
1155 JSD_PUBLIC_API(JSDValue
*)
1156 JSD_GetValueParent(JSDContext
* jsdc
, JSDValue
* jsdval
)
1158 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1159 JSD_ASSERT_VALID_VALUE(jsdval
);
1160 return jsd_GetValueParent(jsdc
, jsdval
);
1163 JSD_PUBLIC_API(JSDValue
*)
1164 JSD_GetValueConstructor(JSDContext
* jsdc
, JSDValue
* jsdval
)
1166 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1167 JSD_ASSERT_VALID_VALUE(jsdval
);
1168 return jsd_GetValueConstructor(jsdc
, jsdval
);
1171 JSD_PUBLIC_API(const char*)
1172 JSD_GetValueClassName(JSDContext
* jsdc
, JSDValue
* jsdval
)
1174 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1175 JSD_ASSERT_VALID_VALUE(jsdval
);
1176 return jsd_GetValueClassName(jsdc
, jsdval
);
1179 JSD_PUBLIC_API(JSDScript
*)
1180 JSD_GetScriptForValue(JSDContext
* jsdc
, JSDValue
* jsdval
)
1182 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1183 return jsd_GetScriptForValue(jsdc
, jsdval
);
1185 /**************************************************/
1187 JSD_PUBLIC_API(void)
1188 JSD_DropProperty(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1190 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1191 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1192 jsd_DropProperty(jsdc
, jsdprop
);
1196 JSD_PUBLIC_API(JSDValue
*)
1197 JSD_GetPropertyName(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1199 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1200 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1201 return jsd_GetPropertyName(jsdc
, jsdprop
);
1204 JSD_PUBLIC_API(JSDValue
*)
1205 JSD_GetPropertyValue(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1207 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1208 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1209 return jsd_GetPropertyValue(jsdc
, jsdprop
);
1212 JSD_PUBLIC_API(JSDValue
*)
1213 JSD_GetPropertyAlias(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1215 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1216 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1217 return jsd_GetPropertyAlias(jsdc
, jsdprop
);
1220 JSD_PUBLIC_API(unsigned)
1221 JSD_GetPropertyFlags(JSDContext
* jsdc
, JSDProperty
* jsdprop
)
1223 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1224 JSD_ASSERT_VALID_PROPERTY(jsdprop
);
1225 return jsd_GetPropertyFlags(jsdc
, jsdprop
);
1228 /**************************************************/
1229 /* Object Functions */
1231 JSD_PUBLIC_API(void)
1232 JSD_LockObjectSubsystem(JSDContext
* jsdc
)
1234 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1235 JSD_LOCK_OBJECTS(jsdc
);
1238 JSD_PUBLIC_API(void)
1239 JSD_UnlockObjectSubsystem(JSDContext
* jsdc
)
1241 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1242 JSD_UNLOCK_OBJECTS(jsdc
);
1245 JSD_PUBLIC_API(JSDObject
*)
1246 JSD_IterateObjects(JSDContext
* jsdc
, JSDObject
** iterp
)
1248 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1249 return jsd_IterateObjects(jsdc
, iterp
);
1252 JSD_PUBLIC_API(JSObject
*)
1253 JSD_GetWrappedObject(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1255 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1256 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1257 return jsd_GetWrappedObject(jsdc
, jsdobj
);
1261 JSD_PUBLIC_API(const char*)
1262 JSD_GetObjectNewURL(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1264 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1265 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1266 return jsd_GetObjectNewURL(jsdc
, jsdobj
);
1269 JSD_PUBLIC_API(unsigned)
1270 JSD_GetObjectNewLineNumber(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1272 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1273 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1274 return jsd_GetObjectNewLineNumber(jsdc
, jsdobj
);
1277 JSD_PUBLIC_API(const char*)
1278 JSD_GetObjectConstructorURL(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1280 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1281 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1282 return jsd_GetObjectConstructorURL(jsdc
, jsdobj
);
1285 JSD_PUBLIC_API(unsigned)
1286 JSD_GetObjectConstructorLineNumber(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1288 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1289 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1290 return jsd_GetObjectConstructorLineNumber(jsdc
, jsdobj
);
1293 JSD_PUBLIC_API(const char*)
1294 JSD_GetObjectConstructorName(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1296 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1297 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1298 return jsd_GetObjectConstructorName(jsdc
, jsdobj
);
1301 JSD_PUBLIC_API(JSDObject
*)
1302 JSD_GetJSDObjectForJSObject(JSDContext
* jsdc
, JSObject
* jsobj
)
1304 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1306 return jsd_GetJSDObjectForJSObject(jsdc
, jsobj
);
1309 JSD_PUBLIC_API(JSDObject
*)
1310 JSD_GetObjectForValue(JSDContext
* jsdc
, JSDValue
* jsdval
)
1312 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1313 JSD_ASSERT_VALID_VALUE(jsdval
);
1314 return jsd_GetObjectForValue(jsdc
, jsdval
);
1317 JSD_PUBLIC_API(JSDValue
*)
1318 JSD_GetValueForObject(JSDContext
* jsdc
, JSDObject
* jsdobj
)
1320 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1321 JSD_ASSERT_VALID_OBJECT(jsdobj
);
1322 return jsd_GetValueForObject(jsdc
, jsdobj
);
1325 /***************************************************************************/
1326 /* Livewire specific API */
1329 JSD_PUBLIC_API(LWDBGScript
*)
1330 JSDLW_GetLWScript(JSDContext
* jsdc
, JSDScript
* jsdscript
)
1332 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1333 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
1334 return jsdlw_GetLWScript(jsdc
, jsdscript
);
1337 JSD_PUBLIC_API(JSDSourceText
*)
1338 JSDLW_PreLoadSource( JSDContext
* jsdc
, LWDBGApp
* app
,
1339 const char* filename
, JSBool clear
)
1341 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1343 JS_ASSERT(filename
);
1344 return jsdlw_PreLoadSource(jsdc
, app
, filename
, clear
);
1347 JSD_PUBLIC_API(JSDSourceText
*)
1348 JSDLW_ForceLoadSource( JSDContext
* jsdc
, JSDSourceText
* jsdsrc
)
1350 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1351 JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc
);
1352 return jsdlw_ForceLoadSource(jsdc
, jsdsrc
);
1355 JSD_PUBLIC_API(JSBool
)
1356 JSDLW_RawToProcessedLineNumber(JSDContext
* jsdc
, JSDScript
* jsdscript
,
1357 unsigned lineIn
, unsigned* lineOut
)
1359 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1360 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
1361 return jsdlw_RawToProcessedLineNumber(jsdc
, jsdscript
, lineIn
, lineOut
);
1364 JSD_PUBLIC_API(JSBool
)
1365 JSDLW_ProcessedToRawLineNumber(JSDContext
* jsdc
, JSDScript
* jsdscript
,
1366 unsigned lineIn
, unsigned* lineOut
)
1368 JSD_ASSERT_VALID_CONTEXT(jsdc
);
1369 JSD_ASSERT_VALID_SCRIPT(jsdscript
);
1370 return jsdlw_ProcessedToRawLineNumber(jsdc
, jsdscript
, lineIn
, lineOut
);
1374 /***************************************************************************/