Skip to content

Commit

Permalink
replace broken URL constructor in Safari, close #656
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Oct 2, 2019
1 parent 4d12e15 commit 8699b9a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
- Updated `Map#upsert` [stage 1 proposal](https://github.com/thumbsupep/proposal-upsert)
- `Map#updateOrInsert` renamed to `Map#upsert`
- Added `WeakMap#upsert`
- Added a workaround for iOS Safari MessageChannel + bfcache bug, [#624](https://github.com/zloirock/core-js/issues/624)
- Added a workaround for Chrome 33 / Android 4.4.4 `Promise` bug, [#640](https://github.com/zloirock/core-js/issues/640)
- Added a workaround for iOS Safari MessageChannel + bfcache bug, [#624](https://github.com/zloirock/core-js/issues/624)
- Added a workaround for Chrome 33 / Android 4.4.4 `Promise` bug, [#640](https://github.com/zloirock/core-js/issues/640)
- Replaced broken `URL` constructor in Safari, [#656](https://github.com/zloirock/core-js/issues/656)
- Added compat data for Node to 12.11, FF 69 and Phantom 1.9
- `Math.hypot` marked as not supported in Chrome 77 since [a bug in this method](https://bugs.chromium.org/p/v8/issues/detail?id=9546) was not fixed before the stable Chrome 77 release
- Fixed unnecessary exposing on `Symbol.matchAll` in `esnext.string.match-all`, [#626](https://github.com/zloirock/core-js/issues/626)
Expand Down
2 changes: 0 additions & 2 deletions packages/core-js-compat/src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1472,13 +1472,11 @@ const data = {
chrome: '71',
node: '10.0',
firefox: '57',
safari: '12.0',
},
'web.url-search-params': {
chrome: '63',
node: '10.0',
firefox: '57',
safari: '12.0',
},
};

Expand Down
4 changes: 3 additions & 1 deletion packages/core-js/internals/native-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ module.exports = !fails(function () {
// not punycoded in Edge
|| new URL('http://тест').host !== 'xn--e1aybc'
// not escaped in Chrome 62-
|| new URL('http://a#б').hash !== '#%D0%B1';
|| new URL('http://a#б').hash !== '#%D0%B1'
// throws in Safari
|| new URL('http://x', undefined).host !== 'x';
});
3 changes: 2 additions & 1 deletion tests/compat/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ var URL_AND_URL_SEARCH_PARAMS_SUPPORT = function () {
&& new URL('https://a@b').username === 'a'
&& new URLSearchParams(new URLSearchParams('a=b')).get('a') === 'b'
&& new URL('http://тест').host === 'xn--e1aybc'
&& new URL('http://a#б').hash === '#%D0%B1';
&& new URL('http://a#б').hash === '#%D0%B1'
&& new URL('http://x', undefined).host === 'x';
};

var OBJECT_PROTOTYPE_ACCESSORS_SUPPORT = function () {
Expand Down

0 comments on commit 8699b9a

Please sign in to comment.