Skip to content

Commit 8c0bd93

Browse files
committed
move Uint8Array to / from base64 and hex to stable ES
1 parent cd78095 commit 8c0bd93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+448
-322
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
## Changelog
22
##### Unreleased
3+
- [`Uint8Array` to / from base64 and hex proposal](https://github.com/tc39/proposal-arraybuffer-base64):
4+
- Built-ins:
5+
- `Uint8Array.fromBase64`
6+
- `Uint8Array.fromHex`
7+
- `Uint8Array.prototype.setFromBase64`
8+
- `Uint8Array.prototype.setFromHex`
9+
- `Uint8Array.prototype.toBase64`
10+
- `Uint8Array.prototype.toHex`
11+
- Moved to stable ES, July 2025 TC39 meeting
12+
- Added `es.` namespace modules, `/es/` and `/stable/` namespaces entries
13+
- Added detection of a Webkit bug: `Uint8Array` fromBase64 / setFromBase64 does not throw an error on incorrect length of base64 string
314
- [`Math.sumPrecise` proposal](https://github.com/tc39/proposal-math-sum):
415
- Built-ins:
516
- `Math.sumPrecise`
617
- Moved to stable ES, [July 2025 TC39 meeting](https://github.com/tc39/proposals/commit/2616413ace9074bfd444adee9501fae4c8d66fcb)
718
- Added `es.` namespace module, `/es/` and `/stable/` namespaces entries
819
- Added missing dependencies to some entries of static `Iterator` methods
9-
- Added detection of Webkit bug: `Uint8Array` fromBase64 / setFromBase64 does not throw an error on incorrect length of base64 string
1020
- Compat data improvements:
1121
- [`Uint8Array` to / from base64 and hex proposal](https://github.com/tc39/proposal-arraybuffer-base64) features marked as [supported from V8 ~ Chromium 140](https://issues.chromium.org/issues/42204568#comment37)
1222
- `%TypedArray%.prototype.with` marked as fixed in Safari 26.0

README.md

Lines changed: 43 additions & 35 deletions
Large diffs are not rendered by default.

packages/core-js-compat/src/data.mjs

Lines changed: 58 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,6 +2295,46 @@ export const data = {
22952295
// It should truncate a negative fractional index to zero, but instead throws an error
22962296
safari: '26.0', // '16.4',
22972297
},
2298+
'es.uint8-array.from-base64': {
2299+
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2300+
// bun: '1.1.22',
2301+
chrome: '140',
2302+
firefox: '133',
2303+
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2304+
// safari: '18.2',
2305+
},
2306+
'es.uint8-array.from-hex': {
2307+
bun: '1.1.22',
2308+
chrome: '140',
2309+
firefox: '133',
2310+
safari: '18.2',
2311+
},
2312+
'es.uint8-array.set-from-base64': {
2313+
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2314+
// bun: '1.1.22',
2315+
chrome: '140',
2316+
firefox: '133',
2317+
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2318+
// safari: '18.2',
2319+
},
2320+
'es.uint8-array.set-from-hex': {
2321+
bun: '1.1.22',
2322+
chrome: '140',
2323+
firefox: '133',
2324+
safari: '18.2',
2325+
},
2326+
'es.uint8-array.to-base64': {
2327+
bun: '1.1.22',
2328+
chrome: '140',
2329+
firefox: '133',
2330+
safari: '18.2',
2331+
},
2332+
'es.uint8-array.to-hex': {
2333+
bun: '1.1.22',
2334+
chrome: '140',
2335+
firefox: '133',
2336+
safari: '18.2',
2337+
},
22982338
'es.unescape': {
22992339
chrome: '1',
23002340
firefox: '1',
@@ -2810,46 +2850,18 @@ export const data = {
28102850
},
28112851
// TODO: Remove from `core-js@4`
28122852
'esnext.typed-array.with': null,
2813-
'esnext.uint8-array.from-base64': {
2814-
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2815-
// bun: '1.1.22',
2816-
chrome: '140',
2817-
firefox: '133',
2818-
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2819-
// safari: '18.2',
2820-
},
2821-
'esnext.uint8-array.from-hex': {
2822-
bun: '1.1.22',
2823-
chrome: '140',
2824-
firefox: '133',
2825-
safari: '18.2',
2826-
},
2827-
'esnext.uint8-array.set-from-base64': {
2828-
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2829-
// bun: '1.1.22',
2830-
chrome: '140',
2831-
firefox: '133',
2832-
// Because of a bug: it doesn't throw an error on incorrect length of base64 string
2833-
// safari: '18.2',
2834-
},
2835-
'esnext.uint8-array.set-from-hex': {
2836-
bun: '1.1.22',
2837-
chrome: '140',
2838-
firefox: '133',
2839-
safari: '18.2',
2840-
},
2841-
'esnext.uint8-array.to-base64': {
2842-
bun: '1.1.22',
2843-
chrome: '140',
2844-
firefox: '133',
2845-
safari: '18.2',
2846-
},
2847-
'esnext.uint8-array.to-hex': {
2848-
bun: '1.1.22',
2849-
chrome: '140',
2850-
firefox: '133',
2851-
safari: '18.2',
2852-
},
2853+
// TODO: Remove from `core-js@4`
2854+
'esnext.uint8-array.from-base64': null,
2855+
// TODO: Remove from `core-js@4`
2856+
'esnext.uint8-array.from-hex': null,
2857+
// TODO: Remove from `core-js@4`
2858+
'esnext.uint8-array.set-from-base64': null,
2859+
// TODO: Remove from `core-js@4`
2860+
'esnext.uint8-array.set-from-hex': null,
2861+
// TODO: Remove from `core-js@4`
2862+
'esnext.uint8-array.to-base64': null,
2863+
// TODO: Remove from `core-js@4`
2864+
'esnext.uint8-array.to-hex': null,
28532865
'esnext.weak-map.delete-all': {
28542866
},
28552867
'esnext.weak-map.from': {
@@ -3181,6 +3193,12 @@ export const renamed = new Map([
31813193
['esnext.typed-array.to-reversed', 'es.typed-array.to-reversed'],
31823194
['esnext.typed-array.to-sorted', 'es.typed-array.to-sorted'],
31833195
['esnext.typed-array.with', 'es.typed-array.with'],
3196+
['esnext.uint8-array.from-base64', 'es.uint8-array.from-base64'],
3197+
['esnext.uint8-array.from-hex', 'es.uint8-array.from-hex'],
3198+
['esnext.uint8-array.set-from-base64', 'es.uint8-array.set-from-base64'],
3199+
['esnext.uint8-array.set-from-hex', 'es.uint8-array.set-from-hex'],
3200+
['esnext.uint8-array.to-base64', 'es.uint8-array.to-base64'],
3201+
['esnext.uint8-array.to-hex', 'es.uint8-array.to-hex'],
31843202
['web.url', 'web.url.constructor'],
31853203
['web.url-search-params', 'web.url-search-params.constructor'],
31863204
]);

packages/core-js-compat/src/modules-by-versions.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,11 @@ export default {
304304
],
305305
3.45: [
306306
'es.math.sum-precise',
307+
'es.uint8-array.from-base64',
308+
'es.uint8-array.from-hex',
309+
'es.uint8-array.set-from-base64',
310+
'es.uint8-array.set-from-hex',
311+
'es.uint8-array.to-base64',
312+
'es.uint8-array.to-hex',
307313
],
308314
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty

0 commit comments

Comments
 (0)