diff options
author | 2023-04-01 21:13:27 -0700 | |
---|---|---|
committer | 2023-04-01 21:13:27 -0700 | |
commit | fcd8b828644cc3cf2bd46bbfc0f6b90789d5dba2 (patch) | |
tree | 075ad9fc3375a56b71da4ce6625419e5dd10cdba /src/bun.js/bindings/Process.cpp | |
parent | 63d138b0466765e012aaa216ab684b2d39888e64 (diff) | |
download | bun-fcd8b828644cc3cf2bd46bbfc0f6b90789d5dba2.tar.gz bun-fcd8b828644cc3cf2bd46bbfc0f6b90789d5dba2.tar.zst bun-fcd8b828644cc3cf2bd46bbfc0f6b90789d5dba2.zip |
Add stubs for missing node builtins (#2534)
* Stub `node:v8`
* Stub `node:trace_events`
* Stub `node:repl`
* Stub `node:inspector`
* Stub `node:http2`
* Stub `node:diagnostics_channel`
* Stub `node:dgram`
* Stub `node:cluster`
* Link stubs
* cleanup
* Clean up the test
* Implement `node:vm` stub
* Cleanup `v8` module stub
* Add missing `promises` export to node:stream
* Implement `node:stream/promise`
* Implement `node:assert/strict`
* cleanup
* better errors
* Increaase timeout
* Update inspector.exports.js
* Make the version consistent
* Implement `process.binding("constants")`
* Update runner.node.mjs
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/Process.cpp')
-rw-r--r-- | src/bun.js/bindings/Process.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp index d336d5874..6be74ec6d 100644 --- a/src/bun.js/bindings/Process.cpp +++ b/src/bun.js/bindings/Process.cpp @@ -14,7 +14,7 @@ namespace Zig { using namespace JSC; -#define REPORTED_NODE_VERSION "18.13.0" +#define REPORTED_NODE_VERSION "18.15.0" using JSGlobalObject = JSC::JSGlobalObject; using Exception = JSC::Exception; @@ -308,15 +308,6 @@ 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)) { @@ -733,8 +724,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); + this->putDirectBuiltinFunction(vm, globalObject, JSC::Identifier::fromString(this->vm(), "binding"_s), + processObjectInternalsBindingCodeGenerator(vm), + 0); this->putDirect(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, String("process"_s)), 0); @@ -946,4 +938,4 @@ static JSC_DEFINE_HOST_FUNCTION(Process_functionCwd, return JSC::JSValue::encode(result); } -} // namespace Zig
\ No newline at end of file +} // namespace Zig |