1'use strict'; 2require('../common'); 3const assert = require('assert'); 4const v8 = require('v8'); 5 6const versionTag1 = v8.cachedDataVersionTag(); 7assert.strictEqual(typeof versionTag1, 'number'); 8assert.strictEqual(v8.cachedDataVersionTag(), versionTag1); 9 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. 13v8.setFlagsFromString('--allow_natives_syntax'); 14 15const versionTag2 = v8.cachedDataVersionTag(); 16assert.strictEqual(typeof versionTag2, 'number'); 17assert.strictEqual(v8.cachedDataVersionTag(), versionTag2); 18 19assert.notStrictEqual(versionTag1, versionTag2); 20