Skip to content

Commit

Permalink
Polyfill: Add comment explaining ASCIILowercase AO
Browse files Browse the repository at this point in the history
  • Loading branch information
justingrant authored and ptomato committed Apr 19, 2023
1 parent 1aa6b80 commit 3b2baa7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions polyfill/lib/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5419,6 +5419,12 @@ export function IsBuiltinCalendar(id) {
}

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

0 comments on commit 3b2baa7

Please sign in to comment.