Skip to content

Commit 3b2baa7

Browse files
justingrantptomato
authored andcommitted
Polyfill: Add comment explaining ASCIILowercase AO
Suggested by @12wrigja in https://github.com/js-temporal/temporal-polyfill/pull/244/files#r1169245765
1 parent 1aa6b80 commit 3b2baa7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

polyfill/lib/ecmascript.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5419,6 +5419,12 @@ export function IsBuiltinCalendar(id) {
54195419
}
54205420

54215421
export function ASCIILowercase(str) {
5422+
// The spec defines this operation distinct from String.prototype.lowercase,
5423+
// so we'll follow the spec here. Note that nasty security issues that can
5424+
// happen for some use cases if you're comparing case-modified non-ASCII
5425+
// values. For example, Turkish's "I" character was the source of a security
5426+
// issue involving "file://" URLs. See
5427+
// https://haacked.com/archive/2012/07/05/turkish-i-problem-and-why-you-should-care.aspx/.
54225428
return Call(StringPrototypeReplace, str, [
54235429
/[A-Z]/g,
54245430
(l) => {

0 commit comments

Comments
 (0)