Skip to content

Commit 81874c4

Browse files
committed
move DataView get / set Uint8Clamped methods proposal to stage 2
1 parent db01e9f commit 81874c4

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
- `Math.clamp`
4343
- Moved to stage 2, [May 2025 TC39 meeting](https://github.com/tc39/proposal-math-clamp/commit/a005f28a6a03e175b9671de1c8c70dd5b7b08c2d)
4444
- Removed a `RangeError` if `min <= max` or `+0` min and `-0` max, [tc39/proposal-math-clamp/#22](https://github.com/tc39/proposal-math-clamp/issues/22)
45+
- [`DataView` get / set `Uint8Clamped` methods proposal](https://github.com/tc39/proposal-dataview-get-set-uint8clamped):
46+
- Methods:
47+
- `DataView.prototype.getUint8Clamped`
48+
- `DataView.prototype.setUint8Clamped`
49+
- Moved to stage 2, October 2024 TC39 meeting
4550
- Always check regular expression flags by `flags` getter [PR](https://github.com/tc39/ecma262/pull/2791). Native methods are not fixed, only own implementation updated for:
4651
- `RegExp.prototype[@@match]`
4752
- `RegExp.prototype[@@replace]`

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
177177
- [`AsyncIterator` helpers](#asynciterator-helpers)
178178
- [`Iterator.range`](#iteratorrange)
179179
- [`Array.isTemplateObject`](#arrayistemplateobject)
180+
- [`DataView` get / set `Uint8Clamped` methods](#dataview-get-set-iint8clamped-methods)
180181
- [`Math.clamp`](#mathclamp)
181182
- [`String.dedent`](#stringdedent)
182183
- [`Symbol` predicates](#symbol-predicates)
@@ -188,7 +189,6 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
188189
- [`compositeKey` and `compositeSymbol`](#compositekey-and-compositesymbol)
189190
- [`Array` filtering](#array-filtering)
190191
- [`Array` deduplication](#array-deduplication)
191-
- [`DataView` get / set `Uint8Clamped` methods](#dataview-get-set-iint8clamped-methods)
192192
- [`Number.fromString`](#numberfromstring)
193193
- [`String.cooked`](#stringcooked)
194194
- [`String.prototype.codePoints`](#stringprototypecodepoints)
@@ -2978,6 +2978,27 @@ core-js(-pure)/full/array/is-template-object
29782978
console.log(Array.isTemplateObject((it => it)`qwe${ 123 }asd`)); // => true
29792979
```
29802980

2981+
##### [`DataView` get / set `Uint8Clamped` methods](https://github.com/tc39/proposal-dataview-get-set-uint8clamped)[](#index)
2982+
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)
2983+
```ts
2984+
class DataView {
2985+
getUint8Clamped(offset: any): uint8
2986+
setUint8Clamped(offset: any, value: any): void;
2987+
}
2988+
```
2989+
[*CommonJS entry points:*](#commonjs-api)
2990+
```
2991+
core-js/proposals/data-view-get-set-uint8-clamped
2992+
core-js/full/dataview/get-uint8-clamped
2993+
core-js/full/dataview/set-uint8-clamped
2994+
```
2995+
[Examples](https://tinyurl.com/2h4zv8sw):
2996+
```js
2997+
const view = new DataView(new ArrayBuffer(1));
2998+
view.setUint8Clamped(0, 100500);
2999+
console.log(view.getUint8Clamped(0)); // => 255
3000+
```
3001+
29813002
##### [`Math.clamp`](https://github.com/tc39/proposal-math-clamp)[](#index)
29823003
Module [`esnext.math.clamp`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.math.clamp.js)
29833004
```ts
@@ -3280,27 +3301,6 @@ core-js/full/typed-array/unique-by
32803301
].uniqueBy(it => it.uid); // => [{ id: 1, uid: 10000 }, { id: 3, uid: 10001 }]
32813302
```
32823303

3283-
##### [`DataView` get / set `Uint8Clamped` methods](https://github.com/tc39/proposal-dataview-get-set-uint8clamped)[⬆](#index)
3284-
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)
3285-
```ts
3286-
class DataView {
3287-
getUint8Clamped(offset: any): uint8
3288-
setUint8Clamped(offset: any, value: any): void;
3289-
}
3290-
```
3291-
[*CommonJS entry points:*](#commonjs-api)
3292-
```
3293-
core-js/proposals/data-view-get-set-uint8-clamped
3294-
core-js/full/dataview/get-uint8-clamped
3295-
core-js/full/dataview/set-uint8-clamped
3296-
```
3297-
[Examples](https://tinyurl.com/2h4zv8sw):
3298-
```js
3299-
const view = new DataView(new ArrayBuffer(1));
3300-
view.setUint8Clamped(0, 100500);
3301-
console.log(view.getUint8Clamped(0)); // => 255
3302-
```
3303-
33043304
##### [`Number.fromString`](https://github.com/tc39/proposal-number-fromstring)[⬆](#index)
33053305
Module [`esnext.number.from-string`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.number.from-string.js)
33063306
```ts

packages/core-js/stage/1.js

Lines changed: 0 additions & 1 deletion
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/keys-composition');
1110
require('../proposals/math-extensions');
1211
require('../proposals/math-signbit');

packages/core-js/stage/2.js

Lines changed: 1 addition & 0 deletions
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/extractors');
78
require('../proposals/iterator-range');
89
require('../proposals/string-dedent');

0 commit comments

Comments
 (0)