Skip to content

Commit 0b1b761

Browse files
committed
move DataView get / set Uint8Clamped methods proposal to stage 2
1 parent 005628e commit 0b1b761

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
- `Iterator.prototype[@@toStringTag]`
1919
- Moved to stable ES, [October 2024 TC39 meeting](https://github.com/tc39/proposal-iterator-helpers/issues/284#event-14549961807)
2020
- Added `es.` namespace modules, `/es/` and `/stable/` namespaces entries
21+
- [`DataView` get / set `Uint8Clamped` methods proposal](https://github.com/tc39/proposal-dataview-get-set-uint8clamped):
22+
- Methods:
23+
- `DataView.prototype.getUint8Clamped`
24+
- `DataView.prototype.setUint8Clamped`
25+
- Moved to stage 2, October 2024 TC39 meeting
2126
- Fixed `core-js-pure/actual|full/promise/try` entries for the callback arguments support
2227
- Compat data improvements:
2328
- [`JSON.parse` source text access proposal](https://github.com/tc39/proposal-json-parse-with-source) features marked as [supported from FF132](https://bugzilla.mozilla.org/show_bug.cgi?id=1913085)

README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
175175
- [`Array.isTemplateObject`](#arrayistemplateobject)
176176
- [`String.dedent`](#stringdedent)
177177
- [`Symbol` predicates](#symbol-predicates)
178+
- [`DataView` get / set `Uint8Clamped` methods](#dataview-get-set-iint8clamped-methods)
178179
- [Stage 1 proposals](#stage-1-proposals)
179180
- [`Observable`](#observable)
180181
- [New collections methods](#new-collections-methods)
181182
- [`.of` and `.from` methods on collection constructors](#of-and-from-methods-on-collection-constructors)
182183
- [`compositeKey` and `compositeSymbol`](#compositekey-and-compositesymbol)
183184
- [`Array` filtering](#array-filtering)
184185
- [`Array` deduplication](#array-deduplication)
185-
- [`DataView` get / set `Uint8Clamped` methods](#dataview-get-set-iint8clamped-methods)
186186
- [`Number.fromString`](#numberfromstring)
187187
- [`String.cooked`](#stringcooked)
188188
- [`String.prototype.codePoints`](#stringprototypecodepoints)
@@ -2842,6 +2842,27 @@ Symbol.isWellKnownSymbol(Symbol.iterator); // => true
28422842
Symbol.isWellKnownSymbol(Symbol('key')); // => false
28432843
```
28442844

2845+
##### [`DataView` get / set `Uint8Clamped` methods](https://github.com/tc39/proposal-dataview-get-set-uint8clamped)[⬆](#index)
2846+
Modules [`esnext.data-view.get-uint8-clamped`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.data-view.get-uint8-clamped.js) and [`esnext.data-view.set-uint8-clamped`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.data-view.set-uint8-clamped.js)
2847+
```ts
2848+
class DataView {
2849+
getUint8Clamped(offset: any): uint8
2850+
setUint8Clamped(offset: any, value: any): void;
2851+
}
2852+
```
2853+
[*CommonJS entry points:*](#commonjs-api)
2854+
```
2855+
core-js/proposals/data-view-get-set-uint8-clamped
2856+
core-js/full/dataview/get-uint8-clamped
2857+
core-js/full/dataview/set-uint8-clamped
2858+
```
2859+
[Examples](https://tinyurl.com/2h4zv8sw):
2860+
```js
2861+
const view = new DataView(new ArrayBuffer(1));
2862+
view.setUint8Clamped(0, 100500);
2863+
console.log(view.getUint8Clamped(0)); // => 255
2864+
```
2865+
28452866
#### Stage 1 proposals[⬆](#index)
28462867
[*CommonJS entry points:*](#commonjs-api)
28472868
```
@@ -3064,27 +3085,6 @@ core-js/full/typed-array/unique-by
30643085
].uniqueBy(it => it.uid); // => [{ id: 1, uid: 10000 }, { id: 3, uid: 10001 }]
30653086
```
30663087
3067-
##### [`DataView` get / set `Uint8Clamped` methods](https://github.com/tc39/proposal-dataview-get-set-uint8clamped)[⬆](#index)
3068-
Modules [`esnext.data-view.get-uint8-clamped`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.data-view.get-uint8-clamped.js) and [`esnext.data-view.set-uint8-clamped`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.data-view.set-uint8-clamped.js)
3069-
```ts
3070-
class DataView {
3071-
getUint8Clamped(offset: any): uint8
3072-
setUint8Clamped(offset: any, value: any): void;
3073-
}
3074-
```
3075-
[*CommonJS entry points:*](#commonjs-api)
3076-
```
3077-
core-js/proposals/data-view-get-set-uint8-clamped
3078-
core-js/full/dataview/get-uint8-clamped
3079-
core-js/full/dataview/set-uint8-clamped
3080-
```
3081-
[Examples](https://tinyurl.com/2h4zv8sw):
3082-
```js
3083-
const view = new DataView(new ArrayBuffer(1));
3084-
view.setUint8Clamped(0, 100500);
3085-
console.log(view.getUint8Clamped(0)); // => 255
3086-
```
3087-
30883088
##### [`Number.fromString`](https://github.com/tc39/proposal-number-fromstring)[⬆](#index)
30893089
Module [`esnext.number.from-string`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.number.from-string.js)
30903090
```ts

packages/core-js/stage/1.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ require('../proposals/array-last');
66
require('../proposals/array-unique');
77
require('../proposals/collection-methods');
88
require('../proposals/collection-of-from');
9-
require('../proposals/data-view-get-set-uint8-clamped');
109
require('../proposals/extractors');
1110
require('../proposals/keys-composition');
1211
require('../proposals/math-extensions');

packages/core-js/stage/2.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var parent = require('./2.7');
33

44
require('../proposals/array-is-template-object');
55
require('../proposals/async-iterator-helpers');
6+
require('../proposals/data-view-get-set-uint8-clamped');
67
require('../proposals/iterator-range');
78
require('../proposals/map-upsert-stage-2');
89
require('../proposals/string-dedent');

0 commit comments

Comments
 (0)