-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds `v8.cachedDataVersionTag()`, which returns an integer representing the version tag for `cachedData` for the current V8 version & flags. PR-URL: #11515 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
require('../common'); | ||
const assert = require('assert'); | ||
const v8 = require('v8'); | ||
|
||
const versionTag1 = v8.cachedDataVersionTag(); | ||
assert.strictEqual(typeof versionTag1, 'number'); | ||
assert.strictEqual(v8.cachedDataVersionTag(), versionTag1); | ||
|
||
// The value of cachedDataVersionTag is derived from the command line flags and | ||
// detected CPU features. Test that the value does indeed update when flags | ||
// are toggled. | ||
v8.setFlagsFromString('--allow_natives_syntax'); | ||
|
||
const versionTag2 = v8.cachedDataVersionTag(); | ||
assert.strictEqual(typeof versionTag2, 'number'); | ||
assert.strictEqual(v8.cachedDataVersionTag(), versionTag2); | ||
|
||
assert.notStrictEqual(versionTag1, versionTag2); |