[BUGFIX release] Ensure initializers can augment customEvents. #12056
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The initial refactor for Ember 1.11 to use
ApplicationInstance
broke the ability for an initializer to specifycustomEvents
. This meant for example that addons could not add their own events to the listing before theEventDispatcher
was setup.The reason for the failure, was that we were copying
customEvents
from the application uponinit
of theApplicationInstance
(which is done before initializers are called), and never looking atapplication.customEvents
again.The fix is to avoid eagerly copying from
application.customEvents
when the application instance is created, and to do it just before setting up the event dispatcher.Also, apparently
packages/tests/application_lifecycle.js
test file was never running because it didn't have the proper test file suffix.Fixes #10534.