| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent efb62aa commit a39b98e
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -525,3 +525,9 @@ exports.expectWarning = function(name, expected) { | |||
| 525 | 525 | expected.splice(expected.indexOf(warning.message), 1); | |
| 526 | 526 | }, expected.length)); | |
| 527 | 527 | }; | |
| 528 | + | ||
| 529 | + Object.defineProperty(exports, 'hasIntl', { | ||
| 530 | + get: function() { | ||
| 531 | + return process.binding('config').hasIntl; | ||
| 532 | + } | ||
| 533 | + }); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | const common = require('../common'); | |
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | ||
| 5 | - if (global.Intl === undefined || Intl.v8BreakIterator === undefined) { | ||
| 5 | + if (!common.hasIntl || Intl.v8BreakIterator === undefined) { | ||
| 6 | 6 | return common.skip('no Intl'); | |
| 7 | 7 | } | |
| 8 | 8 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,9 +8,6 @@ if (enablei18n === undefined) { | |||
| 8 | 8 | enablei18n = 0; | |
| 9 | 9 | } | |
| 10 | 10 | ||
| 11 | - // is the Intl object present? | ||
| 12 | - const haveIntl = (global.Intl !== undefined); | ||
| 13 | - | ||
| 14 | 11 | // Returns true if no specific locale ids were configured (i.e. "all") | |
| 15 | 12 | // Else, returns true if loc is in the configured list | |
| 16 | 13 | // Else, returns false | |
@@ -19,7 +16,7 @@ function haveLocale(loc) { | |||
| 19 | 16 | return locs.indexOf(loc) !== -1; | |
| 20 | 17 | } | |
| 21 | 18 | ||
| 22 | - if (!haveIntl) { | ||
| 19 | + if (!common.hasIntl) { | ||
| 23 | 20 | const erMsg = | |
| 24 | 21 | '"Intl" object is NOT present but v8_enable_i18n_support is ' + | |
| 25 | 22 | enablei18n; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ if (common.hasCrypto) { | |||
| 9 | 9 | expected_keys.push('openssl'); | |
| 10 | 10 | } | |
| 11 | 11 | ||
| 12 | - if (typeof Intl !== 'undefined') { | ||
| 12 | + if (common.hasIntl) { | ||
| 13 | 13 | expected_keys.push('icu'); | |
| 14 | 14 | } | |
| 15 | 15 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -277,7 +277,7 @@ const testNonGlobal = repl.start({ | |||
| 277 | 277 | const builtins = [['Infinity', '', 'Int16Array', 'Int32Array', | |
| 278 | 278 | 'Int8Array'], 'I']; | |
| 279 | 279 | ||
| 280 | - if (typeof Intl === 'object') { | ||
| 280 | + if (common.hasIntl) { | ||
| 281 | 281 | builtins[0].push('Intl'); | |
| 282 | 282 | } | |
| 283 | 283 | testNonGlobal.complete('I', common.mustCall((error, data) => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments