From d5fb80b44de218d3ce51e15d72dff5b32933d814 Mon Sep 17 00:00:00 2001 From: saibing Date: Wed, 25 Oct 2023 22:12:29 +0800 Subject: [PATCH] Create debugger_const.go --- debugger_const.go | 125 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 debugger_const.go diff --git a/debugger_const.go b/debugger_const.go new file mode 100644 index 00000000..49bfd259 --- /dev/null +++ b/debugger_const.go @@ -0,0 +1,125 @@ +package goja + +import "errors" + +type StepState int + +const ( + DebuggerInit StepState = 0 + DebuggerStep = 1 + DebuggerStepIn = 2 + DebuggerStepOut = 3 + DebuggerStepContinue = 4 + DebuggerStepStop = 5 +) + +type MessageKeyType = string + +const ( + TypeKey MessageKeyType = "type" + EventKey = "event" + RequestKey = "request" + ReasonKey = "reason" + ThreadKey = "thread" + PathKey = "path" + DirtyKey = "dirty" + BreakpointsKey = "breakpoints" + CommandKey = "command" + ArgsKey = "args" + ExpressionKey = "expression" + ResultKey = "result" + LineKey = "line" + ColumnKey = "column" + VariablesReferenceKey = "variablesReference" + ResponseKey = "response" + BodyKey = "body" + RequestSeqKey = "request_seq" + FrameIDKey = "frameId" +) + +const ( + EventType = "event" + ResponseType = "response" +) + +type CommandType = string + +const ( + ContinueCommand CommandType = "continue" + PauseCommand = "pause" + NextCommand = "next" + StepIntoCommand = "stepInto" + StepInCommand = "stepIn" + StepOutCommand = "stepOut" + EvaluateCommand = "evaluate" + StackTraceCommand = "stackTrace" + ScopesCommand = "scopes" + VariablesCommand = "variables" + StopCommand = "stop" +) + +type MessageType = string + +const ( + RequestMessage MessageType = "request" + ContinueMessage = "continue" + BreakpointsMessage = "breakpoints" + StopOnExceptionType = "stopOnException" +) + +type EventReasonType = string + +const ( + StepInReason EventReasonType = "stepIn" + StepOutReason = "stepOut" + BreakpointReason = "breakpoint" + StepReason = "step" + EntryReason = "entry" + PauseReason = "pause" +) + +const ( + TerminatedEvent = "terminated" + StoppedEvent = "StoppedEvent" +) + +const ( + stackID = "id" + stackName = "name" + stackFilename = "filename" + stackLine = "line" +) + +const ( + scopeName = "name" + scopeReference = "reference" + scopeExpensive = "expensive" + + localScope = "Local" + globalScope = "Global" + closureScope = "Closure" +) + +const ( + filterKey = "filter" + indexedKey = "indexed" + startKey = "start" + countKey = "count" +) + +const ( + variableNameKey = "name" + variableValueKey = "value" + indexedVariablesKey = "indexedVariables" +) + +const ( + undefinedType = "undefined" + stringType = "string" + integerType = "integer" + booleanType = "boolean" + floatType = "float" + objectType = "object" +) + +var errDebugCanceled = errors.New("debugger is canceled by client")