File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff 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
2323whether a [ ` vm.Script ` ] [ ] ` cachedData ` buffer is compatible with this instance
2424of 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
2837added: v6.0.0
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ const versionTag1 = v8.cachedDataVersionTag();
77assert . strictEqual ( typeof versionTag1 , 'number' ) ;
88assert . 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.
1313v8 . setFlagsFromString ( '--allow_natives_syntax' ) ;
1414
1515const versionTag2 = v8 . cachedDataVersionTag ( ) ;
You can’t perform that action at this time.
0 commit comments