Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari (Mac and iOS) does not permit functions named "𝝙". Does this break the spec?

Tags:

javascript

Safari (Mac and iOS) does not permit functions named "𝝙" (U+1D6AB, Mathematical Bold Greek Capital Delta).

AFAIK, Valid identifiers must have the derived core property "ID_Start".

"𝝙" appears to meet this criteria.

Does this break the spec?

function 𝝙(a, b) {
  return a-b
}
console.log(𝝙(2, 1)) // 1 in Chrome and FF; "Script error" in Safari

Interestingly, Safari does accept "Δ" (U+0394, Greek Capital Letter Delta) as a valid identifier:

function Δ(a, b) {
  return a-b
}
console.log(Δ(2, 1)) // 1 in Chrome and FF and Safari

I think it might be something to do with the former character being in the Astral Plane.

like image 736
Ben Aston Avatar asked Apr 18 '20 14:04

Ben Aston


1 Answers

I think this is the bug. It was fixed in March and (presumably) hasn't made it out into released versions of browsers.

like image 154
Ben Aston Avatar answered Oct 05 '22 04:10

Ben Aston