diff options
author | Rich Trott <rtrott@gmail.com> | 2020-10-25 15:55:34 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-10-27 16:18:26 +0300 |
commit | 245ec6f5abebac189d442c872b43ee9a5e37ab5a (patch) | |
tree | d292d2e24a951abddbec76f308d9c2f147f5d3d5 /doc/api/v8.md | |
parent | 34810e0141b36e4fc8b3f36e2a87382d5815e399 (diff) |
doc,test: update v8 method doc and comment
Update documentation and test comment for v8.cachedDataVersionTag().
PR-URL: https://github.com/nodejs/node/pull/35795
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'doc/api/v8.md')
-rw-r--r-- | doc/api/v8.md | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/api/v8.md b/doc/api/v8.md index e0b2039264b..4f72b16e017 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -18,11 +18,20 @@ added: v8.0.0 * Returns: {integer} -Returns an integer representing a "version tag" derived from the V8 version, -command-line flags and detected CPU features. This is useful for determining +Returns an integer representing a version tag derived from the V8 version, +command-line flags, and detected CPU features. This is useful for determining whether a [`vm.Script`][] `cachedData` buffer is compatible with this instance of V8. +```js +console.log(v8.cachedDataVersionTag()); // 3947234607 +// The value returned by v8.cachedDataVersionTag() is derived from the V8 +// version, command-line flags, and detected CPU features. Test that the value +// does indeed update when flags are toggled. +v8.setFlagsFromString('--allow_natives_syntax'); +console.log(v8.cachedDataVersionTag()); // 183726201 +``` + ## `v8.getHeapSpaceStatistics()` <!-- YAML added: v6.0.0 |