Skip to content

Commit

Permalink
Merge pull request #12557 from rwjblue/ensure-owner-is-set
Browse files Browse the repository at this point in the history
Ensure owner is set during component creation.
  • Loading branch information
rwjblue committed Nov 4, 2015
2 parents cb93860 + 08e2727 commit 1ae26eb
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import LegacyEmberComponent from 'ember-views/components/component';
import GlimmerComponent from 'ember-htmlbars/glimmer-component';
import extractPositionalParams from 'ember-htmlbars/utils/extract-positional-params';
import { symbol } from 'ember-metal/utils';
import { getOwner, setOwner } from 'container/owner';
import { setOwner } from 'container/owner';

// These symbols will be used to limit link-to's public API surface area.
export let HAS_BLOCK = symbol('HAS_BLOCK');
Expand Down Expand Up @@ -233,16 +233,12 @@ export function createComponent(_component, isAngleBracket, props, renderNode, e
props._isAngleBracket = true;
}

setOwner(props, env.owner);
props.renderer = props.parentView ? props.parentView.renderer : env.owner.lookup('renderer:-dom');
props._viewRegistry = props.parentView ? props.parentView._viewRegistry : env.owner.lookup('-view-registry:main');

const component = _component.create(props);

// for the fallback case
if (!getOwner(component)) {
setOwner(component, env.owner);
}

if (props.parentView) {
props.parentView.appendChild(component);

Expand Down

0 comments on commit 1ae26eb

Please sign in to comment.