diff options
Diffstat (limited to 'src/bun.js/bindings/Process.cpp')
-rw-r--r-- | src/bun.js/bindings/Process.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp index bce4db8a6..7b9154211 100644 --- a/src/bun.js/bindings/Process.cpp +++ b/src/bun.js/bindings/Process.cpp @@ -308,6 +308,15 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionUptime, return JSC::JSValue::encode(JSC::jsNumber(result)); } +JSC_DEFINE_HOST_FUNCTION(Process_functionBinding, + (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) +{ + auto scope = DECLARE_THROW_SCOPE(globalObject->vm()); + auto& vm = globalObject->vm(); + throwTypeError(globalObject, scope, "process.binding is not supported in Bun. If this breaks a library you're using, please file an issue at https://bun.sh/issues and include a reproducible code sample."_s); + return JSC::JSValue::encode(JSC::JSValue {}); +} + JSC_DEFINE_HOST_FUNCTION(Process_functionExit, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) { @@ -724,6 +733,9 @@ void Process::finishCreation(JSC::VM& vm) this->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(this->vm(), "umask"_s), 1, Process_functionUmask, ImplementationVisibility::Public, NoIntrinsic, 0); + this->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(this->vm(), "binding"_s), + 1, Process_functionBinding, ImplementationVisibility::Public, NoIntrinsic, PropertyAttribute::DontEnum | 0); + // target_defaults: // { cflags: [], // default_configuration: 'Release', |