This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
fix(injector): allow multiple loading of function modules #7863
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.
TEST PR Just verifying that this passes on IE8
Change HashMap to give $$hashKey also for functions so it will be possible to
load multiple module function instances. In order to prevent problem in
angular's test suite, added an option to HashMap to maintain its own id
counter and added cleanup of $$hashKey from all module functions after each
test.
Before this CL, functions were added to the HashMap via toString(), which
could potentially return the same value for different actual instances of a
function. This corrects this behaviour by ensuring that functions are mapped
with hashKeys, and ensuring that hashKeys are removed from functions and
objects at the end of tests.
In addition to these changes, the injector uses its own set of UIDs in order
to prevent confusingly breaking tests which expect scopes or ng-repeated items
to have specific hash keys.
Closes #7255