Skip to content

Commit 88ffcb9

Browse files
authored
Remove TypedArray.fill polyfill (#23835)
The minimum supported browser versions all now support TypedArray.fill: https://caniuse.com/mdn-javascript_builtins_typedarray_fill
1 parent 27a7406 commit 88ffcb9

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/lib/libcore.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,7 @@ addToLibrary({
5252
return '0x' + ptr.toString(16).padStart(8, '0');
5353
},
5454

55-
$zeroMemory: (address, size) => {
56-
#if LEGACY_VM_SUPPORT
57-
if (!HEAPU8.fill) {
58-
for (var i = 0; i < size; i++) {
59-
HEAPU8[address + i] = 0;
60-
}
61-
return;
62-
}
63-
#endif
64-
HEAPU8.fill(0, address, address + size);
65-
},
55+
$zeroMemory: (ptr, size) => HEAPU8.fill(0, ptr, ptr + size),
6656

6757
#if SAFE_HEAP
6858
// Trivial wrappers around runtime functions that make these symbols available

0 commit comments

Comments
 (0)