Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with normalization in primary (non-fallback) registry. #113

Merged
merged 1 commit into from Oct 21, 2015

Commits on Oct 21, 2015

  1. Fix issues with normalization in primary (non-fallback) registry.

    When Ember internally builds a registry via
    `Ember.Application.buildRegistry` it aliases
    `registry.normalizeFullName` to `resolver.normalize` and this becomes
    the fallback registry.  Then Ember creates the primary registry (in
    `ApplicationInstance`'s constructor) and provides the primary registry's
    resolver (which is `function() { }` to allow for registration overrides)
    with the original (aka from the `fallback` registry)
    `normalizeFullName`.
    
    Unfortunately, when this was initially implemented in ember-test-helpers
    this nuance was missed and we subsequently had many issues reported for
    things that the normalize method would have fixed (specifically
    converting `service:fooBar` to `service:foo-bar` before looking up).
    
    It would be better IMO if `Ember.Registry` could be made aware of this
    resolver shenanigans, and provide a hook that can be called to
    "wrapFallbackRegistry" or somesuch so that ember-test-helpers (and
    `ApplicationInstance` in Ember) do not need to know about these "magic"
    methods.
    rwjblue committed Oct 21, 2015
    Copy the full SHA
    d4f0266 View commit details
    Browse the repository at this point in the history