-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2770: Implement Intl.getCanonicalLocales #2818
Fix #2770: Implement Intl.getCanonicalLocales #2818
Conversation
@dotnet-bot test Ubuntu static_ubuntu_linux_release please |
Ping @bterlson @kunalspathak @tcare |
test/Intl/GetCanonicalLocales.js
Outdated
assert.areEqual(Intl.getCanonicalLocales({ '0': 'en-us' }), [], "Objects which might look like arrays are fine, but treated as 0 length."); | ||
assert.areEqual(Intl.getCanonicalLocales({ 'a': 'b' }), [], "Arbitrary Objects are fine, treated as 0-length arrays."); | ||
|
||
// TODO test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we leaving this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sorry about the TODOs. I wanted to get this out for review. I'll add more tests to cover the gaps in the next iteration.
test/Intl/GetCanonicalLocales.js
Outdated
assert.areEqual(Intl.getCanonicalLocales('xx-zzz'), ['xx-zzz'], ""); // TODO double-check canonicalization routine, v8 makes this 'zzz' | ||
assert.areEqual(Intl.getCanonicalLocales('xx-abcd-zz'), ['xx-Abcd-ZZ'], | ||
"xx-Abcd-ZZ: [unsupported language xx] using [unsupported script Abcd] as used in [unsupported locale ZZ]"); | ||
// TODO -u- extension keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -1,4 +1,4 @@ | |||
//------------------------------------------------------------------------------------------------------- | |||
//------------------------------------------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be awards for bug fixes this severe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol. Like I said, drive by cleanup. :P
@@ -51,7 +51,7 @@ var tests = [ | |||
} | |||
catch (e) { | |||
if (!(e instanceof RangeError)) { | |||
fail("Incorrect exception was thrown."); | |||
assert.fail("Incorrect exception was thrown."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/fyi @veler
e4a6dc6
to
ca56a2b
Compare
Note: I'm porting this PR to |
Fixing CI in #2962 |
Nevermind -- after talking offline with @digitalinfinity this is not needed in release/2.0. Retargeting back to master. |
ca56a2b
to
a7c298a
Compare
a379e5b
to
578717d
Compare
* NumberFormatOptions.js: Move test which is the same everywhere to the platform-common test. * DateTimeFormatOptions.js: Fix fail -> assert.fail. * Remove explicit -Intl from tests. They are tagged Intl already and if the tests are running then Intl will be on by default in that configuration.
578717d
to
fe530a8
Compare
Merge pull request #2818 from dilijev:intl-getCanonicalLocales https://tc39.github.io/ecma402/#sec-intl.getcanonicallocales https://tc39.github.io/ecma402/#sec-canonicalizelocalelist See: tc39/ecma402#78 tc39/ecma402#46 Fixes #2770.
https://tc39.github.io/ecma402/#sec-intl.getcanonicallocales
https://tc39.github.io/ecma402/#sec-canonicalizelocalelist
See:
tc39/ecma402#78
tc39/ecma402#46
Fixes #2770.