angular/packages/core/src/view
Vikram Subramanian 6b859daea4 fix(core): stop reusing provider definitions across NgModuleRef instances (#25022)
Fixes #25018.

Instantiating a NgModuleRef from NgModuleFactory reuses the NgModuleDefinition if it is already present. However the NgModuleDefinition has a providers array which modified when tree shakable providers are instantiated. This corrupts the provider definitions the next time the same factory is used to create a new NgModuleRef - Two provider definitions can end up with the same index anf the injector could potentially return a completely wrong object for a provider token.

This scenario is more likely on the server where the same NgModuleFactory is reused across requests.

The fix clones the cached NgModuleDefinition so that any tree shakable providers added later do not affect the cached copy.

PR Close #25022
2018-07-23 08:13:29 -07:00
..
element.ts refactor(core): move sanitization into core (#22540) 2018-03-07 18:24:06 -08:00
entrypoint.ts fix(core): stop reusing provider definitions across NgModuleRef instances (#25022) 2018-07-23 08:13:29 -07:00
errors.ts feat: introduce source maps for templates (#15011) 2017-03-14 09:16:15 -07:00
index.ts feat(compiler): introduce TestBed.overrideTemplateUsingTestingModule 2017-11-06 14:12:30 -08:00
ng_content.ts refactor(core): add a checkIndex to the compiler view nodes 2017-10-04 14:55:54 -07:00
ng_module.ts fix(core): mark NgModule as not the root if APP_ROOT is set to false (#24814) 2018-07-10 11:09:36 -07:00
provider.ts fix: consistently rewrite Injector to INJECTOR (#23008) 2018-03-28 09:14:32 -07:00
pure_expression.ts refactor(core): add a checkIndex to the compiler view nodes 2017-10-04 14:55:54 -07:00
query.ts refactor(core): add a checkIndex to the compiler view nodes 2017-10-04 14:55:54 -07:00
refs.ts build(bazel): Turning on strictPropertyInitialization for Angular. (#24572) 2018-06-25 07:57:13 -07:00
services.ts feat(ivy): @NgModule -> ngInjectorDef compilation (#22458) 2018-03-16 12:57:11 -07:00
text.ts refactor(core): add a checkIndex to the compiler view nodes 2017-10-04 14:55:54 -07:00
types.ts feat: tree-shakeable providers API updates (#22655) 2018-03-13 09:28:05 -07:00
util.ts fix(core): fix retrieving the binding name when an expression changes (#21814) 2018-01-26 15:34:47 -08:00
view.ts fix(core): ensure init lifecycle events are called (#20258) 2017-11-10 13:47:39 -08:00
view_attach.ts style: typos fixed - https://github.com/vlajos/misspell-fixer (#22975) 2018-03-27 14:51:53 -04:00