aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bun.js/bindings/Process.cpp31
-rw-r--r--test/bun.js/process.test.js9
2 files changed, 40 insertions, 0 deletions
diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp
index 1511b0302..039489ed1 100644
--- a/src/bun.js/bindings/Process.cpp
+++ b/src/bun.js/bindings/Process.cpp
@@ -668,6 +668,37 @@ void Process::finishCreation(JSC::VM& vm)
this->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(this->vm(), "umask"_s),
1, Process_functionUmask, ImplementationVisibility::Public, NoIntrinsic, 0);
+
+ // target_defaults:
+ // { cflags: [],
+ // default_configuration: 'Release',
+ // defines: [],
+ // include_dirs: [],
+ // libraries: [] },
+ // variables:
+ // {
+ // host_arch: 'x64',
+ // napi_build_version: 5,
+ // node_install_npm: 'true',
+ // node_prefix: '',
+ // node_shared_cares: 'false',
+ // node_shared_http_parser: 'false',
+ // node_shared_libuv: 'false',
+ // node_shared_zlib: 'false',
+ // node_use_openssl: 'true',
+ // node_shared_openssl: 'false',
+ // strict_aliasing: 'true',
+ // target_arch: 'x64',
+ // v8_use_snapshot: 1
+ // }
+ // }
+ JSC::JSObject* config = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 2);
+ JSC::JSObject* variables = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 1);
+ variables->putDirect(vm, JSC::Identifier::fromString(vm, "v8_enable_i8n_support"_s),
+ JSC::jsNumber(1), 0);
+ config->putDirect(vm, JSC::Identifier::fromString(vm, "target_defaults"_s), JSC::constructEmptyObject(globalObject), 0);
+ config->putDirect(vm, JSC::Identifier::fromString(vm, "variables"_s), variables, 0);
+ this->putDirect(vm, JSC::Identifier::fromString(vm, "config"_s), config, 0);
}
const JSC::ClassInfo Process::s_info = { "Process"_s, &Base::s_info, nullptr, nullptr,
diff --git a/test/bun.js/process.test.js b/test/bun.js/process.test.js
index 8ea57a28b..48fc61a7e 100644
--- a/test/bun.js/process.test.js
+++ b/test/bun.js/process.test.js
@@ -167,3 +167,12 @@ it("process.versions", () => {
expect(process.versions[name]).toBe(versions[name]);
}
});
+
+it("process.config", () => {
+ expect(process.config).toEqual({
+ variables: {
+ v8_enable_i8n_support: 1,
+ },
+ target_defaults: {},
+ });
+});