| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bec7fce commit 9426ff6
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,17 @@ const bits = ['arm64', 'loong64', 'mips', 'mipsel', 'ppc64', 'riscv64', 's390x', | |||
| 36 | 36 | .includes(process.arch) ? 64 : 32; | |
| 37 | 37 | const hasIntl = !!process.config.variables.v8_enable_i18n_support; | |
| 38 | 38 | ||
| 39 | + // small-icu doesn't support non-English locales | ||
| 40 | + const hasFullICU = (() => { | ||
| 41 | + try { | ||
| 42 | + const january = new Date(9e8); | ||
| 43 | + const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); | ||
| 44 | + return spanish.format(january) === 'enero'; | ||
| 45 | + } catch { | ||
| 46 | + return false; | ||
| 47 | + } | ||
| 48 | + })(); | ||
| 49 | + | ||
| 39 | 50 | const { | |
| 40 | 51 | atob, | |
| 41 | 52 | btoa, | |
@@ -936,6 +947,7 @@ const common = { | |||
| 936 | 947 | getBufferSources, | |
| 937 | 948 | getTTYfd, | |
| 938 | 949 | hasIntl, | |
| 950 | + hasFullICU, | ||
| 939 | 951 | hasCrypto, | |
| 940 | 952 | hasQuic, | |
| 941 | 953 | hasInspector, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,17 +35,7 @@ try { | |||
| 35 | 35 | } | |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | - // small-icu doesn't support non-English locales | ||
| 39 | - const hasFullICU = (() => { | ||
| 40 | - try { | ||
| 41 | - const january = new Date(9e8); | ||
| 42 | - const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); | ||
| 43 | - return spanish.format(january) === 'enero'; | ||
| 44 | - } catch { | ||
| 45 | - return false; | ||
| 46 | - } | ||
| 47 | - })(); | ||
| 48 | - if (!hasFullICU) | ||
| 38 | + if (!common.hasFullICU) | ||
| 49 | 39 | common.skip('small ICU'); | |
| 50 | 40 | ||
| 51 | 41 | const icuVersionMajor = Number(process.config.variables.icu_ver_major ?? 0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,19 @@ | |||
| 1 | + // Flags: --harmony-temporal | ||
| 2 | + | ||
| 3 | + 'use strict'; | ||
| 4 | + const common = require('../common'); | ||
| 5 | + const assert = require('assert'); | ||
| 6 | + | ||
| 7 | + if (!process.config.variables.v8_enable_temporal_support) { | ||
| 8 | + common.skip('Temporal is not enabled'); | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + // TODO(legendecas): bundle zoneinfo data for small ICU and without ICU builds. | ||
| 12 | + if (!common.hasFullICU) { | ||
| 13 | + common.skip('Time zone support unavailable when not built with full ICU'); | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + // Use globalThis.Temporal to workaround linter complaints. | ||
| 17 | + assert.strictEqual(typeof globalThis.Temporal, 'object'); | ||
| 18 | + const pdt = globalThis.Temporal.Instant.from('1969-07-20T20:17:00Z'); | ||
| 19 | + assert.strictEqual(pdt.toString(), '1969-07-20T20:17:00Z'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,14 @@ | |||
| 1 | + // Flags: --harmony-temporal | ||
| 2 | + | ||
| 3 | + 'use strict'; | ||
| 4 | + const common = require('../common'); | ||
| 5 | + const assert = require('assert'); | ||
| 6 | + | ||
| 7 | + if (!process.config.variables.v8_enable_temporal_support) { | ||
| 8 | + common.skip('Temporal is not enabled'); | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + // Use globalThis.Temporal to workaround linter complaints. | ||
| 12 | + assert.strictEqual(typeof globalThis.Temporal, 'object'); | ||
| 13 | + const pdt = globalThis.Temporal.PlainDateTime.from('1969-07-20T20:17:00'); | ||
| 14 | + assert.strictEqual(pdt.toString(), '1969-07-20T20:17:00'); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments