-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Test Web Compatibility requirements for implementation-defined locale-specific ECMAScript APIs #41760
Merged
Merged
Test Web Compatibility requirements for implementation-defined locale-specific ECMAScript APIs #41760
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<!-- | ||
Copyright (C) 2023 the V8 project authors. All rights reserved. | ||
This code is governed by the BSD license found in the LICENSE file. | ||
--> | ||
<title>Web Compatibility requirements for implementation-defined locale-specific JavaScript APIs</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
|
||
test(t => { // https://bugs.chromium.org/p/chromium/issues/detail?id=1414292 | ||
|
||
const date = new Date('2022-12-31T23:59:42'); | ||
const localeString = date.toLocaleString('en-US'); | ||
|
||
// No U+202F NARROW NO-BREAK SPACE must be present. | ||
assert_false(localeString.includes('\u202F')); | ||
// The character between the time and AM/PM should be U+0020 SPACE. | ||
assert_regexp_match(localeString, /:\d\d:\d\d\x20[AP]M/); | ||
|
||
}, '`Date.prototype.toLocaleString` produces U+0020 instead of U+202F for `en-US` locale'); | ||
|
||
test(t => { // https://bugs.chromium.org/p/chromium/issues/detail?id=1414292 | ||
|
||
const date = new Date('2022-12-31T23:59:42'); | ||
const formatter = new Intl.DateTimeFormat('en', {timeStyle: 'long'}) | ||
const formattedString = formatter.format(date); | ||
|
||
// No U+202F NARROW NO-BREAK SPACE must be present. | ||
assert_false(formattedString.includes('\u202F')); | ||
// The character between the time and AM/PM should be U+0020 SPACE. | ||
assert_regexp_match(formattedString, /:\d\d:\d\d\x20[AP]M/); | ||
|
||
}, '`Intl.DateTimeFormat.prototype.format` produces U+0020 instead of U+202F for `en` locale'); | ||
|
||
</script> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note that I intentionally kept both the file name and the title generic enough, to allow us to add more historical examples of known Web Compat breakages to this file in the future.