mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
245ec6f5ab
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>
20 lines
711 B
JavaScript
20 lines
711 B
JavaScript
'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 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');
|
|
|
|
const versionTag2 = v8.cachedDataVersionTag();
|
|
assert.strictEqual(typeof versionTag2, 'number');
|
|
assert.strictEqual(v8.cachedDataVersionTag(), versionTag2);
|
|
|
|
assert.notStrictEqual(versionTag1, versionTag2);
|