From c1219a3b489375b48f3ab2067a0bd463f33da66e Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Wed, 5 Oct 2022 17:59:16 -0700 Subject: [breaking] `process.version` lies and reports Node 18 See https://twitter.com/jarredsumner/status/1577189928294789122 --- src/bun.js/bindings/Process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bun.js/bindings/Process.cpp') diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp index b4297edab..7baba4833 100644 --- a/src/bun.js/bindings/Process.cpp +++ b/src/bun.js/bindings/Process.cpp @@ -330,7 +330,7 @@ void Process::finishCreation(JSC::VM& vm) JSC::JSValue(JSC::jsNumber(0))); this->putDirect(this->vm(), clientData->builtinNames().versionPublicName(), - JSC::jsString(this->vm(), makeAtomString(Bun__version))); + JSC::jsString(this->vm(), makeAtomString(REPORTED_NODE_VERSION))); // this gives some way of identifying at runtime whether the SSR is happening in node or not. // this should probably be renamed to what the name of the bundler is, instead of "notNodeJS" @@ -470,7 +470,7 @@ JSC_DEFINE_CUSTOM_GETTER(Process_getVersionsLazy, JSC::JSObject* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype(), 9); object->putDirect(vm, JSC::Identifier::fromString(vm, "node"_s), - JSC::JSValue(JSC::jsString(vm, makeAtomString("16.14.0")))); + JSC::JSValue(JSC::jsOwnedString(vm, makeAtomString(REPORTED_NODE_VERSION)))); object->putDirect( vm, JSC::Identifier::fromString(vm, "bun"_s), JSC::JSValue(JSC::jsString(vm, makeAtomString(Bun__version + 1 /* prefix with v */)))); -- cgit v1.2.3