diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-09-29 14:39:26 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-10-18 19:18:32 +0300 |
commit | 70832bc3538d8b4e1c67ce8c49617c6e06fe3187 (patch) | |
tree | 5ce0156d61d7ac247914febe0db7a73f1a35f4f0 /lib/internal/v8_prof_polyfill.js | |
parent | acb9b8f73ce17292fce43a1bc376311accd0e937 (diff) |
build: add V8 embedder version string
After this commit, `process.versions.v8` will look like:
"6.0.287.53-node.0".
The goal is that everytime we apply a non-official patch to `deps/v8`,
we increment our own number instead of V8's patch level.
This number must be set back to 0 after major V8 updates.
Fixes: https://github.com/nodejs/node/issues/15698
PR-URL: https://github.com/nodejs/node/pull/15785
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'lib/internal/v8_prof_polyfill.js')
-rw-r--r-- | lib/internal/v8_prof_polyfill.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js index e77f1f76bcb..1c9ba4ebc54 100644 --- a/lib/internal/v8_prof_polyfill.js +++ b/lib/internal/v8_prof_polyfill.js @@ -82,14 +82,16 @@ function readline() { } function versionCheck() { - // v8-version looks like "v8-version,$major,$minor,$build,$patch,$candidate" - // whereas process.versions.v8 is either "$major.$minor.$build" or - // "$major.$minor.$build.$patch". + // v8-version looks like + // "v8-version,$major,$minor,$build,$patch[,$embedder],$candidate" + // whereas process.versions.v8 is either "$major.$minor.$build-$embedder" or + // "$major.$minor.$build.$patch-$embedder". var firstLine = readline(); line = firstLine + '\n' + line; firstLine = firstLine.split(','); - const curVer = process.versions.v8.split('.'); - if (firstLine.length !== 6 && firstLine[0] !== 'v8-version') { + const curVer = process.versions.v8.split(/\.-/); + if (firstLine.length !== 6 && firstLine.length !== 7 || + firstLine[0] !== 'v8-version') { console.log('Unable to read v8-version from log file.'); return; } |