forked from dop251/goja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain.go
407 lines (342 loc) · 15.3 KB
/
domain.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
package runtime
type ScriptId string
type RemoteObjectId string
type UnserializableValue string
const (
UnserializableValueInfinity UnserializableValue = "Infinity"
UnserializableValueNaN UnserializableValue = "NaN"
UnserializableValueNegativeInfinity UnserializableValue = "-Infinity"
UnserializableValueNegativeZero UnserializableValue = "-0"
)
type RemoteObjectType string
const (
RemoteObjectTypeObject RemoteObjectType = "object"
RemoteObjectTypeFunction RemoteObjectType = "function"
RemoteObjectTypeUndefined RemoteObjectType = "undefined"
RemoteObjectTypeString RemoteObjectType = "string"
RemoteObjectTypeNumber RemoteObjectType = "number"
RemoteObjectTypeBoolean RemoteObjectType = "boolean"
RemoteObjectTypeSymbol RemoteObjectType = "symbol"
)
type RemoteObjectSubtype string
const (
RemoteObjectSubtypeArray RemoteObjectSubtype = "array"
RemoteObjectSubtypeNull RemoteObjectSubtype = "null"
RemoteObjectSubtypeNode RemoteObjectSubtype = "node"
RemoteObjectSubtypeRegexp RemoteObjectSubtype = "regexp"
RemoteObjectSubtypeDate RemoteObjectSubtype = "date"
RemoteObjectSubtypeMap RemoteObjectSubtype = "map"
RemoteObjectSubtypeSet RemoteObjectSubtype = "set"
RemoteObjectSubtypeWeakmap RemoteObjectSubtype = "weakmap"
RemoteObjectSubtypeWeakset RemoteObjectSubtype = "weakset"
RemoteObjectSubtypeIterator RemoteObjectSubtype = "iterator"
RemoteObjectSubtypeGenerator RemoteObjectSubtype = "generator"
RemoteObjectSubtypeError RemoteObjectSubtype = "error"
RemoteObjectSubtypeProxy RemoteObjectSubtype = "proxy"
RemoteObjectSubtypePromise RemoteObjectSubtype = "promise"
RemoteObjectSubtypeTypedArray RemoteObjectSubtype = "typedarray"
)
type RemoteObject struct {
Type *RemoteObjectType `json:"type"`
Subtype *RemoteObjectSubtype `json:"subtype"`
ClassName string `json:"className"`
Value interface{} `json:"value"`
UnserializableValue *UnserializableValue `json:"unserializableValue"`
Description string `json:"description"`
ObjectId *RemoteObjectId `json:"objectId"`
Preview *ObjectPreview `json:"preview"`
CustomPreview *CustomPreview `json:"customPreview"`
}
type CustomPreview struct {
Header string `json:"header"`
HasBody bool `json:"hasBody"`
FormatterObjectId *RemoteObjectId `json:"formatterObjectId"`
BindRemoteObjectFunctionId *RemoteObjectId `json:"bindRemoteObjectFunctionId"`
ConfigObjectId *RemoteObjectId `json:"configObjectId"`
}
type ObjectPreviewType string
const (
ObjectPreviewTypeObject ObjectPreviewType = "object"
ObjectPreviewTypeFunction ObjectPreviewType = "function"
ObjectPreviewTypeUndefined ObjectPreviewType = "undefined"
ObjectPreviewTypeString ObjectPreviewType = "string"
ObjectPreviewTypeNumber ObjectPreviewType = "number"
ObjectPreviewTypeBoolean ObjectPreviewType = "boolean"
ObjectPreviewTypeSymbol ObjectPreviewType = "symbol"
)
type ObjectPreviewSubtype string
const (
ObjectPreviewSubtypeArray ObjectPreviewSubtype = "array"
ObjectPreviewSubtypeNull ObjectPreviewSubtype = "null"
ObjectPreviewSubtypeNode ObjectPreviewSubtype = "node"
ObjectPreviewSubtypeRegexp ObjectPreviewSubtype = "regexp"
ObjectPreviewSubtypeDate ObjectPreviewSubtype = "date"
ObjectPreviewSubtypeMap ObjectPreviewSubtype = "map"
ObjectPreviewSubtypeSet ObjectPreviewSubtype = "set"
ObjectPreviewSubtypeWeakmap ObjectPreviewSubtype = "weakmap"
ObjectPreviewSubtypeWeakset ObjectPreviewSubtype = "weakset"
ObjectPreviewSubtypeIterator ObjectPreviewSubtype = "iterator"
ObjectPreviewSubtypeGenerator ObjectPreviewSubtype = "generator"
ObjectPreviewSubtypeError ObjectPreviewSubtype = "error"
)
type ObjectPreview struct {
Type *ObjectPreviewType `json:"type"`
Subtype *ObjectPreviewSubtype `json:"subtype"`
Description string `json:"description"`
Overflow bool `json:"overflow"`
Properties *PropertyPreview `json:"properties"`
Entries *EntryPreview `json:"entries"`
}
type PropertyPreviewType string
const (
PropertyPreviewTypeObject PropertyPreviewType = "object"
PropertyPreviewTypeFunction PropertyPreviewType = "function"
PropertyPreviewTypeUndefined PropertyPreviewType = "undefined"
PropertyPreviewTypeString PropertyPreviewType = "string"
PropertyPreviewTypeNumber PropertyPreviewType = "number"
PropertyPreviewTypeBoolean PropertyPreviewType = "boolean"
PropertyPreviewTypeSymbol PropertyPreviewType = "symbol"
PropertyPreviewTypeAccessor PropertyPreviewType = "accessor"
)
type PropertyPreviewSubtype string
const (
PropertyPreviewSubtypeArray PropertyPreviewSubtype = "array"
PropertyPreviewSubtypeNull PropertyPreviewSubtype = "null"
PropertyPreviewSubtypeNode PropertyPreviewSubtype = "node"
PropertyPreviewSubtypeRegexp PropertyPreviewSubtype = "regexp"
PropertyPreviewSubtypeDate PropertyPreviewSubtype = "date"
PropertyPreviewSubtypeMap PropertyPreviewSubtype = "map"
PropertyPreviewSubtypeSet PropertyPreviewSubtype = "set"
PropertyPreviewSubtypeWeakmap PropertyPreviewSubtype = "weakmap"
PropertyPreviewSubtypeWeakset PropertyPreviewSubtype = "weakset"
PropertyPreviewSubtypeIterator PropertyPreviewSubtype = "iterator"
PropertyPreviewSubtypeGenerator PropertyPreviewSubtype = "generator"
PropertyPreviewSubtypeError PropertyPreviewSubtype = "error"
)
type PropertyPreview struct {
Name string `json:"name"`
Type *PropertyPreviewType `json:"type"`
Value string `json:"value"`
ValuePreview *ObjectPreview `json:"valuePreview"`
Subtype *PropertyPreviewSubtype `json:"subtype"`
}
type EntryPreview struct {
Key *ObjectPreview `json:"key"`
Value *ObjectPreview `json:"value"`
}
type PropertyDescriptor struct {
Name string `json:"name"`
Value *RemoteObject `json:"value"`
Writable bool `json:"writable"`
Get *RemoteObject `json:"get"`
Set *RemoteObject `json:"set"`
Configurable bool `json:"configurable"`
Enumerable bool `json:"enumerable"`
WasThrown bool `json:"wasThrown"`
IsOwn bool `json:"isOwn"`
Symbol *RemoteObject `json:"symbol"`
}
type InternalPropertyDescriptor struct {
Name string `json:"name"`
Value *RemoteObject `json:"value"`
}
type CallArgument struct {
Value interface{} `json:"value"`
UnserializableValue *UnserializableValue `json:"unserializableValue"`
ObjectId *RemoteObjectId `json:"objectId"`
}
type ExecutionContextId int
type ExecutionContextDescription struct {
Id *ExecutionContextId `json:"id"`
Origin string `json:"origin"`
Name string `json:"name"`
AuxData interface{} `json:"auxData"`
}
type ExceptionDetails struct {
ExceptionId int `json:"exceptionId"`
Text string `json:"text"`
LineNumber int `json:"lineNumber"`
ColumnNumber int `json:"columnNumber"`
ScriptId *ScriptId `json:"scriptId"`
Url string `json:"url"`
StackTrace *StackTrace `json:"stackTrace"`
Exception *RemoteObject `json:"exception"`
ExecutionContextId *ExecutionContextId `json:"executionContextId"`
}
type Timestamp int64
type CallFrame struct {
FunctionName string `json:"functionName"`
ScriptId *ScriptId `json:"scriptId"`
Url string `json:"url"`
LineNumber int `json:"lineNumber"`
ColumnNumber int `json:"columnNumber"`
}
type StackTrace struct {
Description string `json:"description"`
CallFrames []*CallFrame `json:"callFrames"`
Parent *StackTrace `json:"parent"`
ParentId *StackTraceId `json:"parentId"`
}
type UniqueDebuggerId string
type StackTraceId struct {
Id string `json:"id"`
DebuggerId *UniqueDebuggerId `json:"debuggerId"`
}
type TargetCallFramesType string
const (
TargetCallFramesTypeAny TargetCallFramesType = "any"
TargetCallFramesTypeCurrent TargetCallFramesType = "current"
)
type CommandAwaitPromise struct {
PromiseObjectId *RemoteObjectId `json:"promiseObjectId"`
ReturnByValue bool `json:"returnByValue"`
GeneratePreview bool `json:"generatePreview"`
}
type ResponseAwaitPromise struct {
Result *RemoteObject `json:"result"`
ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}
type CommandCallFunctionOn struct {
FunctionDeclaration string `json:"functionDeclaration"`
ObjectId *RemoteObjectId `json:"objectId"`
Arguments []*CallArgument `json:"arguments"`
Silent bool `json:"silent"`
ReturnByValue bool `json:"returnByValue"`
GeneratePreview bool `json:"generatePreview"`
UserGesture bool `json:"userGesture"`
AwaitPromise bool `json:"awaitPromise"`
ExecutionContextId *ExecutionContextId `json:"executionContextId"`
ObjectGroup string `json:"objectGroup"`
}
type ResponseCallFunctionOn struct {
Result *RemoteObject `json:"result"`
ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}
type CommandCompileScript struct {
Expression string `json:"expression"`
SourceURL string `json:"sourceURL"`
PersistScript bool `json:"persistScript"`
ExecutionContextId *ExecutionContextId `json:"executionContextId"`
}
type ResponseCompileScript struct {
ScriptId *ScriptId `json:"scriptId"`
ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}
type CommandRuntimeDisable struct {
}
type CommandDiscardConsoleEntries struct {
}
type CommandRuntimeEnable struct {
}
type CommandEvaluate struct {
Expression string `json:"expression"`
ObjectGroup string `json:"objectGroup"`
IncludeCommandLineAPI bool `json:"includeCommandLineAPI"`
Silent bool `json:"silent"`
ContextId *ExecutionContextId `json:"contextId"`
ReturnByValue bool `json:"returnByValue"`
GeneratePreview bool `json:"generatePreview"`
UserGesture bool `json:"userGesture"`
AwaitPromise bool `json:"awaitPromise"`
}
type ResponseEvaluate struct {
Result *RemoteObject `json:"result"`
ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}
type CommandGetProperties struct {
ObjectId *RemoteObjectId `json:"objectId"`
OwnProperties bool `json:"ownProperties"`
AccessorPropertiesOnly bool `json:"accessorPropertiesOnly"`
GeneratePreview bool `json:"generatePreview"`
}
type ResponseGetProperties struct {
Result *PropertyDescriptor `json:"result"`
InternalProperties *InternalPropertyDescriptor `json:"internalProperties"`
ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}
type CommandGlobalLexicalScopeNames struct {
ExecutionContextId *ExecutionContextId `json:"executionContextId"`
}
type ResponseGlobalLexicalScopeNames struct {
Names []string `json:"names"`
}
type CommandQueryObjects struct {
PrototypeObjectId *RemoteObjectId `json:"prototypeObjectId"`
}
type ResponseQueryObjects struct {
Objects *RemoteObject `json:"objects"`
}
type CommandReleaseObject struct {
ObjectId *RemoteObjectId `json:"objectId"`
}
type CommandReleaseObjectGroup struct {
ObjectGroup string `json:"objectGroup"`
}
type CommandRunIfWaitingForDebugger struct {
}
type CommandRunScript struct {
ScriptId *ScriptId `json:"scriptId"`
ExecutionContextId *ExecutionContextId `json:"executionContextId"`
ObjectGroup string `json:"objectGroup"`
Silent bool `json:"silent"`
IncludeCommandLineAPI bool `json:"includeCommandLineAPI"`
ReturnByValue bool `json:"returnByValue"`
GeneratePreview bool `json:"generatePreview"`
AwaitPromise bool `json:"awaitPromise"`
}
type ResponseRunScript struct {
Result *RemoteObject `json:"result"`
ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}
type CommandSetCustomObjectFormatterEnabled struct {
Enabled bool `json:"enabled"`
}
type EventConsoleAPICalledType string
const (
EventConsoleAPICalledTypeLog EventConsoleAPICalledType = "log"
EventConsoleAPICalledTypeDebug EventConsoleAPICalledType = "debug"
EventConsoleAPICalledTypeInfo EventConsoleAPICalledType = "info"
EventConsoleAPICalledTypeError EventConsoleAPICalledType = "error"
EventConsoleAPICalledTypeWarning EventConsoleAPICalledType = "warning"
EventConsoleAPICalledTypeDir EventConsoleAPICalledType = "dir"
EventConsoleAPICalledTypeDirXml EventConsoleAPICalledType = "dirxml"
EventConsoleAPICalledTypeTable EventConsoleAPICalledType = "table"
EventConsoleAPICalledTypeTrace EventConsoleAPICalledType = "trace"
EventConsoleAPICalledTypeClear EventConsoleAPICalledType = "clear"
EventConsoleAPICalledTypeStartGroup EventConsoleAPICalledType = "startGroup"
EventConsoleAPICalledTypeStartGroupCollapsed EventConsoleAPICalledType = "startGroupCollapsed"
EventConsoleAPICalledTypeEndGroup EventConsoleAPICalledType = "endGroup"
EventConsoleAPICalledTypeAssert EventConsoleAPICalledType = "assert"
EventConsoleAPICalledTypeProfile EventConsoleAPICalledType = "profile"
EventConsoleAPICalledTypeProfileEnd EventConsoleAPICalledType = "profileEnd"
EventConsoleAPICalledTypeCount EventConsoleAPICalledType = "count"
EventConsoleAPICalledTypeTimeEnd EventConsoleAPICalledType = "timeEnd"
)
type EventConsoleAPICalled struct {
Type *EventConsoleAPICalledType `json:"type"`
Args []*RemoteObject `json:"args"`
ExecutionContextId *ExecutionContextId `json:"executionContextId"`
Timestamp *Timestamp `json:"timestamp"`
StackTrace *StackTrace `json:"stackTrace"`
Context string `json:"context"`
}
type EventExceptionRevoked struct {
Reason string `json:"reason"`
ExceptionId int `json:"exceptionId"`
}
type EventExceptionThrown struct {
Timestamp *Timestamp `json:"timestamp"`
ExceptionDetails *ExceptionDetails `json:"exceptionDetails"`
}
type EventExecutionContextCreated struct {
Context *ExecutionContextDescription `json:"context"`
}
type EventExecutionContextDestroyed struct {
ExecutionContextId *ExecutionContextId `json:"executionContextId"`
}
type EventExecutionContextsCleared struct {
}
type EventInspectRequested struct {
Object *RemoteObject `json:"object"`
Hints interface{} `json:"hints"`
}