Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Add setOwner support #14

Merged
merged 4 commits into from May 13, 2020
Merged

Conversation

jamesarosen
Copy link
Contributor

@jamesarosen
Copy link
Contributor Author

jamesarosen commented Dec 8, 2016

The failing test is because ember-test-helpers calls setOwner with container.owner, but this polyfill doesn't tell the container that its owner is the FakeOwner.

Some ideas:

  • change the getOwner and setOwner polyfills to set object.container.owner. It might be good to also change getOwner to check for object.container.owner before creating a new FakeOwner
  • change the setOwner to no-op when owner is null, though this is different from the real implementation, which allows setting to null

We may need to change ember-test-helpers to call setOwner(this.context, getOwner(this)) instead of pulling the owner off the container directly.

Or we might be able to have this polyfill change the way Containers are created to give themselves an owner.

jamesarosen and others added 3 commits May 13, 2020 16:01
Prior to this, we created a new function _every_ time you called
`Ember.getOwner` / `Ember.setOwner`.
@rwjblue
Copy link
Member

rwjblue commented May 13, 2020

@mmun - OK, CI is happy, the tests look good, any objections to landing?

@rwjblue rwjblue merged commit cac5a80 into ember-polyfills:master May 13, 2020
@rwjblue rwjblue changed the title add setOwner support Add setOwner support May 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants