Skip to content

Commit

Permalink
Remove unnecessary property descriptor assertion from hash
Browse files Browse the repository at this point in the history
Removes an unnecessary property descriptor assertion, hash should work
like a normal object (unlike args proxies) and so it should be allowed
to read the property descriptors on it.
  • Loading branch information
Chris Garrett committed Apr 27, 2021
1 parent a582209 commit f5717fd
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/@glimmer/runtime/lib/helpers/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ class HashProxy implements ProxyHandler<Record<string, unknown>> {
}

getOwnPropertyDescriptor(target: {}, prop: string | number) {
if (DEBUG && !(prop in this.named)) {
throw new Error(
`args proxies do not have real property descriptors, so you should never need to call getOwnPropertyDescriptor yourself. This code exists for enumerability, such as in for-in loops and Object.keys(). Attempted to get the descriptor for \`${String(
prop
)}\``
);
}

if (prop in this.named) {
return {
enumerable: true,
Expand Down

0 comments on commit f5717fd

Please sign in to comment.