Skip to content

Commit

Permalink
capture render tree can fail if args cannot be obtained
Browse files Browse the repository at this point in the history
this currently happens on https://meta.discourse.org/
when checking with ember-inspector and not being logged in.
  • Loading branch information
patricklx authored Oct 12, 2023
1 parent 68d371b commit 49489e9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/@glimmer/runtime/lib/vm/arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,24 @@ export function reifyNamed(named: CapturedNamedArguments) {
let reified = dict();

for (const [key, value] of Object.entries(named)) {
reified[key] = valueForRef(value);
try {
reified[key] = valueForRef(value);
} catch(e) {
reified[key] = e;
}
}

return reified;
}

export function reifyPositional(positional: CapturedPositionalArguments) {
return positional.map(valueForRef);
return positional.map((p) => {
try {
return valueForRef(p);
} catch(e) {
return e;
}
});
}

export function reifyArgs(args: CapturedArguments) {
Expand Down

0 comments on commit 49489e9

Please sign in to comment.