mirror of
https://github.com/tc39/test262.git
synced 2025-09-26 03:28:50 +02:00
String.prototype.toLocale{Lower,Upper}Case validates all locale identifiers
This commit is contained in:
parent
409001b61b
commit
b5aac6bc84
25
test/intl402/String/prototype/toLocaleLowerCase/validates-all-locale-identifiers.js
vendored
Normal file
25
test/intl402/String/prototype/toLocaleLowerCase/validates-all-locale-identifiers.js
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2025 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sup-string.prototype.tolocalelowercase
|
||||
description: >
|
||||
All locale identifiers are validated, not just the first one.
|
||||
info: |
|
||||
String.prototype.toLocaleLowerCase ( [ locales ] )
|
||||
...
|
||||
3. Return ? TransformCase(S, locales, lower).
|
||||
|
||||
TransformCase ( S, locales, targetCase )
|
||||
1. Let requestedLocales be ? CanonicalizeLocaleList(locales).
|
||||
...
|
||||
---*/
|
||||
|
||||
var locales = [
|
||||
"en-US",
|
||||
"this is not a valid locale",
|
||||
];
|
||||
|
||||
assert.throws(RangeError, function() {
|
||||
"".toLocaleLowerCase(locales);
|
||||
});
|
25
test/intl402/String/prototype/toLocaleUpperCase/validates-all-locale-identifiers.js
vendored
Normal file
25
test/intl402/String/prototype/toLocaleUpperCase/validates-all-locale-identifiers.js
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2025 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sup-string.prototype.tolocaleuppercase
|
||||
description: >
|
||||
All locale identifiers are validated, not just the first one.
|
||||
info: |
|
||||
String.prototype.toLocaleUpperCase ( [ locales ] )
|
||||
...
|
||||
3. Return ? TransformCase(S, locales, upper).
|
||||
|
||||
TransformCase ( S, locales, targetCase )
|
||||
1. Let requestedLocales be ? CanonicalizeLocaleList(locales).
|
||||
...
|
||||
---*/
|
||||
|
||||
var locales = [
|
||||
"en-US",
|
||||
"this is not a valid locale",
|
||||
];
|
||||
|
||||
assert.throws(RangeError, function() {
|
||||
"".toLocaleUpperCase(locales);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user