diff --git a/modules/angular2/src/core/application.js b/modules/angular2/src/core/application.js index 2601bbfb65..313c71db06 100644 --- a/modules/angular2/src/core/application.js +++ b/modules/angular2/src/core/application.js @@ -57,7 +57,7 @@ function _injectorBindings(appComponentType): List { }, [appComponentAnnotatedTypeToken, appDocumentToken]), bind(appViewToken).toAsyncFactory((changeDetection, compiler, injector, appElement, - appComponentAnnotatedType, strategy, eventManager, reflector) => { + appComponentAnnotatedType, strategy, eventManager) => { return compiler.compile(appComponentAnnotatedType.type).then( (protoView) => { var appProtoView = ProtoView.createRootProtoView(protoView, appElement, @@ -66,12 +66,12 @@ function _injectorBindings(appComponentType): List { // The light Dom of the app element is not considered part of // the angular application. Thus the context and lightDomInjector are // empty. - var view = appProtoView.instantiate(null, eventManager, reflector); + var view = appProtoView.instantiate(null, eventManager); view.hydrate(injector, null, new Object()); return view; }); }, [ChangeDetection, Compiler, Injector, appElementToken, appComponentAnnotatedTypeToken, - ShadowDomStrategy, EventManager, Reflector]), + ShadowDomStrategy, EventManager]), bind(appChangeDetectorToken).toFactory((rootView) => rootView.changeDetector, [appViewToken]), diff --git a/modules/angular2/src/core/compiler/element_injector.js b/modules/angular2/src/core/compiler/element_injector.js index 4906e880d8..2f49375645 100644 --- a/modules/angular2/src/core/compiler/element_injector.js +++ b/modules/angular2/src/core/compiler/element_injector.js @@ -10,7 +10,7 @@ import {ViewContainer} from 'angular2/src/core/compiler/view_container'; import {NgElement} from 'angular2/src/core/dom/element'; import {Directive, onChange, onDestroy} from 'angular2/src/core/annotations/annotations' import {BindingPropagationConfig} from 'angular2/src/core/compiler/binding_propagation_config' -import {Reflector} from 'angular2/src/reflection/reflection'; +import {reflector} from 'angular2/src/reflection/reflection'; var _MAX_DIRECTIVE_CONSTRUCTION_COUNTER = 10; @@ -270,8 +270,8 @@ export class ProtoElementInjector { } } - instantiate(parent:ElementInjector, host:ElementInjector, reflector: Reflector):ElementInjector { - return new ElementInjector(this, parent, host, reflector); + instantiate(parent:ElementInjector, host:ElementInjector):ElementInjector { + return new ElementInjector(this, parent, host); } directParent(): ProtoElementInjector { @@ -324,10 +324,8 @@ export class ElementInjector extends TreeNode { _obj9:any; _preBuiltObjects; _constructionCounter; - _refelector: Reflector; - constructor(proto:ProtoElementInjector, parent:ElementInjector, host:ElementInjector, - reflector: Reflector) { + constructor(proto:ProtoElementInjector, parent:ElementInjector, host:ElementInjector) { super(parent); if (isPresent(parent) && isPresent(host)) { throw new BaseException('Only either parent or host is allowed'); @@ -340,7 +338,6 @@ export class ElementInjector extends TreeNode { } this._proto = proto; - this._refelector = reflector; //we cannot call clearDirectives because fields won't be detected this._preBuiltObjects = null; @@ -518,7 +515,7 @@ export class ElementInjector extends TreeNode { _buildPropSetter(dep) { var ngElement = this._getPreBuiltObjectByKeyId(StaticKeys.instance().ngElementId); var domElement = ngElement.domElement; - var setter = this._refelector.setter(dep.propSetterName); + var setter = reflector.setter(dep.propSetterName); return function(v) { setter(domElement, v) }; } diff --git a/modules/angular2/src/core/compiler/view.js b/modules/angular2/src/core/compiler/view.js index a510e8fc88..64bdd1dbf8 100644 --- a/modules/angular2/src/core/compiler/view.js +++ b/modules/angular2/src/core/compiler/view.js @@ -18,8 +18,6 @@ import {ShadowDomStrategy} from './shadow_dom_strategy'; import {ViewPool} from './view_pool'; import {EventManager} from 'angular2/src/core/events/event_manager'; -import {Reflector} from 'angular2/src/reflection/reflection'; - const NG_BINDING_CLASS = 'ng-binding'; const NG_BINDING_CLASS_SELECTOR = '.ng-binding'; @@ -320,23 +318,19 @@ export class ProtoView { } // TODO(rado): hostElementInjector should be moved to hydrate phase. - instantiate(hostElementInjector: ElementInjector, eventManager: EventManager, - reflector: Reflector):View { - if (this._viewPool.length() == 0) this._preFillPool(hostElementInjector, eventManager, - reflector); + instantiate(hostElementInjector: ElementInjector, eventManager: EventManager):View { + if (this._viewPool.length() == 0) this._preFillPool(hostElementInjector, eventManager); var view = this._viewPool.pop(); - return isPresent(view) ? view : this._instantiate(hostElementInjector, eventManager, reflector); + return isPresent(view) ? view : this._instantiate(hostElementInjector, eventManager); } - _preFillPool(hostElementInjector: ElementInjector, eventManager: EventManager, - reflector: Reflector) { + _preFillPool(hostElementInjector: ElementInjector, eventManager: EventManager) { for (var i = 0; i < VIEW_POOL_PREFILL; i++) { - this._viewPool.push(this._instantiate(hostElementInjector, eventManager, reflector)); + this._viewPool.push(this._instantiate(hostElementInjector, eventManager)); } } - _instantiate(hostElementInjector: ElementInjector, eventManager: EventManager, - reflector: Reflector): View { + _instantiate(hostElementInjector: ElementInjector, eventManager: EventManager): View { var rootElementClone = this.instantiateInPlace ? this.element : DOM.importIntoDoc(this.element); var elementsWithBindingsDynamic; if (this.isTemplateElement) { @@ -389,9 +383,9 @@ export class ProtoView { if (isPresent(protoElementInjector)) { if (isPresent(protoElementInjector.parent)) { var parentElementInjector = elementInjectors[protoElementInjector.parent.index]; - elementInjector = protoElementInjector.instantiate(parentElementInjector, null, reflector); + elementInjector = protoElementInjector.instantiate(parentElementInjector, null); } else { - elementInjector = protoElementInjector.instantiate(null, hostElementInjector, reflector); + elementInjector = protoElementInjector.instantiate(null, hostElementInjector); ListWrapper.push(rootElementInjectors, elementInjector); } } @@ -418,7 +412,7 @@ export class ProtoView { var bindingPropagationConfig = null; if (isPresent(binder.componentDirective)) { var strategy = this.shadowDomStrategy; - var childView = binder.nestedProtoView.instantiate(elementInjector, eventManager, reflector); + var childView = binder.nestedProtoView.instantiate(elementInjector, eventManager); view.changeDetector.addChild(childView.changeDetector); lightDom = strategy.constructLightDom(view, childView, element); @@ -434,7 +428,7 @@ export class ProtoView { if (isPresent(binder.viewportDirective)) { var destLightDom = this._directParentElementLightDom(protoElementInjector, preBuiltObjects); viewContainer = new ViewContainer(view, element, binder.nestedProtoView, elementInjector, - eventManager, reflector, destLightDom); + eventManager, destLightDom); ListWrapper.push(viewContainers, viewContainer); } diff --git a/modules/angular2/src/core/compiler/view_container.js b/modules/angular2/src/core/compiler/view_container.js index f92480ad4a..e58acd0873 100644 --- a/modules/angular2/src/core/compiler/view_container.js +++ b/modules/angular2/src/core/compiler/view_container.js @@ -6,7 +6,6 @@ import {Injector} from 'angular2/di'; import * as eiModule from 'angular2/src/core/compiler/element_injector'; import {isPresent, isBlank} from 'angular2/src/facade/lang'; import {EventManager} from 'angular2/src/core/events/event_manager'; -import {Reflector} from 'angular2/src/reflection/reflection'; export class ViewContainer { parentView: viewModule.View; @@ -15,7 +14,6 @@ export class ViewContainer { _views: List; _lightDom: any; _eventManager: EventManager; - _reflector: Reflector; elementInjector: eiModule.ElementInjector; appInjector: Injector; hostElementInjector: eiModule.ElementInjector; @@ -25,14 +23,12 @@ export class ViewContainer { defaultProtoView: viewModule.ProtoView, elementInjector: eiModule.ElementInjector, eventManager: EventManager, - reflector: Reflector, lightDom = null) { this.parentView = parentView; this.templateElement = templateElement; this.defaultProtoView = defaultProtoView; this.elementInjector = elementInjector; this._lightDom = lightDom; - this._reflector = reflector; // The order in this list matches the DOM order. this._views = []; @@ -81,8 +77,7 @@ export class ViewContainer { if (!this.hydrated()) throw new BaseException( 'Cannot create views on a dehydrated ViewContainer'); // TODO(rado): replace with viewFactory. - var newView = this.defaultProtoView.instantiate(this.hostElementInjector, this._eventManager, - this._reflector); + var newView = this.defaultProtoView.instantiate(this.hostElementInjector, this._eventManager); // insertion must come before hydration so that element injector trees are attached. this.insert(newView, atIndex); newView.hydrate(this.appInjector, this.hostElementInjector, this.parentView.context); diff --git a/modules/angular2/test/core/compiler/element_injector_spec.js b/modules/angular2/test/core/compiler/element_injector_spec.js index 982181813a..e0a3f1af1c 100644 --- a/modules/angular2/test/core/compiler/element_injector_spec.js +++ b/modules/angular2/test/core/compiler/element_injector_spec.js @@ -12,7 +12,6 @@ import {NgElement} from 'angular2/src/core/dom/element'; import {LightDom, SourceLightDom, DestinationLightDom} from 'angular2/src/core/compiler/shadow_dom_emulation/light_dom'; import {Directive} from 'angular2/src/core/annotations/annotations'; import {BindingPropagationConfig} from 'angular2/src/core/compiler/binding_propagation_config'; -import {reflector} from 'angular2/src/reflection/reflection'; import {DynamicProtoChangeDetector} from 'angular2/change_detection'; @proxy @@ -131,7 +130,7 @@ export function main() { if (isBlank(lightDomAppInjector)) lightDomAppInjector = new Injector([]); var proto = new ProtoElementInjector(null, 0, bindings, isPresent(shadowDomAppInjector)); - var inj = proto.instantiate(null, null, reflector); + var inj = proto.instantiate(null, null); var preBuilt = isPresent(preBuiltObjects) ? preBuiltObjects : defaultPreBuiltObjects; inj.instantiateDirectives(lightDomAppInjector, shadowDomAppInjector, preBuilt); @@ -144,12 +143,12 @@ export function main() { var inj = new Injector([]); var protoParent = new ProtoElementInjector(null, 0, parentBindings); - var parent = protoParent.instantiate(null, null, reflector); + var parent = protoParent.instantiate(null, null); parent.instantiateDirectives(inj, null, parentPreBuildObjects); var protoChild = new ProtoElementInjector(protoParent, 1, childBindings, false, 1); - var child = protoChild.instantiate(parent, null, reflector); + var child = protoChild.instantiate(parent, null); child.instantiateDirectives(inj, null, defaultPreBuiltObjects); return child; @@ -162,11 +161,11 @@ export function main() { var shadowInj = inj.createChild([]); var protoParent = new ProtoElementInjector(null, 0, hostBindings, true); - var host = protoParent.instantiate(null, null, reflector); + var host = protoParent.instantiate(null, null); host.instantiateDirectives(inj, shadowInj, hostPreBuildObjects); var protoChild = new ProtoElementInjector(protoParent, 0, shadowBindings, false, 1); - var shadow = protoChild.instantiate(null, host, reflector); + var shadow = protoChild.instantiate(null, host); shadow.instantiateDirectives(shadowInj, null, null); return shadow; @@ -199,9 +198,9 @@ export function main() { var protoChild1 = new ProtoElementInjector(protoParent, 1, []); var protoChild2 = new ProtoElementInjector(protoParent, 2, []); - var p = protoParent.instantiate(null, null, reflector); - var c1 = protoChild1.instantiate(p, null, reflector); - var c2 = protoChild2.instantiate(p, null, reflector); + var p = protoParent.instantiate(null, null); + var c1 = protoChild1.instantiate(p, null); + var c2 = protoChild2.instantiate(p, null); expect(humanize(p, [ [p, 'parent'], @@ -216,8 +215,8 @@ export function main() { var protoParent = new ProtoElementInjector(null, 0, []); var protoChild = new ProtoElementInjector(protoParent, 1, [], false, distance); - var p = protoParent.instantiate(null, null, reflector); - var c = protoChild.instantiate(p, null, reflector); + var p = protoParent.instantiate(null, null); + var c = protoChild.instantiate(p, null); expect(c.directParent()).toEqual(p); }); @@ -227,8 +226,8 @@ export function main() { var protoParent = new ProtoElementInjector(null, 0, []); var protoChild = new ProtoElementInjector(protoParent, 1, [], false, distance); - var p = protoParent.instantiate(null, null, reflector); - var c = protoChild.instantiate(p, null, reflector); + var p = protoParent.instantiate(null, null); + var c = protoChild.instantiate(p, null); expect(c.directParent()).toEqual(null); }); @@ -435,7 +434,7 @@ export function main() { }); it('should return viewContainer', function () { - var viewContainer = new ViewContainer(null, null, null, null, null, null); + var viewContainer = new ViewContainer(null, null, null, null, null); var inj = injector([], null, null, new PreBuiltObjects(null, null, viewContainer, null, null)); expect(inj.get(ViewContainer)).toEqual(viewContainer); diff --git a/modules/angular2/test/core/compiler/integration_spec.js b/modules/angular2/test/core/compiler/integration_spec.js index c1b1651da0..40d928727e 100644 --- a/modules/angular2/test/core/compiler/integration_spec.js +++ b/modules/angular2/test/core/compiler/integration_spec.js @@ -28,8 +28,6 @@ import {If} from 'angular2/src/directives/if'; import {ViewContainer} from 'angular2/src/core/compiler/view_container'; -import {reflector} from 'angular2/src/reflection/reflection'; - export function main() { describe('integration tests', function() { var compiler, tplResolver; @@ -58,11 +56,7 @@ export function main() { var view, ctx, cd; function createView(pv) { ctx = new MyComp(); - view = pv.instantiate( - null, - null, - reflector - ); + view = pv.instantiate(null, null); view.hydrate(new Injector([]), null, ctx); cd = view.changeDetector; } diff --git a/modules/angular2/test/core/compiler/pipeline/element_binder_builder_spec.js b/modules/angular2/test/core/compiler/pipeline/element_binder_builder_spec.js index f891f5dbec..7693df4354 100644 --- a/modules/angular2/test/core/compiler/pipeline/element_binder_builder_spec.js +++ b/modules/angular2/test/core/compiler/pipeline/element_binder_builder_spec.js @@ -82,7 +82,7 @@ export function main() { function instantiateView(protoView) { evalContext = new Context(); - view = protoView.instantiate(null, null, null); + view = protoView.instantiate(null, null); view.hydrate(new Injector([]), null, evalContext); changeDetector = view.changeDetector; } diff --git a/modules/angular2/test/core/compiler/shadow_dom/shadow_dom_emulation_integration_spec.js b/modules/angular2/test/core/compiler/shadow_dom/shadow_dom_emulation_integration_spec.js index fd0eb65f30..7a36a07967 100644 --- a/modules/angular2/test/core/compiler/shadow_dom/shadow_dom_emulation_integration_spec.js +++ b/modules/angular2/test/core/compiler/shadow_dom/shadow_dom_emulation_integration_spec.js @@ -32,8 +32,6 @@ import {ViewContainer} from 'angular2/src/core/compiler/view_container'; import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter'; -import {reflector} from 'angular2/src/reflection/reflection'; - export function main() { BrowserDomAdapter.makeCurrent(); describe('integration tests', function() { @@ -357,7 +355,7 @@ class MyComp { } function createView(pv) { - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(new Injector([]), null, {}); return view; } diff --git a/modules/angular2/test/core/compiler/shadow_dom_strategy_spec.js b/modules/angular2/test/core/compiler/shadow_dom_strategy_spec.js index 470355e7f0..fb3322295e 100644 --- a/modules/angular2/test/core/compiler/shadow_dom_strategy_spec.js +++ b/modules/angular2/test/core/compiler/shadow_dom_strategy_spec.js @@ -37,7 +37,7 @@ export function main() { var host = el('
'); var nodes = el('
view
'); var pv = new ProtoView(nodes, new DynamicProtoChangeDetector(null), null); - var view = pv.instantiate(null, null, null); + var view = pv.instantiate(null, null); strategy.attachTemplate(host, view); var shadowRoot = DOM.getShadowRoot(host); @@ -83,7 +83,7 @@ export function main() { var host = el('
original content
'); var nodes = el('
view
'); var pv = new ProtoView(nodes, new DynamicProtoChangeDetector(null), null); - var view = pv.instantiate(null, null, null); + var view = pv.instantiate(null, null); strategy.attachTemplate(host, view); var firstChild = DOM.firstChild(host); @@ -218,7 +218,7 @@ export function main() { var host = el('
original content
'); var nodes = el('
view
'); var pv = new ProtoView(nodes, new DynamicProtoChangeDetector(null), null); - var view = pv.instantiate(null, null, null); + var view = pv.instantiate(null, null); strategy.attachTemplate(host, view); var firstChild = DOM.firstChild(host); diff --git a/modules/angular2/test/core/compiler/view_container_spec.js b/modules/angular2/test/core/compiler/view_container_spec.js index f2552209fe..16462802ab 100644 --- a/modules/angular2/test/core/compiler/view_container_spec.js +++ b/modules/angular2/test/core/compiler/view_container_spec.js @@ -8,7 +8,6 @@ import {Injector} from 'angular2/di'; import {ProtoElementInjector, ElementInjector} from 'angular2/src/core/compiler/element_injector'; import {NativeShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy'; import {DynamicProtoChangeDetector, ChangeDetector, Lexer, Parser} from 'angular2/change_detection'; -import {reflector} from 'angular2/src/reflection/reflection'; function createView(nodes) { var view = new View(null, nodes, new DynamicProtoChangeDetector(null), MapWrapper.create()); @@ -72,9 +71,9 @@ export function main() { parentView = createView([dom.childNodes[0]]); protoView = new ProtoView(el('
hi
'), new DynamicProtoChangeDetector(null), new NativeShadowDomStrategy(null)); - elementInjector = new ElementInjector(null, null, null, reflector); + elementInjector = new ElementInjector(null, null, null); viewContainer = new ViewContainer(parentView, insertionElement, protoView, elementInjector, - null, reflector); + null); customViewWithOneNode = createView([el('
single
')]); customViewWithTwoNodes = createView([el('
one
'), el('
two
')]); }); @@ -219,7 +218,7 @@ export function main() { new DynamicProtoChangeDetector(null), new NativeShadowDomStrategy(null)); pv.bindElement(new ProtoElementInjector(null, 1, [SomeDirective])); pv.bindTextNode(0, parser.parseBinding('foo', null)); - fancyView = pv.instantiate(null, null, reflector); + fancyView = pv.instantiate(null, null); }); it('hydrating should update rootElementInjectors and parent change detector', () => { diff --git a/modules/angular2/test/core/compiler/view_spec.js b/modules/angular2/test/core/compiler/view_spec.js index 1ef3ff5cf3..3f5a4c001c 100644 --- a/modules/angular2/test/core/compiler/view_spec.js +++ b/modules/angular2/test/core/compiler/view_spec.js @@ -15,7 +15,7 @@ import {View} from 'angular2/src/core/compiler/view'; import {ViewContainer} from 'angular2/src/core/compiler/view_container'; import {VmTurnZone} from 'angular2/src/core/zone/vm_turn_zone'; import {EventManager, DomEventsPlugin} from 'angular2/src/core/events/event_manager'; -import {Reflector, reflector} from 'angular2/src/reflection/reflection'; +import {reflector} from 'angular2/src/reflection/reflection'; @proxy @IMPLEMENTS(ViewContainer) @@ -45,7 +45,7 @@ export function main() { function createView(protoView, eventManager: EventManager = null) { var ctx = new MyEvaluationContext(); - var view = protoView.instantiate(null, eventManager, reflector); + var view = protoView.instantiate(null, eventManager); view.hydrate(null, null, ctx); return view; } @@ -60,7 +60,7 @@ export function main() { var view; beforeEach(() => { var pv = new ProtoView(el('
'), new DynamicProtoChangeDetector(null), null); - view = pv.instantiate(null, null, reflector); + view = pv.instantiate(null, null); }); it('should be dehydrated by default', () => { @@ -90,7 +90,7 @@ export function main() { var fakeView = new FakeView(); pv.returnToPool(fakeView); - expect(pv.instantiate(null, null, reflector)).toBe(fakeView); + expect(pv.instantiate(null, null)).toBe(fakeView); }); }); @@ -135,7 +135,7 @@ export function main() { it('should collect the root node in the ProtoView element', () => { var pv = new ProtoView(templateAwareCreateElement('
'), new DynamicProtoChangeDetector(null), null); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.nodes.length).toBe(1); expect(DOM.getAttribute(view.nodes[0], 'id')).toEqual('1'); @@ -149,7 +149,7 @@ export function main() { pv.bindElement(null); pv.bindElementProperty(parser.parseBinding('a', null), 'prop', reflector.setter('prop')); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.bindElements.length).toEqual(1); expect(view.bindElements[0]).toBe(view.nodes[0]); @@ -161,7 +161,7 @@ export function main() { pv.bindElement(null); pv.bindElementProperty(parser.parseBinding('b', null), 'a', reflector.setter('a')); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.bindElements.length).toEqual(1); expect(view.bindElements[0]).toBe(view.nodes[0].childNodes[1]); @@ -178,7 +178,7 @@ export function main() { pv.bindTextNode(0, parser.parseBinding('a', null)); pv.bindTextNode(2, parser.parseBinding('b', null)); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.textNodes.length).toEqual(2); expect(view.textNodes[0]).toBe(view.nodes[0].childNodes[0]); @@ -191,7 +191,7 @@ export function main() { pv.bindElement(null); pv.bindTextNode(0, parser.parseBinding('b', null)); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.textNodes.length).toEqual(1); expect(view.textNodes[0]).toBe(view.nodes[0].childNodes[1].childNodes[0]); @@ -206,7 +206,7 @@ export function main() { var pv = new ProtoView(template, new DynamicProtoChangeDetector(null), new NativeShadowDomStrategy(null)); pv.instantiateInPlace = true; - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.nodes[0]).toBe(template); }); @@ -215,7 +215,7 @@ export function main() { var template = el('
') var pv = new ProtoView(template, new DynamicProtoChangeDetector(null), new NativeShadowDomStrategy(null)) - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.nodes[0]).not.toBe(template); }); @@ -235,7 +235,7 @@ export function main() { new DynamicProtoChangeDetector(null), null); pv.bindElement(new ProtoElementInjector(null, 1, [SomeDirective])); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.elementInjectors.length).toBe(1); expect(view.elementInjectors[0].get(SomeDirective) instanceof SomeDirective).toBe(true); @@ -248,7 +248,7 @@ export function main() { pv.bindElement(protoParent); pv.bindElement(new ProtoElementInjector(protoParent, 1, [AnotherDirective])); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.elementInjectors.length).toBe(2); expect(view.elementInjectors[0].get(SomeDirective) instanceof SomeDirective).toBe(true); @@ -264,9 +264,9 @@ export function main() { pv.bindElement(testProtoElementInjector); var hostProtoInjector = new ProtoElementInjector(null, 0, []); - var hostInjector = hostProtoInjector.instantiate(null, null, reflector); + var hostInjector = hostProtoInjector.instantiate(null, null); var view; - expect(() => view = pv.instantiate(hostInjector, null, reflector)).not.toThrow(); + expect(() => view = pv.instantiate(hostInjector, null)).not.toThrow(); expect(testProtoElementInjector.parentElementInjector).toBe(view.elementInjectors[0]); expect(testProtoElementInjector.hostElementInjector).toBeNull(); }); @@ -279,8 +279,8 @@ export function main() { pv.bindElement(testProtoElementInjector); var hostProtoInjector = new ProtoElementInjector(null, 0, []); - var hostInjector = hostProtoInjector.instantiate(null, null, reflector); - expect(() => pv.instantiate(hostInjector, null, reflector)).not.toThrow(); + var hostInjector = hostProtoInjector.instantiate(null, null); + expect(() => pv.instantiate(hostInjector, null)).not.toThrow(); expect(testProtoElementInjector.parentElementInjector).toBeNull(); expect(testProtoElementInjector.hostElementInjector).toBe(hostInjector); }); @@ -295,7 +295,7 @@ export function main() { pv.bindElement(protoParent); pv.bindElement(new ProtoElementInjector(protoParent, 1, [AnotherDirective])); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.rootElementInjectors.length).toBe(1); expect(view.rootElementInjectors[0].get(SomeDirective) instanceof SomeDirective).toBe(true); @@ -307,7 +307,7 @@ export function main() { pv.bindElement(new ProtoElementInjector(null, 1, [SomeDirective])); pv.bindElement(new ProtoElementInjector(null, 2, [AnotherDirective])); - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(null, null, null); expect(view.rootElementInjectors.length).toBe(2) expect(view.rootElementInjectors[0].get(SomeDirective) instanceof SomeDirective).toBe(true); @@ -330,7 +330,7 @@ export function main() { function createNestedView(protoView) { ctx = new MyEvaluationContext(); - var view = protoView.instantiate(null, null, reflector); + var view = protoView.instantiate(null, null); view.hydrate(new Injector([]), null, ctx); return view; } @@ -638,7 +638,7 @@ export function main() { var rootProtoView = ProtoView.createRootProtoView(pv, element, someComponentDirective, new DynamicProtoChangeDetector(null), new NativeShadowDomStrategy(null)); - var view = rootProtoView.instantiate(null, null, reflector); + var view = rootProtoView.instantiate(null, null); view.hydrate(new Injector([]), null, null); expect(view.rootElementInjectors[0].get(SomeComponent)).not.toBe(null); }); @@ -647,7 +647,7 @@ export function main() { var rootProtoView = ProtoView.createRootProtoView(pv, element, someComponentDirective, new DynamicProtoChangeDetector(null), new NativeShadowDomStrategy(null)); - var view = rootProtoView.instantiate(null, null, reflector); + var view = rootProtoView.instantiate(null, null); view.hydrate(new Injector([]), null, null); expect(element.shadowRoot.childNodes[0].childNodes[0].nodeValue).toEqual('hi'); }); @@ -753,10 +753,10 @@ class TestProtoElementInjector extends ProtoElementInjector { super(parent, index, bindings, firstBindingIsComponent); } - instantiate(parent:ElementInjector, host:ElementInjector, reflector: Reflector):ElementInjector { + instantiate(parent:ElementInjector, host:ElementInjector):ElementInjector { this.parentElementInjector = parent; this.hostElementInjector = host; - return super.instantiate(parent, host, reflector); + return super.instantiate(parent, host); } } diff --git a/modules/angular2/test/directives/foreach_spec.js b/modules/angular2/test/directives/foreach_spec.js index 1c7f9e05e6..4d37c660d3 100644 --- a/modules/angular2/test/directives/foreach_spec.js +++ b/modules/angular2/test/directives/foreach_spec.js @@ -44,7 +44,7 @@ export function main() { function createView(pv) { component = new TestComponent(); - view = pv.instantiate(null, null, null); + view = pv.instantiate(null, null); view.hydrate(new Injector([]), null, component); cd = view.changeDetector; } diff --git a/modules/angular2/test/directives/if_spec.js b/modules/angular2/test/directives/if_spec.js index f4880d02f9..8c56515c28 100644 --- a/modules/angular2/test/directives/if_spec.js +++ b/modules/angular2/test/directives/if_spec.js @@ -44,7 +44,7 @@ export function main() { function createView(pv) { component = new TestComponent(); - view = pv.instantiate(null, null, null); + view = pv.instantiate(null, null); view.hydrate(new Injector([]), null, component); cd = view.changeDetector; } diff --git a/modules/angular2/test/directives/non_bindable_spec.js b/modules/angular2/test/directives/non_bindable_spec.js index 0716542abd..f42ccf0184 100644 --- a/modules/angular2/test/directives/non_bindable_spec.js +++ b/modules/angular2/test/directives/non_bindable_spec.js @@ -42,7 +42,7 @@ export function main() { function createView(pv) { component = new TestComponent(); - view = pv.instantiate(null, null, null); + view = pv.instantiate(null, null); view.hydrate(new Injector([]), null, component); cd = view.changeDetector; } diff --git a/modules/angular2/test/directives/switch_spec.js b/modules/angular2/test/directives/switch_spec.js index b92e4197da..e83a621f3c 100644 --- a/modules/angular2/test/directives/switch_spec.js +++ b/modules/angular2/test/directives/switch_spec.js @@ -39,7 +39,7 @@ export function main() { function createView(pv) { component = new TestComponent(); - view = pv.instantiate(null, null, null); + view = pv.instantiate(null, null); view.hydrate(new Injector([]), null, component); cd = view.changeDetector; } diff --git a/modules/angular2/test/forms/integration_spec.js b/modules/angular2/test/forms/integration_spec.js index 5c8a0382eb..e5245963bd 100644 --- a/modules/angular2/test/forms/integration_spec.js +++ b/modules/angular2/test/forms/integration_spec.js @@ -21,8 +21,6 @@ import {ControlGroupDirective, ControlDirective, Control, ControlGroup, Optional import * as validators from 'angular2/src/forms/validators'; -import {reflector} from 'angular2/src/reflection/reflection'; - export function main() { function detectChanges(view) { view.changeDetector.detectChanges(); @@ -50,7 +48,7 @@ export function main() { })); compiler.compile(componentType).then((pv) => { - var view = pv.instantiate(null, null, reflector); + var view = pv.instantiate(null, null); view.hydrate(new Injector([]), null, context); detectChanges(view); callback(view); diff --git a/modules/benchmarks/src/element_injector/element_injector_benchmark.js b/modules/benchmarks/src/element_injector/element_injector_benchmark.js index 6b5c0df8b8..6036ffa845 100644 --- a/modules/benchmarks/src/element_injector/element_injector_benchmark.js +++ b/modules/benchmarks/src/element_injector/element_injector_benchmark.js @@ -33,11 +33,11 @@ export function main() { var bindings = [A, B, C]; var proto = new ProtoElementInjector(null, 0, bindings); - var elementInjector = proto.instantiate(null, null, null); + var elementInjector = proto.instantiate(null, null); function instantiate () { for (var i = 0; i < iterations; ++i) { - var ei = proto.instantiate(null, null, null); + var ei = proto.instantiate(null, null); ei.instantiateDirectives(appInjector, null, null); } } diff --git a/modules/benchmarks/src/naive_infinite_scroll/index.js b/modules/benchmarks/src/naive_infinite_scroll/index.js index d47db26721..e1b83a55b7 100644 --- a/modules/benchmarks/src/naive_infinite_scroll/index.js +++ b/modules/benchmarks/src/naive_infinite_scroll/index.js @@ -8,7 +8,7 @@ import {ExceptionHandler} from 'angular2/src/core/exception_handler'; import { bootstrap, Component, Viewport, Template, ViewContainer, Compiler, onChange, NgElement, Decorator } from 'angular2/angular2'; -import {Reflector, reflector} from 'angular2/src/reflection/reflection'; +import {reflector} from 'angular2/src/reflection/reflection'; import {CompilerCache} from 'angular2/src/core/compiler/compiler'; import {DirectiveMetadataReader} from 'angular2/src/core/compiler/directive_metadata_reader'; import {ShadowDomStrategy, NativeShadowDomStrategy, EmulatedUnscopedShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy'; @@ -300,10 +300,4 @@ export function setupReflectorForAngular() { "parameters": [], "annotations": [] }); - - reflector.registerType(Reflector, { - "factory": () => reflector, - "parameters": [], - "annotations": [] - }); } diff --git a/modules/benchmarks/src/tree/tree_benchmark.js b/modules/benchmarks/src/tree/tree_benchmark.js index 625a0564ab..b2fbefcfb9 100644 --- a/modules/benchmarks/src/tree/tree_benchmark.js +++ b/modules/benchmarks/src/tree/tree_benchmark.js @@ -18,7 +18,7 @@ import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mappe import {StyleInliner} from 'angular2/src/core/compiler/style_inliner'; import {CssProcessor} from 'angular2/src/core/compiler/css_processor'; -import {Reflector, reflector} from 'angular2/src/reflection/reflection'; +import {reflector} from 'angular2/src/reflection/reflection'; import {DOM} from 'angular2/src/dom/dom_adapter'; import {isPresent} from 'angular2/src/facade/lang'; import {window, document, gc} from 'angular2/src/facade/browser'; @@ -171,7 +171,6 @@ function setupReflector() { "annotations": [] }); - reflector.registerType(ComponentUrlMapper, { "factory": () => new ComponentUrlMapper(), "parameters": [], @@ -191,12 +190,6 @@ function setupReflector() { "annotations": [] }); - reflector.registerType(Reflector, { - "factory": () => reflector, - "parameters": [], - "annotations": [] - }); - reflector.registerGetters({ 'value': (a) => a.value, 'left': (a) => a.left, diff --git a/modules/examples/src/hello_world/index_static.js b/modules/examples/src/hello_world/index_static.js index 0cf128464d..310b94c3b1 100644 --- a/modules/examples/src/hello_world/index_static.js +++ b/modules/examples/src/hello_world/index_static.js @@ -20,7 +20,7 @@ import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mappe import {StyleInliner} from 'angular2/src/core/compiler/style_inliner'; import {CssProcessor} from 'angular2/src/core/compiler/css_processor'; -import {Reflector, reflector} from 'angular2/src/reflection/reflection'; +import {reflector} from 'angular2/src/reflection/reflection'; function setup() { reflector.registerType(app.HelloCmp, { @@ -170,12 +170,6 @@ function setup() { "annotations": [] }); - reflector.registerType(Reflector, { - "factory": () => reflector, - "parameters": [], - "annotations": [] - }); - reflector.registerGetters({ "greeting": (a) => a.greeting });