Skip to content

Commit

Permalink
Fix Float16Array Proxy set handler to not affect setter properties
Browse files Browse the repository at this point in the history
  • Loading branch information
petamoriken committed Oct 15, 2021
1 parent c3ac77a commit e92d4e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Float16Array.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ const handler = Object.freeze({
return Reflect.get(target, key, receiver);
},

set(target, key, value) {
set(target, key, value, receiver) {
if (isCanonicalIntegerIndexString(key) && hasOwn(target, key)) {
return Reflect.set(target, key, roundToFloat16Bits(value));
}

return Reflect.set(target, key, value);
return Reflect.set(target, key, value, receiver);
},
});

Expand Down

0 comments on commit e92d4e0

Please sign in to comment.