Skip to content

Commit

Permalink
move DataView get / set Uint8Clamped methods proposal to stage 2
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Oct 7, 2024
1 parent e40d8b9 commit 4820c5e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog
##### Unreleased
- [`DataView` get / set `Uint8Clamped` methods proposal](https://github.com/tc39/proposal-dataview-get-set-uint8clamped):
- Methods:
- `DataView.prototype.getUint8Clamped`
- `DataView.prototype.setUint8Clamped`
- Moved to stage 2, October 2024 TC39 meeting
- Fixed `core-js-pure/actual|full/promise/try` entries for the callback arguments support
- Compat data improvements:
- [`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)
Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
- [`Array.isTemplateObject`](#arrayistemplateobject)
- [`String.dedent`](#stringdedent)
- [`Symbol` predicates](#symbol-predicates)
- [`DataView` get / set `Uint8Clamped` methods](#dataview-get-set-iint8clamped-methods)
- [Stage 1 proposals](#stage-1-proposals)
- [`Observable`](#observable)
- [New collections methods](#new-collections-methods)
- [`.of` and `.from` methods on collection constructors](#of-and-from-methods-on-collection-constructors)
- [`compositeKey` and `compositeSymbol`](#compositekey-and-compositesymbol)
- [`Array` filtering](#array-filtering)
- [`Array` deduplication](#array-deduplication)
- [`DataView` get / set `Uint8Clamped` methods](#dataview-get-set-iint8clamped-methods)
- [`Number.fromString`](#numberfromstring)
- [`String.cooked`](#stringcooked)
- [`String.prototype.codePoints`](#stringprototypecodepoints)
Expand Down Expand Up @@ -2819,6 +2819,27 @@ Symbol.isWellKnownSymbol(Symbol.iterator); // => true
Symbol.isWellKnownSymbol(Symbol('key')); // => false
```

##### [`DataView` get / set `Uint8Clamped` methods](https://github.com/tc39/proposal-dataview-get-set-uint8clamped)[⬆](#index)
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)
```ts
class DataView {
getUint8Clamped(offset: any): uint8
setUint8Clamped(offset: any, value: any): void;
}
```
[*CommonJS entry points:*](#commonjs-api)
```
core-js/proposals/data-view-get-set-uint8-clamped
core-js/full/dataview/get-uint8-clamped
core-js/full/dataview/set-uint8-clamped
```
[Examples](https://tinyurl.com/2h4zv8sw):
```js
const view = new DataView(new ArrayBuffer(1));
view.setUint8Clamped(0, 100500);
console.log(view.getUint8Clamped(0)); // => 255
```

#### Stage 1 proposals[⬆](#index)
[*CommonJS entry points:*](#commonjs-api)
```
Expand Down Expand Up @@ -3041,27 +3062,6 @@ core-js/full/typed-array/unique-by
].uniqueBy(it => it.uid); // => [{ id: 1, uid: 10000 }, { id: 3, uid: 10001 }]
```
##### [`DataView` get / set `Uint8Clamped` methods](https://github.com/tc39/proposal-dataview-get-set-uint8clamped)[⬆](#index)
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)
```ts
class DataView {
getUint8Clamped(offset: any): uint8
setUint8Clamped(offset: any, value: any): void;
}
```
[*CommonJS entry points:*](#commonjs-api)
```
core-js/proposals/data-view-get-set-uint8-clamped
core-js/full/dataview/get-uint8-clamped
core-js/full/dataview/set-uint8-clamped
```
[Examples](https://tinyurl.com/2h4zv8sw):
```js
const view = new DataView(new ArrayBuffer(1));
view.setUint8Clamped(0, 100500);
console.log(view.getUint8Clamped(0)); // => 255
```
##### [`Number.fromString`](https://github.com/tc39/proposal-number-fromstring)[⬆](#index)
Module [`esnext.number.from-string`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.number.from-string.js)
```ts
Expand Down
1 change: 0 additions & 1 deletion packages/core-js/stage/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require('../proposals/array-last');
require('../proposals/array-unique');
require('../proposals/collection-methods');
require('../proposals/collection-of-from');
require('../proposals/data-view-get-set-uint8-clamped');
require('../proposals/extractors');
require('../proposals/keys-composition');
require('../proposals/math-extensions');
Expand Down
1 change: 1 addition & 0 deletions packages/core-js/stage/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var parent = require('./2.7');

require('../proposals/array-is-template-object');
require('../proposals/async-iterator-helpers');
require('../proposals/data-view-get-set-uint8-clamped');
require('../proposals/iterator-range');
require('../proposals/map-upsert-stage-2');
require('../proposals/string-dedent');
Expand Down

0 comments on commit 4820c5e

Please sign in to comment.