Move polyfill for codePointAt to String prototype.

This method belongs on the prototype not the String object.
This commit is contained in:
Brendan Dahl 2019-08-16 14:32:43 -07:00
parent 02dcd20263
commit c8129b8787

View File

@ -227,10 +227,10 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
// Provides support for String.codePointAt in legacy browsers.
// Support: IE11.
(function checkStringCodePointAt() {
if (String.codePointAt) {
if (String.prototype.codePointAt) {
return;
}
String.codePointAt = require('core-js/fn/string/code-point-at');
require('core-js/fn/string/code-point-at');
})();
// Provides support for String.fromCodePoint in legacy browsers.