-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX beta] Ensure
container
can still be provided to .create
.
In Ember versions until 2.3.0 it was common to provide a `container` property (if needed) when creating instances of a factory manually. This might look like: ``` let Foo = container.lookupFactory('model:foo'); let instance = Foo.create({ container }); ``` Many addons did this (examples include ember-cp-validations and ember-data). Our initial implementation of the deprecated `container` property on extendable factories used `Object.defineProperty` to ensure calling `instance.container` returned the correct value. Unfortunately, we only defined a getter which means calling `Foo.create({ container });` triggers the following error: ``` Cannot set property container of [object Object] which has only a getter ``` This change adds a setter (with an appropriate deprecation) to prevent triggering an error.
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters