GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc,test: update v8 method doc and comment · nodejs/node@be79250

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • v8.md
  • test/parallel
    • test-v8-version-tag.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/v8.md‎

Copy file name to clipboardExpand all lines: doc/api/v8.md
+11-2Lines changed: 11 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@ added: v8.0.0
1818

1919
* Returns: {integer}
2020

21-
Returns an integer representing a "version tag" derived from the V8 version,
22-
command-line flags and detected CPU features. This is useful for determining
21+
Returns an integer representing a version tag derived from the V8 version,
22+
command-line flags, and detected CPU features. This is useful for determining
2323
whether a [`vm.Script`][] `cachedData` buffer is compatible with this instance
2424
of V8.
2525

26+
```js
27+
console.log(v8.cachedDataVersionTag()); // 3947234607
28+
// The value returned by v8.cachedDataVersionTag() is derived from the V8
29+
// version, command-line flags, and detected CPU features. Test that the value
30+
// does indeed update when flags are toggled.
31+
v8.setFlagsFromString('--allow_natives_syntax');
32+
console.log(v8.cachedDataVersionTag()); // 183726201
33+
```
34+
2635
## `v8.getHeapSpaceStatistics()`
2736
<!-- YAML
2837
added: v6.0.0
Collapse file

‎test/parallel/test-v8-version-tag.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-v8-version-tag.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const versionTag1 = v8.cachedDataVersionTag();
77
assert.strictEqual(typeof versionTag1, 'number');
88
assert.strictEqual(v8.cachedDataVersionTag(), versionTag1);
99

10-
// The value of cachedDataVersionTag is derived from the command line flags and
11-
// detected CPU features. Test that the value does indeed update when flags
12-
// are toggled.
10+
// The value returned by v8.cachedDataVersionTag() is derived from the V8
11+
// version, command-line flags, and detected CPU features. Test that the value
12+
// does indeed update when flags are toggled.
1313
v8.setFlagsFromString('--allow_natives_syntax');
1414

1515
const versionTag2 = v8.cachedDataVersionTag();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.