There is no reason to implement it in JS.
Created attachment 418932 [details] Patch
Comment on attachment 418932 [details] Patch Fantastic! r=me as long as tests pass.
commit-queue failed to commit attachment 418932 [details] to WebKit repository.
Committed r272187: <https://trac.webkit.org/changeset/272187> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418932 [details].
<rdar://problem/73859208>