Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9338519
es.typed-array.subarray.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
923 B
Subscribers
None
es.typed-array.subarray.js
View Options
'use strict'
;
var
ArrayBufferViewCore
=
require
(
'../internals/array-buffer-view-core'
);
var
toLength
=
require
(
'../internals/to-length'
);
var
toAbsoluteIndex
=
require
(
'../internals/to-absolute-index'
);
var
typedArraySpeciesConstructor
=
require
(
'../internals/typed-array-species-constructor'
);
var
aTypedArray
=
ArrayBufferViewCore
.
aTypedArray
;
var
exportTypedArrayMethod
=
ArrayBufferViewCore
.
exportTypedArrayMethod
;
// `%TypedArray%.prototype.subarray` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray
exportTypedArrayMethod
(
'subarray'
,
function
subarray
(
begin
,
end
)
{
var
O
=
aTypedArray
(
this
);
var
length
=
O
.
length
;
var
beginIndex
=
toAbsoluteIndex
(
begin
,
length
);
var
C
=
typedArraySpeciesConstructor
(
O
);
return
new
C
(
O
.
buffer
,
O
.
byteOffset
+
beginIndex
*
O
.
BYTES_PER_ELEMENT
,
toLength
((
end
===
undefined
?
length
:
toAbsoluteIndex
(
end
,
length
))
-
beginIndex
)
);
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 4 2025, 8:53 AM (6 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3357608
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment