Skip to content

Commit

Permalink
Update polyfill.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy authored and yume-chan committed Mar 21, 2024
1 parent 250fbb1 commit ffa511e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libraries/dataview-bigint-polyfill/src/polyfill.ts
Expand Up @@ -5,19 +5,19 @@ import {
setBigUint64,
} from "./pure.js";

if (!("getBigInt64" in DataView)) {
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "getBigInt64")) {
DataView.prototype.getBigInt64 = function (byteOffset, littleEndian) {
return getBigInt64(this, byteOffset, littleEndian);
};
}

if (!("getBigUint64" in DataView)) {
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "getBigUint64")) {
DataView.prototype.getBigUint64 = function (byteOffset, littleEndian) {
return getBigUint64(this, byteOffset, littleEndian);
};
}

if (!("setBigInt64" in DataView)) {
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "setBigInt64")) {
DataView.prototype.setBigInt64 = function (
byteOffset,
value,
Expand All @@ -27,7 +27,7 @@ if (!("setBigInt64" in DataView)) {
};
}

if (!("setBigUint64" in DataView)) {
if (!Object.prototype.hasOwnProperty.call(DataView.prototype, "setBigUint64")) {
DataView.prototype.setBigUint64 = function (
byteOffset,
value,
Expand Down

0 comments on commit ffa511e

Please sign in to comment.