Skip to content

Commit 91d180d

Browse files
committed
drop IE11 support in Decoder.ts
1 parent 1c91d8e commit 91d180d

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/Decoder.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,7 @@ const HEAD_BYTE_REQUIRED = -1;
3838
const EMPTY_VIEW = new DataView(new ArrayBuffer(0));
3939
const EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);
4040

41-
// IE11: Hack to support IE11.
42-
// IE11: Drop this hack and just use RangeError when IE11 is obsolete.
43-
export const DataViewIndexOutOfBoundsError: typeof Error = (() => {
44-
try {
45-
// IE11: The spec says it should throw RangeError,
46-
// IE11: but in IE11 it throws TypeError.
47-
EMPTY_VIEW.getInt8(0);
48-
} catch (e: any) {
49-
return e.constructor;
50-
}
51-
throw new Error("never reached");
52-
})();
53-
41+
export const DataViewIndexOutOfBoundsError = RangeError;
5442
const MORE_DATA = new DataViewIndexOutOfBoundsError("Insufficient data");
5543

5644
const sharedCachedKeyDecoder = new CachedKeyDecoder();

0 commit comments

Comments
 (0)