From 512acf072e92c4759c84efabbbbbe059e3aa5787 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sun, 27 Nov 2022 22:41:16 -0800 Subject: [PATCH] Add missing v Fixes https://github.com/oven-sh/bun/issues/1554 --- src/bun.js/bindings/Process.cpp | 2 +- test/bun.js/process.test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp index a931321111..2071cfa059 100644 --- a/src/bun.js/bindings/Process.cpp +++ b/src/bun.js/bindings/Process.cpp @@ -348,7 +348,7 @@ void Process::finishCreation(JSC::VM& vm) JSC::JSValue(JSC::jsNumber(0))); this->putDirect(this->vm(), clientData->builtinNames().versionPublicName(), - JSC::jsString(this->vm(), makeAtomString(REPORTED_NODE_VERSION))); + JSC::jsString(this->vm(), makeString("v", 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" diff --git a/test/bun.js/process.test.js b/test/bun.js/process.test.js index e221375d1e..4e79716db5 100644 --- a/test/bun.js/process.test.js +++ b/test/bun.js/process.test.js @@ -87,3 +87,7 @@ it("process.env", () => { delete process.env["LOL SMILE latin1 "]; expect(process.env["LOL SMILE latin1 "]).toBe(undefined); }); + +it("process.version starts with v", () => { + expect(process.version.startsWith("v")).toBeTruthy(); +});