Skip to content

Commit 9299074

Browse files
committed
Add Uin8Array.slice() polyfill
1 parent 6444522 commit 9299074

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pre-worker.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ if (!String.prototype.endsWith) {
77
};
88
}
99

10+
if (!Uint8Array.prototype.slice) {
11+
Object.defineProperty(Uint8Array.prototype, 'slice', {
12+
value: function (begin, end)
13+
{
14+
return new Uint8Array(this.subarray(begin, end));
15+
}
16+
});
17+
}
18+
19+
1020
var hasNativeConsole = typeof console !== "undefined";
1121

1222
// implement console methods if they're missing

0 commit comments

Comments
 (0)