Bug 1923907 - Part 18: Add missing Intl checks in non262 tests. r=spidermonkey-reviewers,jandem

That way the tests can pass when building with `--without-intl-api`.

Differential Revision: https://phabricator.services.mozilla.com/D225260
This commit is contained in:
André Bargull 2024-10-11 14:28:45 +00:00
parent cf3cff3d64
commit f13f7790f1
16 changed files with 27 additions and 4 deletions

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget||!this.hasOwnProperty('Intl')) -- Windows doesn't accept IANA names for the TZ env variable
const testCases = [
{

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(winWidget||!xulRuntime.shell)
// |reftest| skip-if(winWidget||!xulRuntime.shell||!this.hasOwnProperty('Intl'))
assertEq(/^(PST|PDT)$/.test(getTimeZone()), true,
"The default time zone is set to PST8PDT for all jstests (when run in the shell)");

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
const defaultLocale = "en";
const defaultCalendar = new Intl.DateTimeFormat(defaultLocale).resolvedOptions().calendar;

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
const defaultLocale = "en";
const defaultNumberingSystem = new Intl.DateTimeFormat(defaultLocale).resolvedOptions().numberingSystem;

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
for (let [numberingSystem, {digits, algorithmic}] of Object.entries(numberingSystems)) {
if (algorithmic) {
// We don't yet support algorithmic numbering systems.

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
const defaultLocale = "en";
const defaultNumberingSystem = new Intl.NumberFormat(defaultLocale).resolvedOptions().numberingSystem;

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
const defaultLocale = "en";
const defaultNumberingSystem = new Intl.RelativeTimeFormat(defaultLocale).resolvedOptions().numberingSystem;

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(!this.getSelfHostedValue)
// |reftest| skip-if(!this.getSelfHostedValue||!this.hasOwnProperty('Intl'))
const startOfUnicodeExtensions = getSelfHostedValue("startOfUnicodeExtensions");
const endOfUnicodeExtensions = getSelfHostedValue("endOfUnicodeExtensions");

View File

@ -11,7 +11,7 @@ function assertThrowsWithMessage(f, msg) {
try {
f();
} catch (exc) {
if (exc.message.normalize() === msg.normalize())
if (exc.message === msg)
return;
fullmsg = `Assertion failed: expected message '${msg}', got '${exc.message}'`;

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
var BUGNUMBER = 1338779;
var summary = "Non-Latin1 to Latin1 mapping in ignoreCase.";

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
var BUGNUMBER = 1135377;
var summary = "Implement RegExp unicode flag -- ignoreCase flag for CharacterClass.";

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
var BUGNUMBER = 1135377;
var summary = "Implement RegExp unicode flag -- ignoreCase flag with non-ascii to ascii map.";

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
var BUGNUMBER = 1135377;
var summary = "Implement RegExp unicode flag -- ignoreCase flag with character class escape.";

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
var BUGNUMBER = 1338373;
var summary = "Word boundary should match U+017F and U+212A in unicode+ignoreCase.";

View File

@ -1,3 +1,5 @@
// |reftest| skip-if(!this.hasOwnProperty('Intl'))
/* Generated by make_unicode.py DO NOT MODIFY */
/* Unicode version: 15.0.0 */

View File

@ -1141,6 +1141,7 @@ def make_icase_test(version, folding_tests, codepoint_table):
file_name = "../tests/non262/RegExp/unicode-ignoreCase.js"
with io.open(file_name, mode="w", encoding="utf-8") as test_icase:
test_icase.write("// |reftest| skip-if(!this.hasOwnProperty('Intl'))\n\n")
test_icase.write(warning_message)
test_icase.write(unicode_version_message.format(version))
test_icase.write(public_domain)