| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 426ca26 commit d651c7d
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + // Tests that the minimum ICU version for Node.js is at least the minimum ICU | ||
| 4 | + // version for V8. | ||
| 5 | + | ||
| 6 | + require('../common'); | ||
| 7 | + const assert = require('assert'); | ||
| 8 | + const path = require('path'); | ||
| 9 | + const { readFileSync } = require('fs'); | ||
| 10 | + | ||
| 11 | + const srcRoot = path.join(__dirname, '..', '..'); | ||
| 12 | + const icuVersionsFile = path.join(srcRoot, 'tools', 'icu', 'icu_versions.json'); | ||
| 13 | + const { minimum_icu: minimumICU } = require(icuVersionsFile); | ||
| 14 | + const v8SrcFile = path.join(srcRoot, | ||
| 15 | + 'deps', 'v8', 'src', 'objects', 'intl-objects.h'); | ||
| 16 | + const v8Src = readFileSync(v8SrcFile, { encoding: 'utf8' }); | ||
| 17 | + const v8MinimumICU = v8Src.match(/#define\s+V8_MINIMUM_ICU_VERSION\s+(\d+)/)[1]; | ||
| 18 | + assert.ok(minimumICU >= Number(v8MinimumICU), | ||
| 19 | + `minimum ICU version in ${icuVersionsFile} (${minimumICU}) ` + | ||
| 20 | + `must be at least that in ${v8SrcFile} (${Number(v8MinimumICU)})`); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments