diff options
author | 2022-08-18 00:22:24 -0700 | |
---|---|---|
committer | 2022-08-18 00:22:24 -0700 | |
commit | 5de8271181985751f8fc04b6fd9fd4be4c457d1e (patch) | |
tree | acf6e1d0f5493acdf3dd47729e99bc2102d28e88 /src/bun.js/bindings/BunJSCModule.cpp | |
parent | f4ff5ecbdf653a11e48943628b8bc363cbb44680 (diff) | |
download | bun-5de8271181985751f8fc04b6fd9fd4be4c457d1e.tar.gz bun-5de8271181985751f8fc04b6fd9fd4be4c457d1e.tar.zst bun-5de8271181985751f8fc04b6fd9fd4be4c457d1e.zip |
Handle builds with remote inspector disabled
Diffstat (limited to 'src/bun.js/bindings/BunJSCModule.cpp')
-rw-r--r-- | src/bun.js/bindings/BunJSCModule.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bun.js/bindings/BunJSCModule.cpp b/src/bun.js/bindings/BunJSCModule.cpp index 0515605e1..38e9b5618 100644 --- a/src/bun.js/bindings/BunJSCModule.cpp +++ b/src/bun.js/bindings/BunJSCModule.cpp @@ -10,7 +10,6 @@ #include "JavaScriptCore/APICast.h" #include "JavaScriptCore/JSBasePrivate.h" #include "JavaScriptCore/ObjectConstructor.h" -#include "JavaScriptCore/RemoteInspectorServer.h" #include "JavaScriptCore/AggregateError.h" #include "JavaScriptCore/BytecodeIndex.h" #include "JavaScriptCore/CallFrameInlines.h" @@ -25,6 +24,10 @@ #include "JavaScriptCore/DeferTermination.h" #include "JavaScriptCore/VMTrapsInlines.h" +#if ENABLE(REMOTE_INSPECTOR) +#include "JavaScriptCore/RemoteInspectorServer.h" +#endif + #include "mimalloc.h" using namespace JSC; @@ -33,7 +36,7 @@ using namespace WTF; JSC_DECLARE_HOST_FUNCTION(functionStartRemoteDebugger); JSC_DEFINE_HOST_FUNCTION(functionStartRemoteDebugger, (JSGlobalObject * globalObject, CallFrame* callFrame)) { - +#if ENABLE(REMOTE_INSPECTOR) static const char* defaultHost = "127.0.0.1\0"; static uint16_t defaultPort = 9230; // node + 1 auto& vm = globalObject->vm(); @@ -73,6 +76,12 @@ JSC_DEFINE_HOST_FUNCTION(functionStartRemoteDebugger, (JSGlobalObject * globalOb } RELEASE_AND_RETURN(scope, JSC::JSValue::encode(JSC::jsUndefined())); +#else + auto& vm = globalObject->vm(); + auto scope = DECLARE_THROW_SCOPE(vm); + throwVMError(globalObject, scope, createTypeError(globalObject, "Remote inspector is not enabled in this build of Bun"_s)); + return JSC::JSValue::encode(JSC::jsUndefined()); +#endif } JSC_DECLARE_HOST_FUNCTION(functionDescribe); |