aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/debug-helpers.h
blob: a0fc9986804ec0a4c09feb7cc4d6eb38d166fa33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}
}