Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move DataView get / set Uint8Clamped methods proposal to stage 2 #1374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
- `Math.sumPrecise`
- Moved to stage 3, [October 2024 TC39 meeting](https://x.com/robpalmer2/status/1843829675036160179)
- Added `/actual/` namespace entries, unconditional forced replacement changed to feature detection
- [`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
- 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)
- `self` descriptor [is fixed](https://github.com/denoland/deno/issues/24683) in Deno 1.46.0
Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,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 @@ -2846,6 +2846,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 @@ -3068,27 +3089,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