aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/debug-helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/debug-helpers.h')
-rw-r--r--src/bun.js/bindings/debug-helpers.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bun.js/bindings/debug-helpers.h b/src/bun.js/bindings/debug-helpers.h
new file mode 100644
index 000000000..a0fc99868
--- /dev/null
+++ b/src/bun.js/bindings/debug-helpers.h
@@ -0,0 +1,18 @@
+#include "root.h"
+
+#include "JavaScriptCore/InspectorDebuggerAgent.h"
+
+namespace JSC {
+Inspector::InspectorDebuggerAgent* debuggerAgent(JSC::JSGlobalObject* globalObject)
+{
+ if (LIKELY(!globalObject->hasDebugger())) {
+ return nullptr;
+ }
+
+ if (auto* debugger = globalObject->debugger()) {
+ return dynamicDowncast<Inspector::InspectorDebuggerAgent>(debugger->client());
+ }
+
+ return nullptr;
+}
+} \ No newline at end of file