Defensive arguments for glimmer-factory

This commit is contained in:
Michael Lange 2021-02-22 17:33:10 -08:00
parent 51092a886c
commit b6d31aeee3

View file

@ -24,7 +24,7 @@ export default function setupGlimmerComponentFactory(hooks, componentKey) {
// Look up the component class in the glimmer component manager and return a
// function to construct components as if they were functions.
function glimmerComponentInstantiator(owner, componentKey) {
return args => {
return (args = {}) => {
const componentManager = owner.lookup('component-manager:glimmer');
const componentClass = owner.factoryFor(`component:${componentKey}`).class;
return componentManager.createComponent(componentClass, { named: args });