typedarray.prototype.slice 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/implementation.js +16 -16
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [v1.0.3](https://github.com/es-shims/TypedArray.prototype.slice/compare/v1.0.2...v1.0.3) - 2024-03-15
|
|
9
|
+
|
|
10
|
+
### Commits
|
|
11
|
+
|
|
12
|
+
- [Deps] update `es-abstract` [`9067824`](https://github.com/es-shims/TypedArray.prototype.slice/commit/906782435b34ec0ce54a9dd613974601e08b5c2e)
|
|
13
|
+
- [Deps] update `call-bind`, `typed-array-buffer`, `typed-array-byte-offset` [`33da086`](https://github.com/es-shims/TypedArray.prototype.slice/commit/33da086e39deedf551abd8398fdf5d189cbe3d77)
|
|
14
|
+
- [Dev Deps] update `available-typed-arrays`, `tape` [`2f8d038`](https://github.com/es-shims/TypedArray.prototype.slice/commit/2f8d038eb15b8ac3206c2368036b988b01e5c417)
|
|
15
|
+
|
|
8
16
|
## [v1.0.2](https://github.com/es-shims/TypedArray.prototype.slice/compare/v1.0.1...v1.0.2) - 2024-02-06
|
|
9
17
|
|
|
10
18
|
### Commits
|
package/implementation.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
var $TypeError = require('es-errors/type');
|
|
4
4
|
|
|
5
|
-
var Get = require('es-abstract/
|
|
6
|
-
var GetValueFromBuffer = require('es-abstract/
|
|
7
|
-
var IsDetachedBuffer = require('es-abstract/
|
|
8
|
-
var max = require('es-abstract/
|
|
9
|
-
var min = require('es-abstract/
|
|
10
|
-
var Set = require('es-abstract/
|
|
11
|
-
var SetValueInBuffer = require('es-abstract/
|
|
12
|
-
var ToIntegerOrInfinity = require('es-abstract/
|
|
13
|
-
var ToString = require('es-abstract/
|
|
14
|
-
var TypedArrayElementSize = require('es-abstract/
|
|
15
|
-
var TypedArrayElementType = require('es-abstract/
|
|
16
|
-
var TypedArraySpeciesCreate = require('es-abstract/
|
|
17
|
-
var ValidateTypedArray = require('es-abstract/
|
|
5
|
+
var Get = require('es-abstract/2024/Get');
|
|
6
|
+
var GetValueFromBuffer = require('es-abstract/2024/GetValueFromBuffer');
|
|
7
|
+
var IsDetachedBuffer = require('es-abstract/2024/IsDetachedBuffer');
|
|
8
|
+
var max = require('es-abstract/2024/max');
|
|
9
|
+
var min = require('es-abstract/2024/min');
|
|
10
|
+
var Set = require('es-abstract/2024/Set');
|
|
11
|
+
var SetValueInBuffer = require('es-abstract/2024/SetValueInBuffer');
|
|
12
|
+
var ToIntegerOrInfinity = require('es-abstract/2024/ToIntegerOrInfinity');
|
|
13
|
+
var ToString = require('es-abstract/2024/ToString');
|
|
14
|
+
var TypedArrayElementSize = require('es-abstract/2024/TypedArrayElementSize');
|
|
15
|
+
var TypedArrayElementType = require('es-abstract/2024/TypedArrayElementType');
|
|
16
|
+
var TypedArraySpeciesCreate = require('es-abstract/2024/TypedArraySpeciesCreate');
|
|
17
|
+
var ValidateTypedArray = require('es-abstract/2024/ValidateTypedArray');
|
|
18
18
|
|
|
19
19
|
var typedArrayBuffer = require('typed-array-buffer');
|
|
20
20
|
var typedArrayByteOffset = require('typed-array-byte-offset');
|
|
@@ -24,7 +24,7 @@ var typedArrayByteOffset = require('typed-array-byte-offset');
|
|
|
24
24
|
module.exports = function slice(start, end) {
|
|
25
25
|
var O = this; // step 1
|
|
26
26
|
|
|
27
|
-
ValidateTypedArray(O); // step 2
|
|
27
|
+
ValidateTypedArray(O, 'SEQ-CST'); // step 2
|
|
28
28
|
|
|
29
29
|
// 3. Let len be O.[[ArrayLength]].
|
|
30
30
|
var len = O.length; // steps 3
|
|
@@ -71,8 +71,8 @@ module.exports = function slice(start, end) {
|
|
|
71
71
|
var targetByteIndex = typedArrayByteOffset(A); // step 14.d.vii
|
|
72
72
|
var limit = targetByteIndex + (count * elementSize); // step 14.d.viii
|
|
73
73
|
while (targetByteIndex < limit) { // step 14.d.ix
|
|
74
|
-
var value = GetValueFromBuffer(srcBuffer, srcByteIndex, '
|
|
75
|
-
SetValueInBuffer(targetBuffer, targetByteIndex, '
|
|
74
|
+
var value = GetValueFromBuffer(srcBuffer, srcByteIndex, 'UINT8', true, 'UNORDERED'); // step 14.d.ix.1
|
|
75
|
+
SetValueInBuffer(targetBuffer, targetByteIndex, 'UINT8', value, true, 'UNORDERED'); // step 14.d.ix.2
|
|
76
76
|
srcByteIndex += 1; // step 14.d.ix.3
|
|
77
77
|
targetByteIndex += 1; // step 14.d.ix.4
|
|
78
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typedarray.prototype.slice",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "ES spec-compliant shim for TypedArray.prototype.slice",
|
|
5
5
|
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
6
6
|
"funding": {
|
|
@@ -53,19 +53,19 @@
|
|
|
53
53
|
"es-shim API"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"call-bind": "^1.0.
|
|
56
|
+
"call-bind": "^1.0.7",
|
|
57
57
|
"define-properties": "^1.2.1",
|
|
58
|
-
"es-abstract": "^1.
|
|
58
|
+
"es-abstract": "^1.23.0",
|
|
59
59
|
"es-errors": "^1.3.0",
|
|
60
|
-
"typed-array-buffer": "^1.0.
|
|
61
|
-
"typed-array-byte-offset": "^1.0.
|
|
60
|
+
"typed-array-buffer": "^1.0.2",
|
|
61
|
+
"typed-array-byte-offset": "^1.0.2"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@es-shims/api": "^2.4.2",
|
|
65
65
|
"@ljharb/eslint-config": "^21.1.0",
|
|
66
66
|
"aud": "^2.0.4",
|
|
67
67
|
"auto-changelog": "^2.4.0",
|
|
68
|
-
"available-typed-arrays": "^1.0.
|
|
68
|
+
"available-typed-arrays": "^1.0.7",
|
|
69
69
|
"eclint": "^2.8.1",
|
|
70
70
|
"es-value-fixtures": "^1.4.2",
|
|
71
71
|
"eslint": "=8.8.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"nyc": "^10.3.2",
|
|
79
79
|
"object-inspect": "^1.13.1",
|
|
80
80
|
"safe-publish-latest": "^2.0.0",
|
|
81
|
-
"tape": "^5.7.
|
|
81
|
+
"tape": "^5.7.5"
|
|
82
82
|
},
|
|
83
83
|
"testling": {
|
|
84
84
|
"files": "test/index.js"
|