Skip to content

Commit

Permalink
Remove String.fromCodePoint polyfill for es6 (#11713)
Browse files Browse the repository at this point in the history
  • Loading branch information
RblSb authored Jul 25, 2024
1 parent 3fc2152 commit 5bb151a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions std/js/_std/String.hx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
return untyped __define_feature__('String.fromCharCode', js.Syntax.code("String.fromCodePoint({0})", code));
}

#if (js_es <= 5)
static function __init__():Void {
untyped __feature__('String.fromCharCode',
js.Syntax.code("if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); }"));
}
#end
}

0 comments on commit 5bb151a

Please sign in to comment.