1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef debugger_Script_h
8 #define debugger_Script_h
10 #include "jstypes.h" // for JS_PUBLIC_API
11 #include "NamespaceImports.h" // for Value, HandleObject, CallArgs
12 #include "debugger/Debugger.h" // for DebuggerScriptReferent
13 #include "js/TypeDecls.h" // for Handle
14 #include "vm/NativeObject.h" // for NativeObject
16 class JS_PUBLIC_API JSObject
;
17 struct JSFunctionSpec
;
18 struct JSPropertySpec
;
29 class DebuggerScript
: public NativeObject
{
31 static const JSClass class_
;
40 static NativeObject
* initClass(JSContext
* cx
, Handle
<GlobalObject
*> global
,
41 HandleObject debugCtor
);
42 static DebuggerScript
* create(JSContext
* cx
, HandleObject proto
,
43 Handle
<DebuggerScriptReferent
> referent
,
44 Handle
<NativeObject
*> debugger
);
46 void trace(JSTracer
* trc
);
48 using ReferentVariant
= DebuggerScriptReferent
;
50 inline gc::Cell
* getReferentCell() const;
51 inline js::BaseScript
* getReferentScript() const;
52 inline DebuggerScriptReferent
getReferent() const;
54 void clearReferent() { clearReservedSlotGCThingAsPrivate(SCRIPT_SLOT
); }
56 static DebuggerScript
* check(JSContext
* cx
, HandleValue v
);
58 static bool construct(JSContext
* cx
, unsigned argc
, Value
* vp
);
62 Debugger
* owner() const;
65 static const JSClassOps classOps_
;
67 static const JSPropertySpec properties_
[];
68 static const JSFunctionSpec methods_
[];
70 struct GetLineCountMatcher
;
71 class GetSourceMatcher
;
72 template <bool OnlyOffsets
>
73 class GetPossibleBreakpointsMatcher
;
74 class GetOffsetMetadataMatcher
;
75 class GetOffsetLocationMatcher
;
76 class GetAllColumnOffsetsMatcher
;
77 class GetLineOffsetsMatcher
;
78 struct SetBreakpointMatcher
;
79 class ClearBreakpointMatcher
;
80 class IsInCatchScopeMatcher
;
85 #endif /* debugger_Script_h */