Skip to content

Commit

Permalink
Merge pull request #1318 from glimmerjs/bugfix/ensure-hash-works-with…
Browse files Browse the repository at this point in the history
…-custom-tags

Ensure hash works with custom tags
  • Loading branch information
rwjblue authored May 27, 2021
2 parents 3a70a19 + ed371df commit b9036f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/@glimmer/runtime/lib/helpers/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ import { combine, Tag, tagFor, track } from '@glimmer/validator';
import { deprecate } from '@glimmer/global-context';
import { internalHelper } from './internal-helper';

function tagForKey(hash: CapturedNamedArguments, key: string): Tag {
return track(() => valueForRef(hash[key]));
function tagForKey(namedArgs: CapturedNamedArguments, key: string): Tag {
return track(() => {
if (key in namedArgs) {
valueForRef(namedArgs[key]);
}
});
}

let hashProxyFor: (args: CapturedNamedArguments) => Record<string, unknown>;
Expand Down

0 comments on commit b9036f3

Please sign in to comment.