Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9338575
es.typed-array.fill.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
es.typed-array.fill.js
View Options
'use strict'
;
var
ArrayBufferViewCore
=
require
(
'../internals/array-buffer-view-core'
);
var
$fill
=
require
(
'../internals/array-fill'
);
var
toBigInt
=
require
(
'../internals/to-big-int'
);
var
classof
=
require
(
'../internals/classof'
);
var
call
=
require
(
'../internals/function-call'
);
var
uncurryThis
=
require
(
'../internals/function-uncurry-this'
);
var
fails
=
require
(
'../internals/fails'
);
var
aTypedArray
=
ArrayBufferViewCore
.
aTypedArray
;
var
exportTypedArrayMethod
=
ArrayBufferViewCore
.
exportTypedArrayMethod
;
var
slice
=
uncurryThis
(
''
.
slice
);
// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18
var
CONVERSION_BUG
=
fails
(
function
()
{
var
count
=
0
;
// eslint-disable-next-line es/no-typed-arrays -- safe
new
Int8Array
(
2
).
fill
({
valueOf
:
function
()
{
return
count
++
;
}
});
return
count
!==
1
;
});
// `%TypedArray%.prototype.fill` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
exportTypedArrayMethod
(
'fill'
,
function
fill
(
value
/* , start, end */
)
{
var
length
=
arguments
.
length
;
aTypedArray
(
this
);
var
actualValue
=
slice
(
classof
(
this
),
0
,
3
)
===
'Big'
?
toBigInt
(
value
)
:
+
value
;
return
call
(
$fill
,
this
,
actualValue
,
length
>
1
?
arguments
[
1
]
:
undefined
,
length
>
2
?
arguments
[
2
]
:
undefined
);
},
CONVERSION_BUG
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 4 2025, 8:56 AM (7 w, 18 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3398333
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment