Fix IE11 split (#5056)

This commit is contained in:
BrennanConroy 2018-12-17 10:47:01 -08:00 committed by Mikael Mengistu
parent 439a9598e8
commit d368da3df1
1 changed files with 2 additions and 1 deletions

View File

@ -17,7 +17,8 @@ if (!Uint8Array.prototype.indexOf) {
if (!Uint8Array.prototype.slice) {
Object.defineProperty(Uint8Array.prototype, "slice", {
// wrap the slice in Uint8Array so it looks like a Uint8Array.slice call
value: (start?: number, end?: number) => new Uint8Array(Array.prototype.slice(start, end)),
// tslint:disable-next-line:object-literal-shorthand
value: function(start?: number, end?: number) { return new Uint8Array(Array.prototype.slice.call(this, start, end)); },
writable: true,
});
}