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 May 11, 2021
1 parent a582209 commit fd561de
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions packages/@glimmer/runtime/lib/helpers/hash.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { DEBUG } from '@glimmer/env';
import { CapturedArguments, CapturedNamedArguments, Dict } from '@glimmer/interfaces';
import { setCustomTagFor } from '@glimmer/manager';
import { createConstRef, Reference, valueForRef } from '@glimmer/reference';
Expand Down Expand Up @@ -44,14 +43,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 fd561de

Please sign in to comment.