summaryrefslogtreecommitdiff
path: root/deps/v8/test/intl
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/intl')
-rw-r--r--deps/v8/test/intl/assert.js63
-rw-r--r--deps/v8/test/intl/bigint/tolocalestring.js61
-rw-r--r--deps/v8/test/intl/break-iterator/subclass.js2
-rw-r--r--deps/v8/test/intl/date-format/check-hc-option.js6
-rw-r--r--deps/v8/test/intl/date-format/constructor-date-style-order.js108
-rw-r--r--deps/v8/test/intl/date-format/constructor-date-time-style-order.js109
-rw-r--r--deps/v8/test/intl/date-format/constructor-date-time-style.js33
-rw-r--r--deps/v8/test/intl/date-format/constructor-no-style-order.js114
-rw-r--r--deps/v8/test/intl/date-format/constructor-time-style-order.js108
-rw-r--r--deps/v8/test/intl/date-format/property-override-date-style.js54
-rw-r--r--deps/v8/test/intl/date-format/property-override-date-time-style.js59
-rw-r--r--deps/v8/test/intl/date-format/property-override-time-style.js54
-rw-r--r--deps/v8/test/intl/intl.status10
-rw-r--r--deps/v8/test/intl/list-format/constructor.js2
-rw-r--r--deps/v8/test/intl/list-format/format-en.js2
-rw-r--r--deps/v8/test/intl/list-format/format-to-parts.js2
-rw-r--r--deps/v8/test/intl/list-format/format.js2
-rw-r--r--deps/v8/test/intl/list-format/formatToParts-zh.js2
-rw-r--r--deps/v8/test/intl/list-format/resolved-options.js2
-rw-r--r--deps/v8/test/intl/list-format/supported-locale.js1
-rw-r--r--deps/v8/test/intl/regress-7770.js8
-rw-r--r--deps/v8/test/intl/regress-8030.js2
-rw-r--r--deps/v8/test/intl/regress-8031.js2
-rw-r--r--deps/v8/test/intl/regress-930304.js5
-rw-r--r--deps/v8/test/intl/relative-time-format/constructor.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/default-locale-fr-CA.js1
-rw-r--r--deps/v8/test/intl/relative-time-format/default-locale-pt-BR.js1
-rw-r--r--deps/v8/test/intl/relative-time-format/format-en.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/format-to-parts-en.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/format-to-parts-plural.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/format-to-parts.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/format.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/resolved-options-nu.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/resolved-options.js2
-rw-r--r--deps/v8/test/intl/relative-time-format/supported-locale.js1
-rw-r--r--deps/v8/test/intl/testcfg.py25
36 files changed, 794 insertions, 61 deletions
diff --git a/deps/v8/test/intl/assert.js b/deps/v8/test/intl/assert.js
index c11e7c0bbf..a6367a8cf2 100644
--- a/deps/v8/test/intl/assert.js
+++ b/deps/v8/test/intl/assert.js
@@ -200,15 +200,68 @@ function assertInstanceof(obj, type) {
}
}
-
/**
* Split a BCP 47 language tag into locale and extension.
*/
function splitLanguageTag(tag) {
- var extRe = /(-[0-9A-Za-z](-[0-9A-Za-z]{2,8})+)+$/;
- var match = %regexp_internal_match(extRe, tag);
- if (match) {
- return { locale: tag.slice(0, match.index), extension: match[0] };
+ // Search for the beginning of one or more extension tags, each of which
+ // contains a singleton tag followed by one or more subtags. The equivalent
+ // regexp is: /(-[0-9A-Za-z](-[0-9A-Za-z]{2,8})+)+$/. For example, in
+ // 'de-DE-u-co-phonebk' the matched extension tags are '-u-co-phonebk'.
+ //
+ // The below is a mini-parser that reads backwards from the end of the string.
+
+ function charCode(char) { return char.charCodeAt(0); }
+ function isAlphaNumeric(code) {
+ return (charCode("0") <= code && code <= charCode("9")) ||
+ (charCode("A") <= code && code <= charCode("Z")) ||
+ (charCode("a") <= code && code <= charCode("z"));
+ }
+
+ const MATCH_SUBTAG = 0;
+ const MATCH_SINGLETON_OR_SUBTAG = 1;
+ let state = MATCH_SUBTAG;
+
+ const MINIMUM_TAG_LENGTH = 2;
+ const MAXIMUM_TAG_LENGTH = 8;
+ let currentTagLength = 0;
+
+ // -1 signifies failure, a non-negative integer is the start index of the
+ // extension tag.
+ let extensionTagStartIndex = -1;
+
+ for (let i = tag.length - 1; i >= 0; i--) {
+ const currentCharCode = tag.charCodeAt(i);
+ if (currentCharCode == charCode("-")) {
+ if (state == MATCH_SINGLETON_OR_SUBTAG && currentTagLength == 1) {
+ // Found the singleton tag, the match succeeded.
+ // Save the matched index, and reset the state. After this point, we
+ // definitely have a match, but we may still find another extension tag
+ // sequence.
+ extensionTagStartIndex = i;
+ state = MATCH_SUBTAG;
+ currentTagLength = 0;
+ } else if (MINIMUM_TAG_LENGTH <= currentTagLength &&
+ currentTagLength <= MAXIMUM_TAG_LENGTH) {
+ // Found a valid subtag.
+ state = MATCH_SINGLETON_OR_SUBTAG;
+ currentTagLength = 0;
+ } else {
+ // Invalid subtag (too short or too long).
+ break;
+ }
+ } else if (isAlphaNumeric(currentCharCode)) {
+ // An alphanumeric character is potentially part of a tag.
+ currentTagLength++;
+ } else {
+ // Any other character is invalid.
+ break;
+ }
+ }
+
+ if (extensionTagStartIndex != -1) {
+ return { locale: tag.substring(0, extensionTagStartIndex),
+ extension: tag.substring(extensionTagStartIndex) };
}
return { locale: tag, extension: '' };
diff --git a/deps/v8/test/intl/bigint/tolocalestring.js b/deps/v8/test/intl/bigint/tolocalestring.js
new file mode 100644
index 0000000000..d0b6792ea8
--- /dev/null
+++ b/deps/v8/test/intl/bigint/tolocalestring.js
@@ -0,0 +1,61 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-bigint
+
+var locales = [
+ "en", // "1,234,567,890,123,456"
+ "de", // "1.234.567.890.123.456"
+ "fr", // "1 234 567 890 123 456"
+ "hi", // "1,23,45,67,89,01,23,456"
+ "fa", // "۱٬۲۳۴٬۵۶۷٬۸۹۰٬۱۲۳٬۴۵۶"
+ "th-u-nu-thai", // "๑,๒๓๔,๕๖๗,๘๙๐,๑๒๓,๔๕๖"
+];
+
+var data = [
+ Number.MAX_SAFE_INTEGER,
+ -Number.MAX_SAFE_INTEGER,
+ Math.floor(Number.MAX_SAFE_INTEGER / 2),
+ 0,
+ /// -0, // this case is broken now.
+];
+
+for (var locale of locales) {
+ let nf = new Intl.NumberFormat(locale);
+
+ let percentOption = {style: "percent"};
+ let nfPercent = new Intl.NumberFormat(locale, percentOption);
+ for (var n of data) {
+ let bigint = BigInt(n);
+ // Test NumberFormat w/ number output the same as
+ // BigInt.prototype.toLocaleString()
+ assertEquals(nf.format(n), bigint.toLocaleString(locale));
+
+ // Test NumberFormat output the same regardless pass in as number or BigInt
+ assertEquals(nf.format(n), nf.format(bigint));
+
+ // Test formatToParts
+ assertEquals(nf.formatToParts(n), nf.formatToParts(bigint));
+
+ // Test output with option
+ // Test NumberFormat w/ number output the same as
+ // BigInt.prototype.toLocaleString()
+ assertEquals(nfPercent.format(n),
+ bigint.toLocaleString(locale, percentOption));
+
+ // Test NumberFormat output the same regardless pass in as number or BigInt
+ assertEquals(nfPercent.format(n), nfPercent.format(bigint));
+ assertEquals(nfPercent.formatToParts(n), nfPercent.formatToParts(bigint));
+ }
+
+ // Test very big BigInt
+ let veryBigInt = BigInt(Number.MAX_SAFE_INTEGER) *
+ BigInt(Number.MAX_SAFE_INTEGER) *
+ BigInt(Number.MAX_SAFE_INTEGER);
+ assertEquals(nf.format(veryBigInt), veryBigInt.toLocaleString(locale));
+ // It should output different than toString
+ assertFalse(veryBigInt.toLocaleString(locale) == veryBigInt.toString());
+ assertTrue(veryBigInt.toLocaleString(locale).length >
+ veryBigInt.toString().length);
+}
diff --git a/deps/v8/test/intl/break-iterator/subclass.js b/deps/v8/test/intl/break-iterator/subclass.js
index b5ffe61a48..4358721027 100644
--- a/deps/v8/test/intl/break-iterator/subclass.js
+++ b/deps/v8/test/intl/break-iterator/subclass.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
var locales = ["tlh", "id", "en"];
var input = "foo and bar";
var refBreakIterator = new Intl.v8BreakIterator(locales);
diff --git a/deps/v8/test/intl/date-format/check-hc-option.js b/deps/v8/test/intl/date-format/check-hc-option.js
index 276bfe6a23..7a1e917816 100644
--- a/deps/v8/test/intl/date-format/check-hc-option.js
+++ b/deps/v8/test/intl/date-format/check-hc-option.js
@@ -26,7 +26,8 @@ let locales = [
];
invalid_hc.forEach(function(hc) {
- let df = new Intl.DateTimeFormat(["en-u-hc-" + hc + "-fo-obar"]);
+ let df = new Intl.DateTimeFormat(
+ ["en-u-hc-" + hc + "-fo-obar"], {hour: "2-digit"});
assertEquals("en", df.resolvedOptions().locale);
}
);
@@ -34,7 +35,8 @@ invalid_hc.forEach(function(hc) {
valid_hc.forEach(function(hc) {
locales.forEach(function(base) {
let l = base + "-u-hc-" + hc;
- let df = new Intl.DateTimeFormat([l + "-fo-obar"]);
+ let df = new Intl.DateTimeFormat(
+ [l + "-fo-obar"], {hour: "2-digit"});
assertEquals(l, df.resolvedOptions().locale);
});
}
diff --git a/deps/v8/test/intl/date-format/constructor-date-style-order.js b/deps/v8/test/intl/date-format/constructor-date-style-order.js
new file mode 100644
index 0000000000..8e601b48d3
--- /dev/null
+++ b/deps/v8/test/intl/date-format/constructor-date-style-order.js
@@ -0,0 +1,108 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+// Throws only once during construction.
+// Check for all getters to prevent regression.
+// Preserve the order of getter initialization.
+let getCount = 0;
+let weekday = new Array();
+let year = new Array();
+let month = new Array();
+let day = new Array();
+let hour = new Array();
+let minute = new Array();
+let second = new Array();
+let localeMatcher = new Array();
+let hour12 = new Array();
+let hourCycle = new Array();
+let dateStyle = new Array();
+let timeStyle = new Array();
+let timeZone = new Array();
+let era = new Array();
+let timeZoneName = new Array();
+let formatMatcher = new Array();
+
+new Intl.DateTimeFormat(['en-US'], {
+ get weekday() {
+ weekday.push(++getCount);
+ },
+ get year() {
+ year.push(++getCount);
+ },
+ get month() {
+ month.push(++getCount);
+ },
+ get day() {
+ day.push(++getCount);
+ },
+ get hour() {
+ hour.push(++getCount);
+ },
+ get minute() {
+ minute.push(++getCount);
+ },
+ get second() {
+ second.push(++getCount);
+ },
+ get localeMatcher() {
+ localeMatcher.push(++getCount);
+ },
+ get hour12() {
+ hour12.push(++getCount);
+ },
+ get hourCycle() {
+ hourCycle.push(++getCount);
+ },
+ get timeZone() {
+ timeZone.push(++getCount);
+ },
+ get dateStyle() {
+ dateStyle.push(++getCount);
+ return "full";
+ },
+ get timeStyle() {
+ timeStyle.push(++getCount);
+ },
+ get era() {
+ era.push(++getCount);
+ },
+ get timeZoneName() {
+ timeZoneName.push(++getCount);
+ },
+ get formatMatcher() {
+ formatMatcher.push(++getCount);
+ }
+});
+
+assertEquals(1, weekday.length);
+assertEquals(1, weekday[0]);
+assertEquals(1, year.length);
+assertEquals(2, year[0]);
+assertEquals(1, month.length);
+assertEquals(3, month[0]);
+assertEquals(1, day.length);
+assertEquals(4, day[0]);
+assertEquals(1, hour.length);
+assertEquals(5, hour[0]);
+assertEquals(1, minute.length);
+assertEquals(6, minute[0]);
+assertEquals(1, second.length);
+assertEquals(7, second[0]);
+assertEquals(1, localeMatcher.length);
+assertEquals(8, localeMatcher[0]);
+assertEquals(1, hour12.length);
+assertEquals(9, hour12[0]);
+assertEquals(1, hourCycle.length);
+assertEquals(10, hourCycle[0]);
+assertEquals(1, timeZone.length);
+assertEquals(11, timeZone[0]);
+assertEquals(1, dateStyle.length);
+assertEquals(12, dateStyle[0]);
+assertEquals(1, timeStyle.length);
+assertEquals(13, timeStyle[0]);
+assertEquals(0, era.length);
+assertEquals(0, timeZoneName.length);
+assertEquals(0, formatMatcher.length);
diff --git a/deps/v8/test/intl/date-format/constructor-date-time-style-order.js b/deps/v8/test/intl/date-format/constructor-date-time-style-order.js
new file mode 100644
index 0000000000..d4d114662f
--- /dev/null
+++ b/deps/v8/test/intl/date-format/constructor-date-time-style-order.js
@@ -0,0 +1,109 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+// Throws only once during construction.
+// Check for all getters to prevent regression.
+// Preserve the order of getter initialization.
+let getCount = 0;
+let weekday = new Array();
+let year = new Array();
+let month = new Array();
+let day = new Array();
+let hour = new Array();
+let minute = new Array();
+let second = new Array();
+let localeMatcher = new Array();
+let hour12 = new Array();
+let hourCycle = new Array();
+let dateStyle = new Array();
+let timeStyle = new Array();
+let timeZone = new Array();
+let era = new Array();
+let timeZoneName = new Array();
+let formatMatcher = new Array();
+
+new Intl.DateTimeFormat(['en-US'], {
+ get weekday() {
+ weekday.push(++getCount);
+ },
+ get year() {
+ year.push(++getCount);
+ },
+ get month() {
+ month.push(++getCount);
+ },
+ get day() {
+ day.push(++getCount);
+ },
+ get hour() {
+ hour.push(++getCount);
+ },
+ get minute() {
+ minute.push(++getCount);
+ },
+ get second() {
+ second.push(++getCount);
+ },
+ get localeMatcher() {
+ localeMatcher.push(++getCount);
+ },
+ get hour12() {
+ hour12.push(++getCount);
+ },
+ get hourCycle() {
+ hourCycle.push(++getCount);
+ },
+ get timeZone() {
+ timeZone.push(++getCount);
+ },
+ get dateStyle() {
+ dateStyle.push(++getCount);
+ return "full";
+ },
+ get timeStyle() {
+ timeStyle.push(++getCount);
+ return "full";
+ },
+ get era() {
+ era.push(++getCount);
+ },
+ get timeZoneName() {
+ timeZoneName.push(++getCount);
+ },
+ get formatMatcher() {
+ formatMatcher.push(++getCount);
+ }
+});
+
+assertEquals(1, weekday.length);
+assertEquals(1, weekday[0]);
+assertEquals(1, year.length);
+assertEquals(2, year[0]);
+assertEquals(1, month.length);
+assertEquals(3, month[0]);
+assertEquals(1, day.length);
+assertEquals(4, day[0]);
+assertEquals(1, hour.length);
+assertEquals(5, hour[0]);
+assertEquals(1, minute.length);
+assertEquals(6, minute[0]);
+assertEquals(1, second.length);
+assertEquals(7, second[0]);
+assertEquals(1, localeMatcher.length);
+assertEquals(8, localeMatcher[0]);
+assertEquals(1, hour12.length);
+assertEquals(9, hour12[0]);
+assertEquals(1, hourCycle.length);
+assertEquals(10, hourCycle[0]);
+assertEquals(1, timeZone.length);
+assertEquals(11, timeZone[0]);
+assertEquals(1, dateStyle.length);
+assertEquals(12, dateStyle[0]);
+assertEquals(1, timeStyle.length);
+assertEquals(13, timeStyle[0]);
+assertEquals(0, era.length);
+assertEquals(0, timeZoneName.length);
+assertEquals(0, formatMatcher.length);
diff --git a/deps/v8/test/intl/date-format/constructor-date-time-style.js b/deps/v8/test/intl/date-format/constructor-date-time-style.js
new file mode 100644
index 0000000000..f4bc40b396
--- /dev/null
+++ b/deps/v8/test/intl/date-format/constructor-date-time-style.js
@@ -0,0 +1,33 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+var validStyle = ["full", "long", "medium", "short", undefined];
+var invalidStyle = ["narrow", "numeric"];
+
+validStyle.forEach(function(dateStyle) {
+ validStyle.forEach(function(timeStyle) {
+ assertDoesNotThrow(() =>
+ new Intl.DateTimeFormat("en", {dateStyle, timeStyle}));
+ });
+
+ invalidStyle.forEach(function(timeStyle) {
+ assertThrows(() =>
+ new Intl.DateTimeFormat("en", {dateStyle, timeStyle}), RangeError);
+ });
+}
+);
+
+invalidStyle.forEach(function(dateStyle) {
+ validStyle.forEach(function(timeStyle) {
+ assertThrows(() =>
+ new Intl.DateTimeFormat("en", {dateStyle, timeStyle}), RangeError);
+ });
+ invalidStyle.forEach(function(timeStyle) {
+ assertThrows(() =>
+ new Intl.DateTimeFormat("en", {dateStyle, timeStyle}), RangeError);
+ });
+}
+);
diff --git a/deps/v8/test/intl/date-format/constructor-no-style-order.js b/deps/v8/test/intl/date-format/constructor-no-style-order.js
new file mode 100644
index 0000000000..bd4bc4cc37
--- /dev/null
+++ b/deps/v8/test/intl/date-format/constructor-no-style-order.js
@@ -0,0 +1,114 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+// Throws only once during construction.
+// Check for all getters to prevent regression.
+// Preserve the order of getter initialization.
+let getCount = 0;
+let weekday = new Array();
+let year = new Array();
+let month = new Array();
+let day = new Array();
+let hour = new Array();
+let minute = new Array();
+let second = new Array();
+let localeMatcher = new Array();
+let hour12 = new Array();
+let hourCycle = new Array();
+let dateStyle = new Array();
+let timeStyle = new Array();
+let timeZone = new Array();
+let era = new Array();
+let timeZoneName = new Array();
+let formatMatcher = new Array();
+
+new Intl.DateTimeFormat(['en-US'], {
+ get weekday() {
+ weekday.push(++getCount);
+ },
+ get year() {
+ year.push(++getCount);
+ },
+ get month() {
+ month.push(++getCount);
+ },
+ get day() {
+ day.push(++getCount);
+ },
+ get hour() {
+ hour.push(++getCount);
+ },
+ get minute() {
+ minute.push(++getCount);
+ },
+ get second() {
+ second.push(++getCount);
+ },
+ get localeMatcher() {
+ localeMatcher.push(++getCount);
+ },
+ get hour12() {
+ hour12.push(++getCount);
+ },
+ get hourCycle() {
+ hourCycle.push(++getCount);
+ },
+ get timeZone() {
+ timeZone.push(++getCount);
+ },
+ get dateStyle() {
+ dateStyle.push(++getCount);
+ },
+ get timeStyle() {
+ timeStyle.push(++getCount);
+ },
+ get era() {
+ era.push(++getCount);
+ },
+ get timeZoneName() {
+ timeZoneName.push(++getCount);
+ },
+ get formatMatcher() {
+ formatMatcher.push(++getCount);
+ }
+});
+
+assertEquals(2, weekday.length);
+assertEquals(1, weekday[0]);
+assertEquals(1, year.length);
+assertEquals(2, year[0]);
+assertEquals(1, month.length);
+assertEquals(3, month[0]);
+assertEquals(1, day.length);
+assertEquals(4, day[0]);
+assertEquals(2, hour.length);
+assertEquals(5, hour[0]);
+assertEquals(2, minute.length);
+assertEquals(6, minute[0]);
+assertEquals(2, second.length);
+assertEquals(7, second[0]);
+assertEquals(1, localeMatcher.length);
+assertEquals(8, localeMatcher[0]);
+assertEquals(1, hour12.length);
+assertEquals(9, hour12[0]);
+assertEquals(1, hourCycle.length);
+assertEquals(10, hourCycle[0]);
+assertEquals(1, timeZone.length);
+assertEquals(11, timeZone[0]);
+assertEquals(1, dateStyle.length);
+assertEquals(12, dateStyle[0]);
+assertEquals(1, timeStyle.length);
+assertEquals(13, timeStyle[0]);
+assertEquals(14, weekday[1]);
+assertEquals(1, era.length);
+assertEquals(15, era[0]);
+assertEquals(16, hour[1]);
+assertEquals(17, minute[1]);
+assertEquals(18, second[1]);
+assertEquals(1, timeZoneName.length);
+assertEquals(19, timeZoneName[0]);
+assertEquals(1, formatMatcher.length);
+assertEquals(20, formatMatcher[0]);
diff --git a/deps/v8/test/intl/date-format/constructor-time-style-order.js b/deps/v8/test/intl/date-format/constructor-time-style-order.js
new file mode 100644
index 0000000000..d35f21a196
--- /dev/null
+++ b/deps/v8/test/intl/date-format/constructor-time-style-order.js
@@ -0,0 +1,108 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+// Throws only once during construction.
+// Check for all getters to prevent regression.
+// Preserve the order of getter initialization.
+let getCount = 0;
+let weekday = new Array();
+let year = new Array();
+let month = new Array();
+let day = new Array();
+let hour = new Array();
+let minute = new Array();
+let second = new Array();
+let localeMatcher = new Array();
+let hour12 = new Array();
+let hourCycle = new Array();
+let dateStyle = new Array();
+let timeStyle = new Array();
+let timeZone = new Array();
+let era = new Array();
+let timeZoneName = new Array();
+let formatMatcher = new Array();
+
+new Intl.DateTimeFormat(['en-US'], {
+ get weekday() {
+ weekday.push(++getCount);
+ },
+ get year() {
+ year.push(++getCount);
+ },
+ get month() {
+ month.push(++getCount);
+ },
+ get day() {
+ day.push(++getCount);
+ },
+ get hour() {
+ hour.push(++getCount);
+ },
+ get minute() {
+ minute.push(++getCount);
+ },
+ get second() {
+ second.push(++getCount);
+ },
+ get localeMatcher() {
+ localeMatcher.push(++getCount);
+ },
+ get hour12() {
+ hour12.push(++getCount);
+ },
+ get hourCycle() {
+ hourCycle.push(++getCount);
+ },
+ get timeZone() {
+ timeZone.push(++getCount);
+ },
+ get dateStyle() {
+ dateStyle.push(++getCount);
+ },
+ get timeStyle() {
+ timeStyle.push(++getCount);
+ return "full";
+ },
+ get era() {
+ era.push(++getCount);
+ },
+ get timeZoneName() {
+ timeZoneName.push(++getCount);
+ },
+ get formatMatcher() {
+ formatMatcher.push(++getCount);
+ }
+});
+
+assertEquals(1, weekday.length);
+assertEquals(1, weekday[0]);
+assertEquals(1, year.length);
+assertEquals(2, year[0]);
+assertEquals(1, month.length);
+assertEquals(3, month[0]);
+assertEquals(1, day.length);
+assertEquals(4, day[0]);
+assertEquals(1, hour.length);
+assertEquals(5, hour[0]);
+assertEquals(1, minute.length);
+assertEquals(6, minute[0]);
+assertEquals(1, second.length);
+assertEquals(7, second[0]);
+assertEquals(1, localeMatcher.length);
+assertEquals(8, localeMatcher[0]);
+assertEquals(1, hour12.length);
+assertEquals(9, hour12[0]);
+assertEquals(1, hourCycle.length);
+assertEquals(10, hourCycle[0]);
+assertEquals(1, timeZone.length);
+assertEquals(11, timeZone[0]);
+assertEquals(1, dateStyle.length);
+assertEquals(12, dateStyle[0]);
+assertEquals(1, timeStyle.length);
+assertEquals(13, timeStyle[0]);
+assertEquals(0, era.length);
+assertEquals(0, timeZoneName.length);
+assertEquals(0, formatMatcher.length);
diff --git a/deps/v8/test/intl/date-format/property-override-date-style.js b/deps/v8/test/intl/date-format/property-override-date-style.js
new file mode 100644
index 0000000000..67d9bc5361
--- /dev/null
+++ b/deps/v8/test/intl/date-format/property-override-date-style.js
@@ -0,0 +1,54 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+// Checks for security holes introduced by Object.property overrides.
+// For example:
+// Object.defineProperty(Array.prototype, 'locale', {
+// set: function(value) {
+// throw new Error('blah');
+// },
+// configurable: true,
+// enumerable: false
+// });
+//
+// would throw in case of (JS) x.locale = 'us' or (C++) x->Set('locale', 'us').
+//
+// First get supported properties.
+// Some of the properties are optional, so we request them.
+var properties = [];
+var options = Intl.DateTimeFormat(
+ 'en-US', {dateStyle: 'full'}).resolvedOptions();
+for (var prop in options) {
+ if (options.hasOwnProperty(prop)) {
+ properties.push(prop);
+ }
+}
+
+// In the order of Table 6 of
+// ecma402 #sec-intl.datetimeformat.prototype.resolvedoptions
+var expectedProperties = [
+ 'locale',
+ 'calendar',
+ 'numberingSystem',
+ 'timeZone',
+ 'hourCycle',
+ 'hour12',
+ 'weekday',
+ 'year',
+ 'month',
+ 'day',
+ 'dateStyle',
+];
+
+assertEquals(expectedProperties.length, properties.length);
+
+properties.forEach(function(prop) {
+ assertFalse(expectedProperties.indexOf(prop) === -1);
+});
+
+taintProperties(properties);
+
+var locale = Intl.DateTimeFormat().resolvedOptions().locale;
diff --git a/deps/v8/test/intl/date-format/property-override-date-time-style.js b/deps/v8/test/intl/date-format/property-override-date-time-style.js
new file mode 100644
index 0000000000..f51d6f31a6
--- /dev/null
+++ b/deps/v8/test/intl/date-format/property-override-date-time-style.js
@@ -0,0 +1,59 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+// Checks for security holes introduced by Object.property overrides.
+// For example:
+// Object.defineProperty(Array.prototype, 'locale', {
+// set: function(value) {
+// throw new Error('blah');
+// },
+// configurable: true,
+// enumerable: false
+// });
+//
+// would throw in case of (JS) x.locale = 'us' or (C++) x->Set('locale', 'us').
+
+// First get supported properties.
+// Some of the properties are optional, so we request them.
+var properties = [];
+var options = Intl.DateTimeFormat(
+ 'en-US', {dateStyle: 'full', timeStyle: 'full'}).resolvedOptions();
+for (var prop in options) {
+ if (options.hasOwnProperty(prop)) {
+ properties.push(prop);
+ }
+}
+
+// In the order of Table 6 of
+// ecma402 #sec-intl.datetimeformat.prototype.resolvedoptions
+var expectedProperties = [
+ 'locale',
+ 'calendar',
+ 'numberingSystem',
+ 'timeZone',
+ 'hourCycle',
+ 'hour12',
+ 'weekday',
+ 'year',
+ 'month',
+ 'day',
+ 'hour',
+ 'minute',
+ 'second',
+ 'timeZoneName',
+ 'dateStyle',
+ 'timeStyle',
+];
+
+assertEquals(expectedProperties.length, properties.length);
+
+properties.forEach(function(prop) {
+ assertFalse(expectedProperties.indexOf(prop) === -1);
+});
+
+taintProperties(properties);
+
+var locale = Intl.DateTimeFormat().resolvedOptions().locale;
diff --git a/deps/v8/test/intl/date-format/property-override-time-style.js b/deps/v8/test/intl/date-format/property-override-time-style.js
new file mode 100644
index 0000000000..1b93ac633f
--- /dev/null
+++ b/deps/v8/test/intl/date-format/property-override-time-style.js
@@ -0,0 +1,54 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-intl-datetime-style
+
+// Checks for security holes introduced by Object.property overrides.
+// For example:
+// Object.defineProperty(Array.prototype, 'locale', {
+// set: function(value) {
+// throw new Error('blah');
+// },
+// configurable: true,
+// enumerable: false
+// });
+//
+// would throw in case of (JS) x.locale = 'us' or (C++) x->Set('locale', 'us').
+
+// First get supported properties.
+// Some of the properties are optional, so we request them.
+var properties = [];
+var options = Intl.DateTimeFormat(
+ 'en-US', {timeStyle: 'full'}).resolvedOptions();
+for (var prop in options) {
+ if (options.hasOwnProperty(prop)) {
+ properties.push(prop);
+ }
+}
+
+// In the order of Table 6 of
+// ecma402 #sec-intl.datetimeformat.prototype.resolvedoptions
+var expectedProperties = [
+ 'locale',
+ 'calendar',
+ 'numberingSystem',
+ 'timeZone',
+ 'hourCycle',
+ 'hour12',
+ 'hour',
+ 'minute',
+ 'second',
+ 'timeZoneName',
+ 'timeStyle',
+];
+
+assertEquals(expectedProperties.length, properties.length);
+
+properties.forEach(function(prop) {
+ assertFalse(expectedProperties.indexOf(prop) === -1);
+});
+
+taintProperties(properties);
+
+var locale = Intl.DateTimeFormat().resolvedOptions().locale;
diff --git a/deps/v8/test/intl/intl.status b/deps/v8/test/intl/intl.status
index 83e546db76..53f42e4b66 100644
--- a/deps/v8/test/intl/intl.status
+++ b/deps/v8/test/intl/intl.status
@@ -46,6 +46,9 @@
# Unable to change locale on Windows:
'default_locale': [SKIP],
+
+ # Unable to change locale and TZ on Windows:
+ 'regress-7770': [SKIP],
}], # system == windows'
['system == android', {
@@ -56,5 +59,12 @@
'relative-time-format/default-locale-fr-CA': [SKIP],
'relative-time-format/default-locale-pt-BR': [SKIP],
'default_locale': [SKIP],
+ # Unable to change locale and TZ on Android:
+ 'regress-7770': [SKIP],
}], # 'system == android'
+
+##############################################################################
+['variant == jitless and not embedded_builtins', {
+ '*': [SKIP],
+}], # variant == jitless and not embedded_builtins
]
diff --git a/deps/v8/test/intl/list-format/constructor.js b/deps/v8/test/intl/list-format/constructor.js
index d730516c9c..05ddf932a9 100644
--- a/deps/v8/test/intl/list-format/constructor.js
+++ b/deps/v8/test/intl/list-format/constructor.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
// ListFormat constructor can't be called as function.
assertThrows(() => Intl.ListFormat(['sr']), TypeError);
diff --git a/deps/v8/test/intl/list-format/format-en.js b/deps/v8/test/intl/list-format/format-en.js
index d628537990..5aa16d2933 100644
--- a/deps/v8/test/intl/list-format/format-en.js
+++ b/deps/v8/test/intl/list-format/format-en.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
// The following test are not part of the comformance. Just some output in
// English to verify the format does return something reasonable for English.
// It may be changed when we update the CLDR data.
diff --git a/deps/v8/test/intl/list-format/format-to-parts.js b/deps/v8/test/intl/list-format/format-to-parts.js
index 64eac823ba..038fb761ea 100644
--- a/deps/v8/test/intl/list-format/format-to-parts.js
+++ b/deps/v8/test/intl/list-format/format-to-parts.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
function assertListFormat(listFormat, input) {
var result;
try {
diff --git a/deps/v8/test/intl/list-format/format.js b/deps/v8/test/intl/list-format/format.js
index fef05c38e0..a10e9a092e 100644
--- a/deps/v8/test/intl/list-format/format.js
+++ b/deps/v8/test/intl/list-format/format.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
function assertListFormat(listFormat, input) {
try {
let result = listFormat.format(input);
diff --git a/deps/v8/test/intl/list-format/formatToParts-zh.js b/deps/v8/test/intl/list-format/formatToParts-zh.js
index a7204b0b29..1279c86204 100644
--- a/deps/v8/test/intl/list-format/formatToParts-zh.js
+++ b/deps/v8/test/intl/list-format/formatToParts-zh.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
// The following test are not part of the comformance. Just some output in
// Chinese to verify the format does return something reasonable for Chinese.
// It may be changed when we update the CLDR data.
diff --git a/deps/v8/test/intl/list-format/resolved-options.js b/deps/v8/test/intl/list-format/resolved-options.js
index b5662718e5..42687990f9 100644
--- a/deps/v8/test/intl/list-format/resolved-options.js
+++ b/deps/v8/test/intl/list-format/resolved-options.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
let listFormat = new Intl.ListFormat();
// The default style is 'long'
assertEquals('long', listFormat.resolvedOptions().style);
diff --git a/deps/v8/test/intl/list-format/supported-locale.js b/deps/v8/test/intl/list-format/supported-locale.js
index 1eac25d618..0aebeb86a1 100644
--- a/deps/v8/test/intl/list-format/supported-locale.js
+++ b/deps/v8/test/intl/list-format/supported-locale.js
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
assertEquals(typeof Intl.ListFormat.supportedLocalesOf, "function",
"Intl.ListFormat.supportedLocalesOf should be a function");
diff --git a/deps/v8/test/intl/regress-7770.js b/deps/v8/test/intl/regress-7770.js
new file mode 100644
index 0000000000..2e7c2ce22d
--- /dev/null
+++ b/deps/v8/test/intl/regress-7770.js
@@ -0,0 +1,8 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Environment Variables: TZ=Indian/Kerguelen LANG=uk
+assertEquals(
+ "Fri Feb 01 2019 00:00:00 GMT+0500 (за часом на Французьких Південних і Антарктичних територіях)",
+ new Date(2019, 1,1).toString());
diff --git a/deps/v8/test/intl/regress-8030.js b/deps/v8/test/intl/regress-8030.js
index eac6b84f81..cf0e1aa2a9 100644
--- a/deps/v8/test/intl/regress-8030.js
+++ b/deps/v8/test/intl/regress-8030.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
var locales = ["tlh", "id", "en"];
var referenceRelativeTimeFormat = new Intl.RelativeTimeFormat(locales);
var referenceFormatted = referenceRelativeTimeFormat.format(3, "day");
diff --git a/deps/v8/test/intl/regress-8031.js b/deps/v8/test/intl/regress-8031.js
index 0898026d99..513ef025fe 100644
--- a/deps/v8/test/intl/regress-8031.js
+++ b/deps/v8/test/intl/regress-8031.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-list-format
-
var locales = ["tlh", "id", "en"];
var input = ["a", "b", "c"];
var referenceListFormat = new Intl.ListFormat(locales);
diff --git a/deps/v8/test/intl/regress-930304.js b/deps/v8/test/intl/regress-930304.js
new file mode 100644
index 0000000000..85bcfea76e
--- /dev/null
+++ b/deps/v8/test/intl/regress-930304.js
@@ -0,0 +1,5 @@
+// Copyright 2019 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+assertDoesNotThrow(() => Intl.DateTimeFormat('en-u-nu-ethi'));
diff --git a/deps/v8/test/intl/relative-time-format/constructor.js b/deps/v8/test/intl/relative-time-format/constructor.js
index ba03e1dd70..f1a4057426 100644
--- a/deps/v8/test/intl/relative-time-format/constructor.js
+++ b/deps/v8/test/intl/relative-time-format/constructor.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
// RelativeTimeFormat constructor can't be called as function.
assertThrows(() => Intl.RelativeTimeFormat('sr'), TypeError);
diff --git a/deps/v8/test/intl/relative-time-format/default-locale-fr-CA.js b/deps/v8/test/intl/relative-time-format/default-locale-fr-CA.js
index 32f64ee02d..9f24329b50 100644
--- a/deps/v8/test/intl/relative-time-format/default-locale-fr-CA.js
+++ b/deps/v8/test/intl/relative-time-format/default-locale-fr-CA.js
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format --harmony-locale
// Environment Variables: LC_ALL=fr_CA
assertEquals(
'fr-CA',
diff --git a/deps/v8/test/intl/relative-time-format/default-locale-pt-BR.js b/deps/v8/test/intl/relative-time-format/default-locale-pt-BR.js
index 89f7aa14f0..ea66b6a0e5 100644
--- a/deps/v8/test/intl/relative-time-format/default-locale-pt-BR.js
+++ b/deps/v8/test/intl/relative-time-format/default-locale-pt-BR.js
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format --harmony-locale
// Environment Variables: LC_ALL=pt_BR
assertEquals(
'pt-BR',
diff --git a/deps/v8/test/intl/relative-time-format/format-en.js b/deps/v8/test/intl/relative-time-format/format-en.js
index 2af755dcbf..a365749f0a 100644
--- a/deps/v8/test/intl/relative-time-format/format-en.js
+++ b/deps/v8/test/intl/relative-time-format/format-en.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
// The following test are not part of the comformance. Just some output in
// English to verify the format does return something reasonable for English.
// It may be changed when we update the CLDR data.
diff --git a/deps/v8/test/intl/relative-time-format/format-to-parts-en.js b/deps/v8/test/intl/relative-time-format/format-to-parts-en.js
index 689059f4cd..7c2076b312 100644
--- a/deps/v8/test/intl/relative-time-format/format-to-parts-en.js
+++ b/deps/v8/test/intl/relative-time-format/format-to-parts-en.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
// The following test are not part of the comformance. Just some output in
// English to verify the format does return something reasonable for English.
// It may be changed when we update the CLDR data.
diff --git a/deps/v8/test/intl/relative-time-format/format-to-parts-plural.js b/deps/v8/test/intl/relative-time-format/format-to-parts-plural.js
index 7e5e1b79a6..bd70f75421 100644
--- a/deps/v8/test/intl/relative-time-format/format-to-parts-plural.js
+++ b/deps/v8/test/intl/relative-time-format/format-to-parts-plural.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
// Check plural w/ formatToParts
// http://tc39.github.io/proposal-intl-relative-time/
diff --git a/deps/v8/test/intl/relative-time-format/format-to-parts.js b/deps/v8/test/intl/relative-time-format/format-to-parts.js
index 071c4468c0..ccc9170225 100644
--- a/deps/v8/test/intl/relative-time-format/format-to-parts.js
+++ b/deps/v8/test/intl/relative-time-format/format-to-parts.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
// Make sure that RelativeTimeFormat exposes all required properties. Those not specified
// should have undefined value.
// http://tc39.github.io/proposal-intl-relative-time/
diff --git a/deps/v8/test/intl/relative-time-format/format.js b/deps/v8/test/intl/relative-time-format/format.js
index 769358423d..e458ad728d 100644
--- a/deps/v8/test/intl/relative-time-format/format.js
+++ b/deps/v8/test/intl/relative-time-format/format.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
// Make sure that RelativeTimeFormat exposes all required properties. Those not specified
// should have undefined value.
// http://tc39.github.io/proposal-intl-relative-time/
diff --git a/deps/v8/test/intl/relative-time-format/resolved-options-nu.js b/deps/v8/test/intl/relative-time-format/resolved-options-nu.js
index fb1fa72a93..a01cb5d9c4 100644
--- a/deps/v8/test/intl/relative-time-format/resolved-options-nu.js
+++ b/deps/v8/test/intl/relative-time-format/resolved-options-nu.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
// For locale default the numberingSystem to 'latn'
assertEquals(
"latn",
diff --git a/deps/v8/test/intl/relative-time-format/resolved-options.js b/deps/v8/test/intl/relative-time-format/resolved-options.js
index 391b83ae0a..1caa4f86c9 100644
--- a/deps/v8/test/intl/relative-time-format/resolved-options.js
+++ b/deps/v8/test/intl/relative-time-format/resolved-options.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
-
let rtf = new Intl.RelativeTimeFormat();
// Test 1.4.5 Intl.RelativeTimeFormat.prototype.resolvedOptions ()
// The default style is 'long'
diff --git a/deps/v8/test/intl/relative-time-format/supported-locale.js b/deps/v8/test/intl/relative-time-format/supported-locale.js
index b24cfb27af..5c177b4777 100644
--- a/deps/v8/test/intl/relative-time-format/supported-locale.js
+++ b/deps/v8/test/intl/relative-time-format/supported-locale.js
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-intl-relative-time-format
assertEquals(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
"Intl.RelativeTimeFormat.supportedLocalesOf should be a function");
diff --git a/deps/v8/test/intl/testcfg.py b/deps/v8/test/intl/testcfg.py
index 8cf26f1a61..66da4c77b5 100644
--- a/deps/v8/test/intl/testcfg.py
+++ b/deps/v8/test/intl/testcfg.py
@@ -33,23 +33,16 @@ from testrunner.objects import testcase
ENV_PATTERN = re.compile(r"//\s+Environment Variables:(.*)")
+
+class TestLoader(testsuite.JSTestLoader):
+ @property
+ def excluded_files(self):
+ return {"assert.js", "utils.js"}
+
+
class TestSuite(testsuite.TestSuite):
- def ListTests(self):
- tests = []
- for dirname, dirs, files in os.walk(self.root):
- for dotted in [x for x in dirs if x.startswith('.')]:
- dirs.remove(dotted)
- dirs.sort()
- files.sort()
- for filename in files:
- if (filename.endswith(".js") and filename != "assert.js" and
- filename != "utils.js"):
- fullpath = os.path.join(dirname, filename)
- relpath = fullpath[len(self.root) + 1 : -3]
- testname = relpath.replace(os.path.sep, "/")
- test = self._create_test(testname)
- tests.append(test)
- return tests
+ def _test_loader_class(self):
+ return TestLoader
def _test_class(self):
return TestCase