Skip to content

Commit

Permalink
Use prototype property in Float16Array brand check
Browse files Browse the repository at this point in the history
  • Loading branch information
petamoriken committed Sep 5, 2021
1 parent 1aa9fc0 commit 31a9d9a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Float16Array.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ function hasFloat16ArrayBrand(target) {
return false;
}

const constructor = target.constructor;
const prototype = Object.getPrototypeOf(target);
if (!isObjectLike(prototype)) {
return false;
}

const constructor = prototype.constructor;
if (constructor === undefined) {
return false;
}
Expand Down

0 comments on commit 31a9d9a

Please sign in to comment.