main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
755 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var uncurryThis = require('../internals/function-uncurry-this');
|
---|
4 | var aDataView = require('../internals/a-data-view');
|
---|
5 | var toIndex = require('../internals/to-index');
|
---|
6 | var toUint8Clamped = require('../internals/to-uint8-clamped');
|
---|
7 |
|
---|
8 | // eslint-disable-next-line es/no-typed-arrays -- safe
|
---|
9 | var setUint8 = uncurryThis(DataView.prototype.setUint8);
|
---|
10 |
|
---|
11 | // `DataView.prototype.setUint8Clamped` method
|
---|
12 | // https://github.com/tc39/proposal-dataview-get-set-uint8clamped
|
---|
13 | $({ target: 'DataView', proto: true, forced: true }, {
|
---|
14 | setUint8Clamped: function setUint8Clamped(byteOffset, value) {
|
---|
15 | aDataView(this);
|
---|
16 | var offset = toIndex(byteOffset);
|
---|
17 | return setUint8(this, offset, toUint8Clamped(value));
|
---|
18 | }
|
---|
19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.