diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ff804b4b9c..4ccb4654a886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - `Uint8Array.fromHex` - `Uint8Array.prototype.toBase64` - `Uint8Array.prototype.toHex` +- Relaxed some specific cases of [`Number.fromString`](https://github.com/tc39/proposal-number-fromstring) validation before clarification of [proposal-number-fromstring/24](https://github.com/tc39/proposal-number-fromstring/issues/24) - Fixed `@@toStringTag` property descriptors on DOM collections, [#1312](https://github.com/zloirock/core-js/issues/1312) - Fixed the order of arguments validation in `Array` iteration methods, [#1313](https://github.com/zloirock/core-js/issues/1313) - Some minor `atob` / `btoa` improvements diff --git a/packages/core-js/modules/esnext.number.from-string.js b/packages/core-js/modules/esnext.number.from-string.js index 59d0ae023e66..f3851ae29df5 100644 --- a/packages/core-js/modules/esnext.number.from-string.js +++ b/packages/core-js/modules/esnext.number.from-string.js @@ -35,7 +35,7 @@ $({ target: 'Number', stat: true, forced: true }, { var parts = split(string, '.'); var mathNum = $parseInt(parts[0], R); if (parts.length > 1) mathNum += $parseInt(parts[1], R) / pow(R, parts[1].length); - if (numberToString(mathNum, R) !== string) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION); + if (R === 10 && numberToString(mathNum, R) !== string) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION); return sign * mathNum; } });