-
-
Notifications
You must be signed in to change notification settings - Fork 282
/
polyfill.ts
38 lines (34 loc) · 1.06 KB
/
polyfill.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import {
getBigInt64,
getBigUint64,
setBigInt64,
setBigUint64,
} from "./pure.js";
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "getBigInt64")) {
DataView.prototype.getBigInt64 = function (byteOffset, littleEndian) {
return getBigInt64(this, byteOffset, littleEndian);
};
}
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "getBigUint64")) {
DataView.prototype.getBigUint64 = function (byteOffset, littleEndian) {
return getBigUint64(this, byteOffset, littleEndian);
};
}
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "setBigInt64")) {
DataView.prototype.setBigInt64 = function (
byteOffset,
value,
littleEndian,
) {
setBigInt64(this, byteOffset, value, littleEndian);
};
}
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "setBigUint64")) {
DataView.prototype.setBigUint64 = function (
byteOffset,
value,
littleEndian,
) {
setBigUint64(this, byteOffset, value, littleEndian);
};
}