diff options
author | 2022-11-27 22:41:16 -0800 | |
---|---|---|
committer | 2022-11-27 22:41:16 -0800 | |
commit | 512acf072e92c4759c84efabbbbbe059e3aa5787 (patch) | |
tree | 1d6886306052b05a1bca09a5c15020a5251e570e | |
parent | 4ee11d922cb9fb4b97ae07028c409ffba153a1d4 (diff) | |
download | bun-512acf072e92c4759c84efabbbbbe059e3aa5787.tar.gz bun-512acf072e92c4759c84efabbbbbe059e3aa5787.tar.zst bun-512acf072e92c4759c84efabbbbbe059e3aa5787.zip |
Add missing v
Fixes https://github.com/oven-sh/bun/issues/1554
-rw-r--r-- | src/bun.js/bindings/Process.cpp | 2 | ||||
-rw-r--r-- | test/bun.js/process.test.js | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/bun.js/bindings/Process.cpp b/src/bun.js/bindings/Process.cpp index a93132111..2071cfa05 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 e221375d1..4e79716db 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 <abc>"]; expect(process.env["LOL SMILE latin1 <abc>"]).toBe(undefined); }); + +it("process.version starts with v", () => { + expect(process.version.startsWith("v")).toBeTruthy(); +}); |