From d7eaae6f2267eade986ab1626aa938072a7dec35 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Fri, 17 May 2019 18:49:21 -0700 Subject: [PATCH] =?UTF-8?q?refactor(ivy):=20Move=20instructions=20back=20t?= =?UTF-8?q?o=20=C9=B5=C9=B5=20(#30546)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is an encoding issue with using delta `Δ`, where the browser will attempt to detect the file encoding if the character set is not explicitly declared on a ``); expect(s.lastSanitizedValue).toEqual(outputValue); }); @@ -430,7 +430,7 @@ describe('instructions', () => { const inputValue = s.bypassSecurityTrustResourceUrl('file://all-my-secrets.pdf'); const outputValue = 'file://all-my-secrets.pdf'; - t.update(() => ΔelementAttribute(0, 'src', inputValue, ΔsanitizeResourceUrl)); + t.update(() => ɵɵelementAttribute(0, 'src', inputValue, ɵɵsanitizeResourceUrl)); expect(t.html).toEqual(``); expect(s.lastSanitizedValue).toBeFalsy(); }); @@ -441,7 +441,7 @@ describe('instructions', () => { const inputValue = bypassSanitizationTrustResourceUrl('file://all-my-secrets.pdf'); const outputValue = 'file://all-my-secrets.pdf-ivy'; - t.update(() => ΔelementAttribute(0, 'src', inputValue, ΔsanitizeResourceUrl)); + t.update(() => ɵɵelementAttribute(0, 'src', inputValue, ɵɵsanitizeResourceUrl)); expect(t.html).toEqual(``); expect(s.lastSanitizedValue).toBeFalsy(); }); @@ -452,7 +452,7 @@ describe('instructions', () => { const inputValue = 'fn();'; const outputValue = 'fn(); //sanitized'; - t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeScript)); + t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeScript)); expect(t.html).toEqual(``); expect(s.lastSanitizedValue).toEqual(outputValue); }); @@ -463,7 +463,7 @@ describe('instructions', () => { const inputValue = s.bypassSecurityTrustScript('alert("bar")'); const outputValue = 'alert("bar")'; - t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeScript)); + t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeScript)); expect(t.html).toEqual(``); expect(s.lastSanitizedValue).toBeFalsy(); }); @@ -474,7 +474,7 @@ describe('instructions', () => { const inputValue = bypassSanitizationTrustScript('alert("bar")'); const outputValue = 'alert("bar")-ivy'; - t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeScript)); + t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeScript)); expect(t.html).toEqual(``); expect(s.lastSanitizedValue).toBeFalsy(); }); @@ -485,7 +485,7 @@ describe('instructions', () => { const inputValue = '
'; const outputValue = '
'; - t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeHtml)); + t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeHtml)); expect(t.html).toEqual(`
${outputValue}
`); expect(s.lastSanitizedValue).toEqual(outputValue); }); @@ -496,7 +496,7 @@ describe('instructions', () => { const inputValue = s.bypassSecurityTrustHtml('
'); const outputValue = '
'; - t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeHtml)); + t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeHtml)); expect(t.html).toEqual(`
${outputValue}
`); expect(s.lastSanitizedValue).toBeFalsy(); }); @@ -507,7 +507,7 @@ describe('instructions', () => { const inputValue = bypassSanitizationTrustHtml('
'); const outputValue = '
-ivy'; - t.update(() => ΔelementProperty(0, 'innerHTML', inputValue, ΔsanitizeHtml)); + t.update(() => ɵɵelementProperty(0, 'innerHTML', inputValue, ɵɵsanitizeHtml)); expect(t.html).toEqual(`
${outputValue}
`); expect(s.lastSanitizedValue).toBeFalsy(); }); @@ -552,7 +552,7 @@ class LocalMockSanitizer implements Sanitizer { class MockSanitizerInterceptor { public lastValue: string|null = null; constructor(private _interceptorFn?: ((value: any) => any)|null) {} - getStyleSanitizer() { return ΔdefaultStyleSanitizer; } + getStyleSanitizer() { return ɵɵdefaultStyleSanitizer; } sanitize(context: SecurityContext, value: LocalSanitizedValue|string|null|any): string|null { if (this._interceptorFn) { this._interceptorFn(value); diff --git a/packages/core/test/render3/integration_spec.ts b/packages/core/test/render3/integration_spec.ts index 6994ec97bf..0674229a90 100644 --- a/packages/core/test/render3/integration_spec.ts +++ b/packages/core/test/render3/integration_spec.ts @@ -8,14 +8,14 @@ import {RendererType2} from '../../src/render/api'; import {getLContext} from '../../src/render3/context_discovery'; -import {AttributeMarker, ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index'; -import {ΔallocHostVars, Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementAttribute, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δprojection, ΔprojectionDef, Δselect, Δstyling, ΔstylingApply, Δtemplate, Δtext, ΔtextBinding} from '../../src/render3/instructions/all'; +import {AttributeMarker, ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index'; +import {ɵɵallocHostVars, ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementAttribute, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵselect, ɵɵstyling, ɵɵstylingApply, ɵɵtemplate, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all'; import {MONKEY_PATCH_KEY_NAME} from '../../src/render3/interfaces/context'; import {RenderFlags} from '../../src/render3/interfaces/definition'; import {RElement, Renderer3, RendererFactory3, domRendererFactory3} from '../../src/render3/interfaces/renderer'; import {StylingIndex} from '../../src/render3/interfaces/styling'; import {CONTEXT, HEADER_OFFSET} from '../../src/render3/interfaces/view'; -import {ΔsanitizeUrl} from '../../src/sanitization/sanitization'; +import {ɵɵsanitizeUrl} from '../../src/sanitization/sanitization'; import {Sanitizer, SecurityContext} from '../../src/sanitization/security'; import {NgIf} from './common_with_def'; @@ -28,8 +28,8 @@ describe('render3 integration test', () => { it('should support creation-time values in text nodes', () => { function Template(rf: RenderFlags, value: string) { if (rf & RenderFlags.Create) { - Δtext(0); - ΔtextBinding(0, value); + ɵɵtext(0); + ɵɵtextBinding(0, value); } } expect(renderToHtml(Template, 'once', 1, 1)).toEqual('once'); @@ -59,56 +59,56 @@ describe('render3 integration test', () => { function showLabel(rf: RenderFlags, ctx: {label: string | undefined}) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.label != null) { - let rf1 = ΔembeddedViewStart(0, 1, 1); + let rf1 = ɵɵembeddedViewStart(0, 1, 1); if (rf1 & RenderFlags.Create) { - Δtext(0); + ɵɵtext(0); } if (rf1 & RenderFlags.Update) { - ΔtextBinding(0, Δbind(ctx.label)); + ɵɵtextBinding(0, ɵɵbind(ctx.label)); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } function showTree(rf: RenderFlags, ctx: {tree: Tree}) { if (rf & RenderFlags.Create) { - Δcontainer(0); - Δcontainer(1); - Δcontainer(2); + ɵɵcontainer(0); + ɵɵcontainer(1); + ɵɵcontainer(2); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { - const rf0 = ΔembeddedViewStart(0, 1, 0); + const rf0 = ɵɵembeddedViewStart(0, 1, 0); { showLabel(rf0, {label: ctx.tree.beforeLabel}); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } - ΔcontainerRefreshEnd(); - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshEnd(); + ɵɵcontainerRefreshStart(1); { for (let subTree of ctx.tree.subTrees || []) { - const rf0 = ΔembeddedViewStart(0, 3, 0); + const rf0 = ɵɵembeddedViewStart(0, 3, 0); { showTree(rf0, {tree: subTree}); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); - ΔcontainerRefreshStart(2); + ɵɵcontainerRefreshEnd(); + ɵɵcontainerRefreshStart(2); { - const rf0 = ΔembeddedViewStart(0, 1, 0); + const rf0 = ɵɵembeddedViewStart(0, 1, 0); { showLabel(rf0, {label: ctx.tree.afterLabel}); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } @@ -117,7 +117,7 @@ describe('render3 integration test', () => { beforeTree !: Tree; // TODO(issue/24571): remove '!'. afterTree !: Tree; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ selectors: [['child']], type: ChildComponent, consts: 3, @@ -125,26 +125,26 @@ describe('render3 integration test', () => { template: function ChildComponentTemplate( rf: RenderFlags, ctx: {beforeTree: Tree, afterTree: Tree}) { if (rf & RenderFlags.Create) { - ΔprojectionDef(); - Δcontainer(0); - Δprojection(1); - Δcontainer(2); + ɵɵprojectionDef(); + ɵɵcontainer(0); + ɵɵprojection(1); + ɵɵcontainer(2); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { - const rf0 = ΔembeddedViewStart(0, 3, 0); + const rf0 = ɵɵembeddedViewStart(0, 3, 0); { showTree(rf0, {tree: ctx.beforeTree}); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } - ΔcontainerRefreshEnd(); - ΔcontainerRefreshStart(2); + ɵɵcontainerRefreshEnd(); + ɵɵcontainerRefreshStart(2); { - const rf0 = ΔembeddedViewStart(0, 3, 0); + const rf0 = ɵɵembeddedViewStart(0, 3, 0); { showTree(rf0, {tree: ctx.afterTree}); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, factory: () => new ChildComponent, @@ -154,20 +154,20 @@ describe('render3 integration test', () => { function parentTemplate(rf: RenderFlags, ctx: ParentCtx) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'child'); - { Δcontainer(1); } - ΔelementEnd(); + ɵɵelementStart(0, 'child'); + { ɵɵcontainer(1); } + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - ΔelementProperty(0, 'beforeTree', Δbind(ctx.beforeTree)); - ΔelementProperty(0, 'afterTree', Δbind(ctx.afterTree)); - ΔcontainerRefreshStart(1); + ɵɵelementProperty(0, 'beforeTree', ɵɵbind(ctx.beforeTree)); + ɵɵelementProperty(0, 'afterTree', ɵɵbind(ctx.afterTree)); + ɵɵcontainerRefreshStart(1); { - const rf0 = ΔembeddedViewStart(0, 3, 0); + const rf0 = ɵɵembeddedViewStart(0, 3, 0); { showTree(rf0, {tree: ctx.projectedTree}); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } @@ -199,7 +199,7 @@ describe('render3 integration test', () => { describe('component styles', () => { it('should pass in the component styles directly into the underlying renderer', () => { class StyledComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StyledComp, styles: ['div { color: red; }'], consts: 1, @@ -209,7 +209,7 @@ describe('component styles', () => { factory: () => new StyledComp(), template: (rf: RenderFlags, ctx: StyledComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div'); + ɵɵelement(0, 'div'); } } }); @@ -227,7 +227,7 @@ describe('component animations', () => { const animB = {name: 'b'}; class AnimComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AnimComp, consts: 0, vars: 0, @@ -254,7 +254,7 @@ describe('component animations', () => { it('should include animations in the renderType data array even if the array is empty', () => { class AnimComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AnimComp, consts: 0, vars: 0, @@ -274,7 +274,7 @@ describe('component animations', () => { it('should allow [@trigger] bindings to be picked up by the underlying renderer', () => { class AnimComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AnimComp, consts: 1, vars: 1, @@ -282,10 +282,10 @@ describe('component animations', () => { factory: () => new AnimComp(), template: (rf: RenderFlags, ctx: AnimComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div', [AttributeMarker.Bindings, '@fooAnimation']); + ɵɵelement(0, 'div', [AttributeMarker.Bindings, '@fooAnimation']); } if (rf & RenderFlags.Update) { - ΔelementAttribute(0, '@fooAnimation', Δbind(ctx.animationValue)); + ɵɵelementAttribute(0, '@fooAnimation', ɵɵbind(ctx.animationValue)); } } }); @@ -310,7 +310,7 @@ describe('component animations', () => { it('should allow creation-level [@trigger] properties to be picked up by the underlying renderer', () => { class AnimComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AnimComp, consts: 1, vars: 1, @@ -318,7 +318,7 @@ describe('component animations', () => { factory: () => new AnimComp(), template: (rf: RenderFlags, ctx: AnimComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['@fooAnimation', '']); + ɵɵelement(0, 'div', ['@fooAnimation', '']); } } }); @@ -337,13 +337,13 @@ describe('component animations', () => { it('should allow host binding animations to be picked up and rendered', () => { class ChildCompWithAnim { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: ChildCompWithAnim, factory: () => new ChildCompWithAnim(), selectors: [['child-comp-with-anim']], hostBindings: function(rf: RenderFlags, ctx: any, elementIndex: number): void { if (rf & RenderFlags.Update) { - ΔelementProperty(0, '@fooAnim', ctx.exp); + ɵɵelementProperty(0, '@fooAnim', ctx.exp); } }, }); @@ -352,7 +352,7 @@ describe('component animations', () => { } class ParentComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ParentComp, consts: 1, vars: 1, @@ -360,7 +360,7 @@ describe('component animations', () => { factory: () => new ParentComp(), template: (rf: RenderFlags, ctx: ParentComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'child-comp-with-anim'); + ɵɵelement(0, 'child-comp-with-anim'); } }, directives: [ChildCompWithAnim] @@ -382,7 +382,7 @@ describe('component animations', () => { describe('element discovery', () => { it('should only monkey-patch immediate child nodes in a component', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], factory: () => new StructuredComp(), @@ -390,10 +390,10 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - ΔelementStart(1, 'p'); - ΔelementEnd(); - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + ɵɵelementStart(1, 'p'); + ɵɵelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { } @@ -414,7 +414,7 @@ describe('element discovery', () => { it('should only monkey-patch immediate child nodes in a sub component', () => { class ChildComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ChildComp, selectors: [['child-comp']], factory: () => new ChildComp(), @@ -422,16 +422,16 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ChildComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div'); - Δelement(1, 'div'); - Δelement(2, 'div'); + ɵɵelement(0, 'div'); + ɵɵelement(1, 'div'); + ɵɵelement(2, 'div'); } } }); } class ParentComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ParentComp, selectors: [['parent-comp']], directives: [ChildComp], @@ -440,10 +440,10 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ParentComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'section'); - ΔelementStart(1, 'child-comp'); - ΔelementEnd(); - ΔelementEnd(); + ɵɵelementStart(0, 'section'); + ɵɵelementStart(1, 'child-comp'); + ɵɵelementEnd(); + ɵɵelementEnd(); } } }); @@ -464,7 +464,7 @@ describe('element discovery', () => { it('should only monkey-patch immediate child nodes in an embedded template container', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], directives: [NgIf], @@ -473,19 +473,19 @@ describe('element discovery', () => { vars: 1, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'section'); - Δtemplate(1, (rf, ctx) => { + ɵɵelementStart(0, 'section'); + ɵɵtemplate(1, (rf, ctx) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - Δelement(1, 'p'); - ΔelementEnd(); - Δelement(2, 'div'); + ɵɵelementStart(0, 'div'); + ɵɵelement(1, 'p'); + ɵɵelementEnd(); + ɵɵelement(2, 'div'); } }, 3, 0, 'ng-template', ['ngIf', '']); - ΔelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - ΔelementProperty(1, 'ngIf', true); + ɵɵelementProperty(1, 'ngIf', true); } } }); @@ -512,7 +512,7 @@ describe('element discovery', () => { it('should return a context object from a given dom node', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], directives: [NgIf], @@ -521,8 +521,8 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'section'); - Δelement(1, 'div'); + ɵɵelement(0, 'section'); + ɵɵelement(1, 'div'); } } }); @@ -550,7 +550,7 @@ describe('element discovery', () => { it('should cache the element context on a element was pre-emptively monkey-patched', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], factory: () => new StructuredComp(), @@ -558,7 +558,7 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'section'); + ɵɵelement(0, 'section'); } } }); @@ -582,7 +582,7 @@ describe('element discovery', () => { it('should cache the element context on an intermediate element that isn\'t pre-emptively monkey-patched', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], factory: () => new StructuredComp(), @@ -590,9 +590,9 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'section'); - Δelement(1, 'p'); - ΔelementEnd(); + ɵɵelementStart(0, 'section'); + ɵɵelement(1, 'p'); + ɵɵelementEnd(); } } }); @@ -615,7 +615,7 @@ describe('element discovery', () => { it('should be able to pull in element context data even if the element is decorated using styling', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], factory: () => new StructuredComp(), @@ -623,13 +623,13 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'section'); - Δstyling(['class-foo']); - ΔelementEnd(); + ɵɵelementStart(0, 'section'); + ɵɵstyling(['class-foo']); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstylingApply(); } } }); @@ -670,7 +670,7 @@ describe('element discovery', () => { */ class ProjectorComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ProjectorComp, selectors: [['projector-comp']], factory: () => new ProjectorComp(), @@ -678,13 +678,13 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ProjectorComp) => { if (rf & RenderFlags.Create) { - ΔprojectionDef(); - Δtext(0, 'welcome'); - ΔelementStart(1, 'header'); - ΔelementStart(2, 'h1'); - Δprojection(3); - ΔelementEnd(); - ΔelementEnd(); + ɵɵprojectionDef(); + ɵɵtext(0, 'welcome'); + ɵɵelementStart(1, 'header'); + ɵɵelementStart(2, 'h1'); + ɵɵprojection(3); + ɵɵelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { } @@ -693,7 +693,7 @@ describe('element discovery', () => { } class ParentComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ParentComp, selectors: [['parent-comp']], directives: [ProjectorComp], @@ -702,14 +702,14 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ParentComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'section'); - ΔelementStart(1, 'projector-comp'); - ΔelementStart(2, 'p'); - Δtext(3, 'this content is projected'); - ΔelementEnd(); - Δtext(4, 'this content is projected also'); - ΔelementEnd(); - ΔelementEnd(); + ɵɵelementStart(0, 'section'); + ɵɵelementStart(1, 'projector-comp'); + ɵɵelementStart(2, 'p'); + ɵɵtext(3, 'this content is projected'); + ɵɵelementEnd(); + ɵɵtext(4, 'this content is projected also'); + ɵɵelementEnd(); + ɵɵelementEnd(); } } }); @@ -767,7 +767,7 @@ describe('element discovery', () => { it('should return `null` when an element context is retrieved that is a DOM node that was not created by Angular', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], factory: () => new StructuredComp(), @@ -775,7 +775,7 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'section'); + ɵɵelement(0, 'section'); } } }); @@ -794,7 +794,7 @@ describe('element discovery', () => { it('should by default monkey-patch the bootstrap component with context details', () => { class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], factory: () => new StructuredComp(), @@ -833,7 +833,7 @@ describe('element discovery', () => { let myDir3Instance: MyDir2|null = null; class MyDir1 { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: MyDir1, selectors: [['', 'my-dir-1', '']], factory: () => myDir1Instance = new MyDir1() @@ -841,7 +841,7 @@ describe('element discovery', () => { } class MyDir2 { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: MyDir2, selectors: [['', 'my-dir-2', '']], factory: () => myDir2Instance = new MyDir2() @@ -849,7 +849,7 @@ describe('element discovery', () => { } class MyDir3 { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: MyDir3, selectors: [['', 'my-dir-3', '']], factory: () => myDir3Instance = new MyDir2() @@ -857,7 +857,7 @@ describe('element discovery', () => { } class StructuredComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: StructuredComp, selectors: [['structured-comp']], directives: [MyDir1, MyDir2, MyDir3], @@ -866,8 +866,8 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: StructuredComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['my-dir-1', '', 'my-dir-2', '']); - Δelement(1, 'div', ['my-dir-3']); + ɵɵelement(0, 'div', ['my-dir-1', '', 'my-dir-2', '']); + ɵɵelement(1, 'div', ['my-dir-3']); } } }); @@ -922,7 +922,7 @@ describe('element discovery', () => { let childComponentInstance: ChildComp|null = null; class MyDir1 { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: MyDir1, selectors: [['', 'my-dir-1', '']], factory: () => myDir1Instance = new MyDir1() @@ -930,7 +930,7 @@ describe('element discovery', () => { } class MyDir2 { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: MyDir2, selectors: [['', 'my-dir-2', '']], factory: () => myDir2Instance = new MyDir2() @@ -938,7 +938,7 @@ describe('element discovery', () => { } class ChildComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ChildComp, selectors: [['child-comp']], factory: () => childComponentInstance = new ChildComp(), @@ -946,14 +946,14 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ChildComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div'); + ɵɵelement(0, 'div'); } } }); } class ParentComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ParentComp, selectors: [['parent-comp']], directives: [ChildComp, MyDir1, MyDir2], @@ -962,7 +962,7 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ParentComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'child-comp', ['my-dir-1', '', 'my-dir-2', '']); + ɵɵelement(0, 'child-comp', ['my-dir-1', '', 'my-dir-2', '']); } } }); @@ -1015,7 +1015,7 @@ describe('element discovery', () => { it('should monkey-patch sub components with the view data and then replace them with the context result once a lookup occurs', () => { class ChildComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ChildComp, selectors: [['child-comp']], factory: () => new ChildComp(), @@ -1023,16 +1023,16 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ChildComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div'); - Δelement(1, 'div'); - Δelement(2, 'div'); + ɵɵelement(0, 'div'); + ɵɵelement(1, 'div'); + ɵɵelement(2, 'div'); } } }); } class ParentComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ParentComp, selectors: [['parent-comp']], directives: [ChildComp], @@ -1041,10 +1041,10 @@ describe('element discovery', () => { vars: 0, template: (rf: RenderFlags, ctx: ParentComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'section'); - ΔelementStart(1, 'child-comp'); - ΔelementEnd(); - ΔelementEnd(); + ɵɵelementStart(0, 'section'); + ɵɵelementStart(1, 'child-comp'); + ɵɵelementEnd(); + ɵɵelementEnd(); } } }); @@ -1076,7 +1076,7 @@ describe('element discovery', () => { describe('sanitization', () => { it('should sanitize data using the provided sanitization interface', () => { class SanitizationComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: SanitizationComp, selectors: [['sanitize-this']], factory: () => new SanitizationComp(), @@ -1084,10 +1084,10 @@ describe('sanitization', () => { vars: 1, template: (rf: RenderFlags, ctx: SanitizationComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'a'); + ɵɵelement(0, 'a'); } if (rf & RenderFlags.Update) { - ΔelementProperty(0, 'href', Δbind(ctx.href), ΔsanitizeUrl); + ɵɵelementProperty(0, 'href', ɵɵbind(ctx.href), ɵɵsanitizeUrl); } } }); @@ -1118,23 +1118,23 @@ describe('sanitization', () => { // @HostBinding() cite: any = 'http://cite-dir-value'; - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: UnsafeUrlHostBindingDir, selectors: [['', 'unsafeUrlHostBindingDir', '']], factory: () => hostBindingDir = new UnsafeUrlHostBindingDir(), hostBindings: (rf: RenderFlags, ctx: any, elementIndex: number) => { if (rf & RenderFlags.Create) { - ΔallocHostVars(1); + ɵɵallocHostVars(1); } if (rf & RenderFlags.Update) { - ΔelementProperty(elementIndex, 'cite', Δbind(ctx.cite), ΔsanitizeUrl, true); + ɵɵelementProperty(elementIndex, 'cite', ɵɵbind(ctx.cite), ɵɵsanitizeUrl, true); } } }); } class SimpleComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: SimpleComp, selectors: [['sanitize-this']], factory: () => new SimpleComp(), @@ -1142,7 +1142,7 @@ describe('sanitization', () => { vars: 0, template: (rf: RenderFlags, ctx: SimpleComp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'blockquote', ['unsafeUrlHostBindingDir', '']); + ɵɵelement(0, 'blockquote', ['unsafeUrlHostBindingDir', '']); } }, directives: [UnsafeUrlHostBindingDir] diff --git a/packages/core/test/render3/ivy/jit_spec.ts b/packages/core/test/render3/ivy/jit_spec.ts index c58d0fa88d..6fb5771030 100644 --- a/packages/core/test/render3/ivy/jit_spec.ts +++ b/packages/core/test/render3/ivy/jit_spec.ts @@ -7,10 +7,10 @@ */ import 'reflect-metadata'; -import {ElementRef, QueryList, ΔsetComponentScope as setComponentScope} from '@angular/core'; +import {ElementRef, QueryList, ɵɵsetComponentScope as setComponentScope} from '@angular/core'; import {Injectable} from '@angular/core/src/di/injectable'; -import {setCurrentInjector, Δinject} from '@angular/core/src/di/injector_compatibility'; -import {ΔInjectorDef, ΔdefineInjectable} from '@angular/core/src/di/interface/defs'; +import {setCurrentInjector, ɵɵinject} from '@angular/core/src/di/injector_compatibility'; +import {ɵɵInjectorDef, ɵɵdefineInjectable} from '@angular/core/src/di/interface/defs'; import {ivyEnabled} from '@angular/core/src/ivy_switch'; import {ContentChild, ContentChildren, ViewChild, ViewChildren} from '@angular/core/src/metadata/di'; import {Component, Directive, HostBinding, HostListener, Input, Output, Pipe} from '@angular/core/src/metadata/directives'; @@ -45,7 +45,7 @@ ivyEnabled && describe('render3 jit', () => { expect(ServiceAny.ngInjectableDef).toBeDefined(); expect(ServiceAny.ngInjectableDef.providedIn).toBe('root'); - expect(Δinject(Service) instanceof Service).toBe(true); + expect(ɵɵinject(Service) instanceof Service).toBe(true); }); it('compiles an injectable with a useValue provider', () => { @@ -53,7 +53,7 @@ ivyEnabled && describe('render3 jit', () => { class Service { } - expect(Δinject(Service)).toBe('test'); + expect(ɵɵinject(Service)).toBe('test'); }); it('compiles an injectable with a useExisting provider', () => { @@ -65,7 +65,7 @@ ivyEnabled && describe('render3 jit', () => { class Service { } - expect(Δinject(Service)).toBe('test'); + expect(ɵɵinject(Service)).toBe('test'); }); it('compiles an injectable with a useFactory provider, without deps', () => { @@ -74,7 +74,7 @@ ivyEnabled && describe('render3 jit', () => { class Service { } - expect(Δinject(Service)).toBe('test'); + expect(ɵɵinject(Service)).toBe('test'); }); it('compiles an injectable with a useFactory provider, with deps', () => { @@ -86,7 +86,7 @@ ivyEnabled && describe('render3 jit', () => { class Service { } - expect(Δinject(Service)).toBe('test'); + expect(ɵɵinject(Service)).toBe('test'); }); it('compiles an injectable with a useClass provider, with deps', () => { @@ -104,7 +104,7 @@ ivyEnabled && describe('render3 jit', () => { } const ServiceAny = Service as any; - expect(Δinject(Service).value).toBe('test'); + expect(ɵɵinject(Service).value).toBe('test'); }); it('compiles an injectable with a useClass provider, without deps', () => { @@ -119,8 +119,8 @@ ivyEnabled && describe('render3 jit', () => { get value(): number { return 0; } } - expect(Δinject(Existing).value).toBe(1); - const injected = Δinject(Service); + expect(ɵɵinject(Existing).value).toBe(1); + const injected = ɵɵinject(Service); expect(injected instanceof Existing).toBe(true); expect(injected.value).toBe(2); }); @@ -139,7 +139,7 @@ ivyEnabled && describe('render3 jit', () => { class Child extends Base { } - expect(Δinject(Child).dep instanceof Dep).toBe(true); + expect(ɵɵinject(Child).dep instanceof Dep).toBe(true); }); it('compiles a module to a definition', () => { @@ -167,7 +167,7 @@ ivyEnabled && describe('render3 jit', () => { it('compiles a module to an ngInjectorDef with the providers', () => { class Token { - static ngInjectableDef = ΔdefineInjectable({ + static ngInjectableDef = ɵɵdefineInjectable({ providedIn: 'root', factory: () => 'default', }); @@ -180,7 +180,7 @@ ivyEnabled && describe('render3 jit', () => { constructor(public token: Token) {} } - const injectorDef: ΔInjectorDef = (Module as any).ngInjectorDef; + const injectorDef: ɵɵInjectorDef = (Module as any).ngInjectorDef; const instance = injectorDef.factory(); // Since the instance was created outside of an injector using the module, the diff --git a/packages/core/test/render3/jit_environment_spec.ts b/packages/core/test/render3/jit_environment_spec.ts index e256047c21..659066d30f 100644 --- a/packages/core/test/render3/jit_environment_spec.ts +++ b/packages/core/test/render3/jit_environment_spec.ts @@ -12,12 +12,12 @@ import {Identifiers} from '@angular/compiler/src/render3/r3_identifiers'; import {angularCoreEnv} from '../../src/render3/jit/environment'; const INTERFACE_EXCEPTIONS = new Set([ - 'ΔBaseDef', - 'ΔComponentDefWithMeta', - 'ΔDirectiveDefWithMeta', - 'ΔInjectorDef', - 'ΔNgModuleDefWithMeta', - 'ΔPipeDefWithMeta', + 'ɵɵBaseDef', + 'ɵɵComponentDefWithMeta', + 'ɵɵDirectiveDefWithMeta', + 'ɵɵInjectorDef', + 'ɵɵNgModuleDefWithMeta', + 'ɵɵPipeDefWithMeta', ]); describe('r3 jit environment', () => { diff --git a/packages/core/test/render3/lifecycle_spec.ts b/packages/core/test/render3/lifecycle_spec.ts index b0883302c2..2c69104aad 100644 --- a/packages/core/test/render3/lifecycle_spec.ts +++ b/packages/core/test/render3/lifecycle_spec.ts @@ -7,8 +7,8 @@ */ import {OnDestroy} from '../../src/core'; -import {AttributeMarker, ComponentTemplate, ΔNgOnChangesFeature, ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index'; -import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δprojection, ΔprojectionDef, Δselect, Δtemplate, Δtext} from '../../src/render3/instructions/all'; +import {AttributeMarker, ComponentTemplate, ɵɵNgOnChangesFeature, ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index'; +import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵprojection, ɵɵprojectionDef, ɵɵselect, ɵɵtemplate, ɵɵtext} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; import {NgIf} from './common_with_def'; @@ -19,10 +19,10 @@ describe('lifecycles', () => { function getParentTemplate(name: string) { return (rf: RenderFlags, ctx: any) => { if (rf & RenderFlags.Create) { - Δelement(0, name); + ɵɵelement(0, name); } if (rf & RenderFlags.Update) { - ΔelementProperty(0, 'val', Δbind(ctx.val)); + ɵɵelementProperty(0, 'val', ɵɵbind(ctx.val)); } }; } @@ -34,16 +34,16 @@ describe('lifecycles', () => { let Comp = createOnInitComponent('comp', (rf: RenderFlags) => { if (rf & RenderFlags.Create) { - ΔprojectionDef(); - ΔelementStart(0, 'div'); - { Δprojection(1); } - ΔelementEnd(); + ɵɵprojectionDef(); + ɵɵelementStart(0, 'div'); + { ɵɵprojection(1); } + ɵɵelementEnd(); } }, 2); let Parent = createOnInitComponent('parent', getParentTemplate('comp'), 1, 1, [Comp]); let ProjectedComp = createOnInitComponent('projected', (rf: RenderFlags) => { if (rf & RenderFlags.Create) { - Δtext(0, 'content'); + ɵɵtext(0, 'content'); } }, 1); @@ -57,7 +57,7 @@ describe('lifecycles', () => { events.push(`${name}${this.val}`); } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Component, selectors: [[name]], consts: consts, @@ -72,7 +72,7 @@ describe('lifecycles', () => { class Directive { ngOnInit() { events.push('dir'); } - static ngDirectiveDef = ΔdefineDirective( + static ngDirectiveDef = ɵɵdefineDirective( {type: Directive, selectors: [['', 'dir', '']], factory: () => new Directive()}); } @@ -86,20 +86,20 @@ describe('lifecycles', () => { */ const App = createComponent('app', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (!ctx.skip) { - let rf1 = ΔembeddedViewStart(0, 1, 0); + let rf1 = ɵɵembeddedViewStart(0, 1, 0); if (rf1 & RenderFlags.Create) { - Δelement(0, 'comp'); + ɵɵelement(0, 'comp'); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, 1, 0, directives); diff --git a/packages/core/test/render3/listeners_spec.ts b/packages/core/test/render3/listeners_spec.ts index b37695351e..546c1155e3 100644 --- a/packages/core/test/render3/listeners_spec.ts +++ b/packages/core/test/render3/listeners_spec.ts @@ -8,11 +8,11 @@ import {dispatchEvent} from '@angular/platform-browser/testing/src/browser_util'; -import {markDirty, Δbind, ΔdefineComponent, ΔdefineDirective, Δreference, ΔresolveBody, ΔresolveDocument, ΔtextBinding} from '../../src/render3/index'; -import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, ΔgetCurrentView, Δlistener, Δtext} from '../../src/render3/instructions/all'; +import {markDirty, ɵɵbind, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵreference, ɵɵresolveBody, ɵɵresolveDocument, ɵɵtextBinding} from '../../src/render3/index'; +import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵgetCurrentView, ɵɵlistener, ɵɵtext} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; import {GlobalTargetResolver} from '../../src/render3/interfaces/renderer'; -import {ΔrestoreView} from '../../src/render3/state'; +import {ɵɵrestoreView} from '../../src/render3/state'; import {getRendererFactory2} from './imported_renderer2'; import {ComponentFixture, TemplateFixture, containerEl, createComponent, getDirectiveOnNode, renderToHtml, requestAnimationFrame} from './render_util'; @@ -28,7 +28,7 @@ describe('event listeners', () => { onClick() { this.counter++; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: MyComp, selectors: [['comp']], consts: 2, @@ -36,12 +36,12 @@ describe('event listeners', () => { /** */ template: function CompTemplate(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } }, factory: () => { @@ -59,14 +59,14 @@ describe('event listeners', () => { /* @HostListener('body:click') */ onBodyClick() { events.push('component - body:click'); } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: MyCompWithGlobalListeners, selectors: [['comp']], consts: 1, vars: 0, template: function CompTemplate(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtext(0, 'Some text'); + ɵɵtext(0, 'Some text'); } }, factory: () => { @@ -77,12 +77,12 @@ describe('event listeners', () => { hostBindings: function HostListenerDir_HostBindings( rf: RenderFlags, ctx: any, elIndex: number) { if (rf & RenderFlags.Create) { - Δlistener('custom', function() { + ɵɵlistener('custom', function() { return ctx.onDocumentCustomEvent(); - }, false, ΔresolveDocument as GlobalTargetResolver); - Δlistener('click', function() { + }, false, ɵɵresolveDocument as GlobalTargetResolver); + ɵɵlistener('click', function() { return ctx.onBodyClick(); - }, false, ΔresolveBody as GlobalTargetResolver); + }, false, ɵɵresolveBody as GlobalTargetResolver); } } }); @@ -95,19 +95,19 @@ describe('event listeners', () => { /* @HostListener('body:click') */ onBodyClick() { events.push('directive - body:click'); } - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: GlobalHostListenerDir, selectors: [['', 'hostListenerDir', '']], factory: function HostListenerDir_Factory() { return new GlobalHostListenerDir(); }, hostBindings: function HostListenerDir_HostBindings( rf: RenderFlags, ctx: any, elIndex: number) { if (rf & RenderFlags.Create) { - Δlistener('custom', function() { + ɵɵlistener('custom', function() { return ctx.onDocumentCustomEvent(); - }, false, ΔresolveDocument as GlobalTargetResolver); - Δlistener('click', function() { + }, false, ɵɵresolveDocument as GlobalTargetResolver); + ɵɵlistener('click', function() { return ctx.onBodyClick(); - }, false, ΔresolveBody as GlobalTargetResolver); + }, false, ɵɵresolveBody as GlobalTargetResolver); } } }); @@ -129,7 +129,7 @@ describe('event listeners', () => { return this.handlerReturnValue; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: PreventDefaultComp, selectors: [['prevent-default-comp']], factory: () => new PreventDefaultComp(), @@ -138,12 +138,12 @@ describe('event listeners', () => { /** */ template: (rf: RenderFlags, ctx: PreventDefaultComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function($event: any) { return ctx.onClick($event); }); - Δtext(1, 'Click'); + ɵɵlistener('click', function($event: any) { return ctx.onClick($event); }); + ɵɵtext(1, 'Click'); } - ΔelementEnd(); + ɵɵelementEnd(); } } }); @@ -205,15 +205,15 @@ describe('event listeners', () => { /** */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { + ɵɵlistener('click', function() { ctx.onClick(); return ctx.onClick2(); }); - Δtext(1, 'Click me'); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } } @@ -240,12 +240,12 @@ describe('event listeners', () => { /** */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.showing = !ctx.showing; }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.showing = !ctx.showing; }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } } @@ -269,24 +269,24 @@ describe('event listeners', () => { */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.showing) { - if (ΔembeddedViewStart(1, 2, 0)) { - ΔelementStart(0, 'button'); + if (ɵɵembeddedViewStart(1, 2, 0)) { + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } @@ -320,7 +320,7 @@ describe('event listeners', () => { onClick() { this.counter++; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AppComp, selectors: [['app-comp']], factory: () => new AppComp(), @@ -328,24 +328,24 @@ describe('event listeners', () => { vars: 0, template: function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.showing) { - if (ΔembeddedViewStart(0, 2, 0)) { - ΔelementStart(0, 'button'); + if (ɵɵembeddedViewStart(0, 2, 0)) { + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } }); @@ -381,7 +381,7 @@ describe('event listeners', () => { onClick(index: number) { this.counters[index]++; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AppComp, selectors: [['app-comp']], factory: () => new AppComp(), @@ -389,24 +389,24 @@ describe('event listeners', () => { vars: 0, template: function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { for (let i = 0; i < ctx.buttons; i++) { - if (ΔembeddedViewStart(0, 2, 0)) { - ΔelementStart(0, 'button'); + if (ɵɵembeddedViewStart(0, 2, 0)) { + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(i); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(i); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } }); @@ -445,7 +445,7 @@ describe('event listeners', () => { onClick(index: number) { this.counters[index]++; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AppComp, selectors: [['app-comp']], factory: () => new AppComp(), @@ -453,31 +453,31 @@ describe('event listeners', () => { vars: 0, template: function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { for (let i = 0; i < ctx.buttons; i++) { - const rf1 = ΔembeddedViewStart(1, 4, 1); + const rf1 = ɵɵembeddedViewStart(1, 4, 1); if (rf1 & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(i); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(i); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); - ΔelementStart(2, 'div'); - { Δtext(3); } - ΔelementEnd(); + ɵɵelementEnd(); + ɵɵelementStart(2, 'div'); + { ɵɵtext(3); } + ɵɵelementEnd(); } if (rf1 & RenderFlags.Update) { - ΔtextBinding(3, Δbind(ctx.counters[i])); + ɵɵtextBinding(3, ɵɵbind(ctx.counters[i])); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } }); @@ -523,21 +523,21 @@ describe('event listeners', () => { /* @HostListener('click') */ onClick() { events.push('click!'); } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: MyComp, selectors: [['comp']], consts: 1, vars: 0, template: function CompTemplate(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtext(0, 'Some text'); + ɵɵtext(0, 'Some text'); } }, factory: () => { return new MyComp(); }, hostBindings: function HostListenerDir_HostBindings( rf: RenderFlags, ctx: any, elIndex: number) { if (rf & RenderFlags.Create) { - Δlistener('click', function() { return ctx.onClick(); }); + ɵɵlistener('click', function() { return ctx.onClick(); }); } } }); @@ -574,23 +574,23 @@ describe('event listeners', () => { /* @HostListener('click') */ onClick() { events.push('click!'); } - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: HostListenerDir, selectors: [['', 'hostListenerDir', '']], factory: function HostListenerDir_Factory() { return new HostListenerDir(); }, hostBindings: function HostListenerDir_HostBindings( rf: RenderFlags, ctx: any, elIndex: number) { if (rf & RenderFlags.Create) { - Δlistener('click', function() { return ctx.onClick(); }); + ɵɵlistener('click', function() { return ctx.onClick(); }); } } }); } const fixture = new TemplateFixture(() => { - ΔelementStart(0, 'button', ['hostListenerDir', '']); - Δtext(1, 'Click'); - ΔelementEnd(); + ɵɵelementStart(0, 'button', ['hostListenerDir', '']); + ɵɵtext(1, 'Click'); + ɵɵelementEnd(); }, () => {}, 2, 0, [HostListenerDir]); const button = fixture.hostElement.querySelector('button') !; @@ -604,7 +604,7 @@ describe('event listeners', () => { it('should support global host listeners on directives', () => { const fixture = new TemplateFixture(() => { - Δelement(0, 'div', ['hostListenerDir', '']); + ɵɵelement(0, 'div', ['hostListenerDir', '']); }, () => {}, 1, 0, [GlobalHostListenerDir]); const doc = fixture.hostElement.ownerDocument !; @@ -626,7 +626,7 @@ describe('event listeners', () => { onClick(a: any, b: any) { this.counter += a + b; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: MyComp, selectors: [['comp']], consts: 2, @@ -634,12 +634,12 @@ describe('event listeners', () => { /** */ template: function CompTemplate(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(ctx.data.a, ctx.data.b); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(ctx.data.a, ctx.data.b); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } }, factory: () => new MyComp() @@ -669,39 +669,39 @@ describe('event listeners', () => { */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.showing) { - let rf1 = ΔembeddedViewStart(0, 2, 0); + let rf1 = ɵɵembeddedViewStart(0, 2, 0); if (rf1 & RenderFlags.Create) { - Δtext(0, 'Hello'); - Δcontainer(1); + ɵɵtext(0, 'Hello'); + ɵɵcontainer(1); } if (rf1 & RenderFlags.Update) { - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshStart(1); { if (ctx.button) { - let rf1 = ΔembeddedViewStart(0, 2, 0); + let rf1 = ɵɵembeddedViewStart(0, 2, 0); if (rf1 & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(); }); - Δtext(1, 'Click'); + ɵɵlistener('click', function() { return ctx.onClick(); }); + ɵɵtext(1, 'Click'); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } @@ -733,22 +733,22 @@ describe('event listeners', () => { */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.showing) { - let rf1 = ΔembeddedViewStart(0, 3, 0); + let rf1 = ɵɵembeddedViewStart(0, 3, 0); if (rf1 & RenderFlags.Create) { - Δtext(0, 'Hello'); - Δelement(1, 'comp'); - Δelement(2, 'comp'); + ɵɵtext(0, 'Hello'); + ɵɵelement(1, 'comp'); + ɵɵelement(2, 'comp'); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } @@ -775,19 +775,19 @@ describe('event listeners', () => { const ctx = {showing: true}; const fixture = new TemplateFixture( - () => { Δcontainer(0); }, + () => { ɵɵcontainer(0); }, () => { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.showing) { - let rf1 = ΔembeddedViewStart(0, 1, 0); + let rf1 = ɵɵembeddedViewStart(0, 1, 0); if (rf1 & RenderFlags.Create) { - Δelement(0, 'comp'); + ɵɵelement(0, 'comp'); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); }, 1, 0, [MyCompWithGlobalListeners]); @@ -820,56 +820,56 @@ describe('event listeners', () => { */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.condition) { - let rf1 = ΔembeddedViewStart(0, 3, 0); + let rf1 = ɵɵembeddedViewStart(0, 3, 0); if (rf1 & RenderFlags.Create) { - Δtext(0, 'Hello'); - Δcontainer(1); - Δcontainer(2); + ɵɵtext(0, 'Hello'); + ɵɵcontainer(1); + ɵɵcontainer(2); } if (rf1 & RenderFlags.Update) { - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshStart(1); { if (ctx.sub1) { - let rf1 = ΔembeddedViewStart(0, 2, 0); + let rf1 = ɵɵembeddedViewStart(0, 2, 0); if (rf1 & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.counter1++; }); - Δtext(1, 'Click'); + ɵɵlistener('click', function() { return ctx.counter1++; }); + ɵɵtext(1, 'Click'); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); - ΔcontainerRefreshStart(2); + ɵɵcontainerRefreshEnd(); + ɵɵcontainerRefreshStart(2); { if (ctx.sub2) { - let rf1 = ΔembeddedViewStart(0, 2, 0); + let rf1 = ɵɵembeddedViewStart(0, 2, 0); if (rf1 & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.counter2++; }); - Δtext(1, 'Click'); + ɵɵlistener('click', function() { return ctx.counter2++; }); + ɵɵtext(1, 'Click'); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } @@ -907,7 +907,7 @@ describe('event listeners', () => { onClick(comp: any) { this.comp = comp; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: App, selectors: [['app']], factory: () => new App(), @@ -915,17 +915,17 @@ describe('event listeners', () => { vars: 0, template: (rf: RenderFlags, ctx: App) => { if (rf & RenderFlags.Create) { - const state = ΔgetCurrentView(); - Δelement(0, 'comp', null, ['comp', '']); - ΔelementStart(2, 'button'); + const state = ɵɵgetCurrentView(); + ɵɵelement(0, 'comp', null, ['comp', '']); + ɵɵelementStart(2, 'button'); { - Δlistener('click', function() { - ΔrestoreView(state); - const comp = Δreference(1); + ɵɵlistener('click', function() { + ɵɵrestoreView(state); + const comp = ɵɵreference(1); return ctx.onClick(comp); }); } - ΔelementEnd(); + ɵɵelementEnd(); } // testing only diff --git a/packages/core/test/render3/outputs_spec.ts b/packages/core/test/render3/outputs_spec.ts index efc1c8605f..58607ea713 100644 --- a/packages/core/test/render3/outputs_spec.ts +++ b/packages/core/test/render3/outputs_spec.ts @@ -8,8 +8,8 @@ import {EventEmitter} from '@angular/core'; -import {ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index'; -import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δlistener, Δtext} from '../../src/render3/instructions/all'; +import {ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index'; +import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵlistener, ɵɵtext} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; import {renderToHtml} from './render_util'; @@ -21,7 +21,7 @@ describe('outputs', () => { change = new EventEmitter(); resetStream = new EventEmitter(); - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ButtonToggle, selectors: [['button-toggle']], template: function(rf: RenderFlags, ctx: any) {}, @@ -37,7 +37,7 @@ describe('outputs', () => { class OtherDir { changeStream = new EventEmitter(); - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: OtherDir, selectors: [['', 'otherDir', '']], factory: () => otherDir = new OtherDir, @@ -60,39 +60,39 @@ describe('outputs', () => { */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); - Δcontainer(2); + ɵɵelementEnd(); + ɵɵcontainer(2); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(2); + ɵɵcontainerRefreshStart(2); { if (ctx.condition) { - let rf1 = ΔembeddedViewStart(0, 1, 0); + let rf1 = ɵɵembeddedViewStart(0, 1, 0); if (rf1 & RenderFlags.Create) { - ΔelementStart(0, 'button-toggle'); + ɵɵelementStart(0, 'button-toggle'); { - Δlistener('change', function() { return ctx.onChange(); }); + ɵɵlistener('change', function() { return ctx.onChange(); }); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } else { - if (ΔembeddedViewStart(1, 1, 0)) { - ΔelementStart(0, 'div', ['otherDir', '']); + if (ɵɵembeddedViewStart(1, 1, 0)) { + ɵɵelementStart(0, 'div', ['otherDir', '']); { - Δlistener('change', function() { return ctx.onChange(); }); + ɵɵlistener('change', function() { return ctx.onChange(); }); } - ΔelementEnd(); + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } diff --git a/packages/core/test/render3/pipe_spec.ts b/packages/core/test/render3/pipe_spec.ts index 44f0464af3..e91dadd74a 100644 --- a/packages/core/test/render3/pipe_spec.ts +++ b/packages/core/test/render3/pipe_spec.ts @@ -6,11 +6,11 @@ * found in the LICENSE file at https://angular.io/license */ -import {Directive as _Directive, Pipe as _Pipe, PipeTransform, WrappedValue, ΔdefinePipe} from '@angular/core'; +import {Directive as _Directive, Pipe as _Pipe, PipeTransform, WrappedValue, ɵɵdefinePipe} from '@angular/core'; import {expect} from '@angular/platform-browser/testing/src/matchers'; -import {Δinterpolation1, Δtext, ΔtextBinding} from '../../src/render3/instructions/all'; -import {Δpipe, ΔpipeBind1} from '../../src/render3/pipe'; +import {ɵɵinterpolation1, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all'; +import {ɵɵpipe, ɵɵpipeBind1} from '../../src/render3/pipe'; import {TemplateFixture} from './render_util'; @@ -29,7 +29,7 @@ describe('pipe', () => { class WrappingPipe implements PipeTransform { transform(value: any) { return new WrappedValue('Bar'); } - static ngPipeDef = ΔdefinePipe({ + static ngPipeDef = ɵɵdefinePipe({ name: 'wrappingPipe', type: WrappingPipe, factory: function WrappingPipe_Factory() { return new WrappingPipe(); }, @@ -38,11 +38,13 @@ describe('pipe', () => { } function createTemplate() { - Δtext(0); - Δpipe(1, 'wrappingPipe'); + ɵɵtext(0); + ɵɵpipe(1, 'wrappingPipe'); } - function updateTemplate() { ΔtextBinding(0, Δinterpolation1('', ΔpipeBind1(1, 1, null), '')); } + function updateTemplate() { + ɵɵtextBinding(0, ɵɵinterpolation1('', ɵɵpipeBind1(1, 1, null), '')); + } it('should unwrap', () => { const fixture = diff --git a/packages/core/test/render3/providers_spec.ts b/packages/core/test/render3/providers_spec.ts index 021b7a18db..0e64029c90 100644 --- a/packages/core/test/render3/providers_spec.ts +++ b/packages/core/test/render3/providers_spec.ts @@ -6,11 +6,11 @@ * found in the LICENSE file at https://angular.io/license */ -import {Component as _Component, ComponentFactoryResolver, ElementRef, InjectFlags, Injectable as _Injectable, InjectionToken, InjectorType, Provider, RendererFactory2, ViewContainerRef, ɵNgModuleDef as NgModuleDef, ΔdefineInjectable, ΔdefineInjector, Δinject} from '../../src/core'; +import {Component as _Component, ComponentFactoryResolver, ElementRef, InjectFlags, Injectable as _Injectable, InjectionToken, InjectorType, Provider, RendererFactory2, ViewContainerRef, ɵNgModuleDef as NgModuleDef, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵinject} from '../../src/core'; import {forwardRef} from '../../src/di/forward_ref'; import {createInjector} from '../../src/di/r3_injector'; -import {injectComponentFactoryResolver, ΔProvidersFeature, ΔdefineComponent, ΔdefineDirective, ΔdirectiveInject} from '../../src/render3/index'; -import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δtext, ΔtextBinding} from '../../src/render3/instructions/all'; +import {injectComponentFactoryResolver, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdirectiveInject} from '../../src/render3/index'; +import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵtext, ɵɵtextBinding} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; import {NgModuleFactory} from '../../src/render3/ng_module_ref'; import {getInjector} from '../../src/render3/util/discovery_utils'; @@ -59,7 +59,7 @@ describe('providers', () => { constructor(private provider: GreeterProvider) { this.greet = this.provider.provide(); } static ngInjectableDef = - ΔdefineInjectable({factory: () => new GreeterInj(Δinject(GreeterProvider as any))}); + ɵɵdefineInjectable({factory: () => new GreeterInj(ɵɵinject(GreeterProvider as any))}); } it('TypeProvider', () => { @@ -67,7 +67,7 @@ describe('providers', () => { parent: { providers: [GreeterClass], componentAssertion: - () => { expect(ΔdirectiveInject(GreeterClass).greet).toEqual('Class'); } + () => { expect(ɵɵdirectiveInject(GreeterClass).greet).toEqual('Class'); } } }); }); @@ -76,7 +76,7 @@ describe('providers', () => { expectProvidersScenario({ parent: { providers: [{provide: GREETER, useValue: {greet: 'Value'}}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Value'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Value'); } } }); }); @@ -85,7 +85,7 @@ describe('providers', () => { expectProvidersScenario({ parent: { providers: [{provide: GREETER, useClass: GreeterClass}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Class'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Class'); } } }); }); @@ -94,7 +94,7 @@ describe('providers', () => { expectProvidersScenario({ parent: { providers: [GreeterClass, {provide: GREETER, useExisting: GreeterClass}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Class'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Class'); } } }); }); @@ -103,7 +103,7 @@ describe('providers', () => { expectProvidersScenario({ parent: { providers: [GreeterClass, {provide: GREETER, useFactory: () => new GreeterClass()}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Class'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Class'); } } }); }); @@ -117,7 +117,7 @@ describe('providers', () => { {provide: MESSAGE, useValue: 'Message'}, {provide: GREETER, useClass: GreeterDeps, deps: [MESSAGE]} ], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Message'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Message'); } } }); }); @@ -130,7 +130,7 @@ describe('providers', () => { {provide: GREETER, useClass: GreeterBuiltInDeps, deps: [MESSAGE, ElementRef]} ], componentAssertion: - () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Message from PARENT'); } + () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Message from PARENT'); } } }); }); @@ -142,7 +142,7 @@ describe('providers', () => { {provide: MESSAGE, useValue: 'Message'}, {provide: GREETER, useFactory: (msg: string) => new GreeterDeps(msg), deps: [MESSAGE]} ], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Message'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Message'); } } }); }); @@ -159,7 +159,7 @@ describe('providers', () => { } ], componentAssertion: - () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Message from PARENT'); } + () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Message from PARENT'); } } }); }); @@ -168,7 +168,8 @@ describe('providers', () => { expectProvidersScenario({ parent: { providers: [GreeterProvider, {provide: GREETER, useClass: GreeterInj}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Provided'); } + componentAssertion: + () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Provided'); } } }); }); @@ -180,7 +181,7 @@ describe('providers', () => { parent: { providers: [forwardRef(() => ForLater)], componentAssertion: - () => { expect(ΔdirectiveInject(ForLater) instanceof ForLater).toBeTruthy(); } + () => { expect(ɵɵdirectiveInject(ForLater) instanceof ForLater).toBeTruthy(); } } }); done(); @@ -195,7 +196,7 @@ describe('providers', () => { parent: { providers: [{provide: GREETER, useValue: forwardRef(() => { return {greet: 'Value'}; })}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Value'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Value'); } } }); }); @@ -204,7 +205,7 @@ describe('providers', () => { expectProvidersScenario({ parent: { providers: [{provide: GREETER, useClass: forwardRef(() => GreeterClass)}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Class'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Class'); } } }); }); @@ -214,7 +215,7 @@ describe('providers', () => { parent: { providers: [GreeterClass, {provide: GREETER, useExisting: forwardRef(() => GreeterClass)}], - componentAssertion: () => { expect(ΔdirectiveInject(GREETER).greet).toEqual('Class'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(GREETER).greet).toEqual('Class'); } } }); }); @@ -225,7 +226,7 @@ describe('providers', () => { parent: { providers: [{provide: GREETER, useValue: {greet: 'Value'}}], componentAssertion: () => { - expect(ΔdirectiveInject(forwardRef(() => GREETER)).greet).toEqual('Value'); + expect(ɵɵdirectiveInject(forwardRef(() => GREETER)).greet).toEqual('Value'); } } }); @@ -255,7 +256,7 @@ describe('providers', () => { parent: { providers: [{provide: String, useValue: 'Message 1'}], directiveProviders: [{provide: String, useValue: 'Message 2'}], - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('Message 2'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('Message 2'); } } }); }); @@ -265,7 +266,7 @@ describe('providers', () => { parent: { providers: [{provide: String, useValue: 'Message 1'}], viewProviders: [{provide: String, useValue: 'Message 2'}], - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('Message 2'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('Message 2'); } } }); }); @@ -275,7 +276,7 @@ describe('providers', () => { parent: { directiveProviders: [{provide: String, useValue: 'Message 1'}], viewProviders: [{provide: String, useValue: 'Message 2'}], - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('Message 2'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('Message 2'); } } }); }); @@ -285,7 +286,7 @@ describe('providers', () => { parent: { directive2Providers: [{provide: String, useValue: 'Message 1'}], directiveProviders: [{provide: String, useValue: 'Message 2'}], - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('Message 2'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('Message 2'); } } }); }); @@ -295,7 +296,7 @@ describe('providers', () => { parent: { providers: [{provide: String, useValue: 'Message 1'}, {provide: String, useValue: 'Message 2'}], - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('Message 2'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('Message 2'); } } }); }); @@ -305,7 +306,7 @@ describe('providers', () => { parent: { viewProviders: [{provide: String, useValue: 'Message 1'}, {provide: String, useValue: 'Message 2'}], - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('Message 2'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('Message 2'); } } }); }); @@ -315,7 +316,7 @@ describe('providers', () => { parent: { directiveProviders: [{provide: String, useValue: 'Message 1'}, {provide: String, useValue: 'Message 2'}], - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('Message 2'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('Message 2'); } } }); }); @@ -323,7 +324,7 @@ describe('providers', () => { describe('single', () => { class MyModule { - static ngInjectorDef = ΔdefineInjector( + static ngInjectorDef = ɵɵdefineInjector( {factory: () => new MyModule(), providers: [{provide: String, useValue: 'From module'}]}); } @@ -331,16 +332,16 @@ describe('providers', () => { it('should work without providers nor viewProviders in component', () => { expectProvidersScenario({ parent: { - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); }, + directiveAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); } }, viewChild: { - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); }, + directiveAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); } }, contentChild: { - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); }, + directiveAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); } }, ngModule: MyModule }); @@ -351,21 +352,21 @@ describe('providers', () => { parent: { providers: [{provide: String, useValue: 'From providers'}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); } }, ngModule: MyModule }); @@ -376,18 +377,18 @@ describe('providers', () => { parent: { viewProviders: [{provide: String, useValue: 'From viewProviders'}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, + directiveAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); } }, contentChild: { - componentAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual('From module'); } + componentAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); }, + directiveAssertion: () => { expect(ɵɵdirectiveInject(String)).toEqual('From module'); } }, ngModule: MyModule }); @@ -399,21 +400,21 @@ describe('providers', () => { providers: [{provide: String, useValue: 'From providers'}], viewProviders: [{provide: String, useValue: 'From viewProviders'}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From providers'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From providers'); } }, ngModule: MyModule }); @@ -427,21 +428,21 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive'}], directive2Providers: [{provide: String, useValue: 'Never'}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, ngModule: MyModule }); @@ -454,21 +455,21 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive'}], directive2Providers: [{provide: String, useValue: 'Never'}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, ngModule: MyModule }); @@ -481,21 +482,21 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive'}], directive2Providers: [{provide: String, useValue: 'Never'}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, ngModule: MyModule }); @@ -509,21 +510,21 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive'}], directive2Providers: [{provide: String, useValue: 'Never'}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From viewProviders'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From viewProviders'); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual('From directive'); } + () => { expect(ɵɵdirectiveInject(String)).toEqual('From directive'); } }, ngModule: MyModule }); @@ -533,7 +534,7 @@ describe('providers', () => { describe('multi', () => { class MyModule { - static ngInjectorDef = ΔdefineInjector({ + static ngInjectorDef = ɵɵdefineInjector({ factory: () => new MyModule(), providers: [{provide: String, useValue: 'From module', multi: true}] }); @@ -544,18 +545,21 @@ describe('providers', () => { expectProvidersScenario({ parent: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); }, + directiveAssertion: + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); }, + directiveAssertion: + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); }, + directiveAssertion: + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); } }, ngModule: MyModule }); @@ -566,21 +570,21 @@ describe('providers', () => { parent: { providers: [{provide: String, useValue: 'From providers', multi: true}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); } }, ngModule: MyModule }); @@ -591,19 +595,21 @@ describe('providers', () => { parent: { viewProviders: [{provide: String, useValue: 'From viewProviders', multi: true}], componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From viewProviders']); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From viewProviders']); }, + directiveAssertion: + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); } }, viewChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From viewProviders']); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From viewProviders']); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From viewProviders']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From viewProviders']); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); }, - directiveAssertion: () => { expect(ΔdirectiveInject(String)).toEqual(['From module']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); }, + directiveAssertion: + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From module']); } }, ngModule: MyModule }); @@ -615,24 +621,24 @@ describe('providers', () => { providers: [{provide: String, useValue: 'From providers', multi: true}], viewProviders: [{provide: String, useValue: 'From viewProviders', multi: true}], componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From providers', 'From viewProviders']); + expect(ɵɵdirectiveInject(String)).toEqual(['From providers', 'From viewProviders']); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); } }, viewChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From providers', 'From viewProviders']); + expect(ɵɵdirectiveInject(String)).toEqual(['From providers', 'From viewProviders']); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From providers', 'From viewProviders']); + expect(ɵɵdirectiveInject(String)).toEqual(['From providers', 'From viewProviders']); } }, contentChild: { componentAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); }, + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); }, directiveAssertion: - () => { expect(ΔdirectiveInject(String)).toEqual(['From providers']); } + () => { expect(ɵɵdirectiveInject(String)).toEqual(['From providers']); } }, ngModule: MyModule }); @@ -646,26 +652,26 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive 1', multi: true}], directive2Providers: [{provide: String, useValue: 'From directive 2', multi: true}], componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); } }, viewChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); } }, contentChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); } }, ngModule: MyModule @@ -679,36 +685,36 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive 1', multi: true}], directive2Providers: [{provide: String, useValue: 'From directive 2', multi: true}], componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); } }, viewChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); } }, contentChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); } @@ -724,32 +730,32 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive 1', multi: true}], directive2Providers: [{provide: String, useValue: 'From directive 2', multi: true}], componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From viewProviders', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); } }, viewChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From viewProviders', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From viewProviders', 'From directive 2', 'From directive 1' ]); } }, contentChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); + expect(ɵɵdirectiveInject(String)).toEqual(['From directive 2', 'From directive 1']); } }, ngModule: MyModule @@ -764,36 +770,36 @@ describe('providers', () => { directiveProviders: [{provide: String, useValue: 'From directive 1', multi: true}], directive2Providers: [{provide: String, useValue: 'From directive 2', multi: true}], componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From viewProviders', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); } }, viewChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From viewProviders', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From viewProviders', 'From directive 2', 'From directive 1' ]); } }, contentChild: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); }, directiveAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual([ + expect(ɵɵdirectiveInject(String)).toEqual([ 'From providers', 'From directive 2', 'From directive 1' ]); } @@ -809,20 +815,20 @@ describe('providers', () => { @Injectable({providedIn: 'root'}) class FooForRoot { static ngInjectableDef = - ΔdefineInjectable({factory: () => new FooForRoot(), providedIn: 'root'}); + ɵɵdefineInjectable({factory: () => new FooForRoot(), providedIn: 'root'}); } expectProvidersScenario({ parent: { componentAssertion: - () => { expect(ΔdirectiveInject(FooForRoot) instanceof FooForRoot).toBeTruthy(); } + () => { expect(ɵɵdirectiveInject(FooForRoot) instanceof FooForRoot).toBeTruthy(); } } }); }); it('should work with a module', () => { class MyModule { - static ngInjectorDef = ΔdefineInjector({ + static ngInjectorDef = ɵɵdefineInjector({ factory: () => new MyModule(), providers: [{provide: String, useValue: 'From module'}] }); @@ -831,13 +837,14 @@ describe('providers', () => { @Injectable({providedIn: MyModule}) class FooForModule { static ngInjectableDef = - ΔdefineInjectable({factory: () => new FooForModule(), providedIn: MyModule}); + ɵɵdefineInjectable({factory: () => new FooForModule(), providedIn: MyModule}); } expectProvidersScenario({ parent: { - componentAssertion: - () => { expect(ΔdirectiveInject(FooForModule) instanceof FooForModule).toBeTruthy(); } + componentAssertion: () => { + expect(ɵɵdirectiveInject(FooForModule) instanceof FooForModule).toBeTruthy(); + } }, ngModule: MyModule }); @@ -852,20 +859,20 @@ describe('providers', () => { class Repeated { constructor(private s: String, private n: Number) {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Repeated, selectors: [['repeated']], - factory: () => new Repeated(ΔdirectiveInject(String), ΔdirectiveInject(Number)), + factory: () => new Repeated(ɵɵdirectiveInject(String), ɵɵdirectiveInject(Number)), consts: 2, vars: 2, template: function(fs: RenderFlags, ctx: Repeated) { if (fs & RenderFlags.Create) { - Δtext(0); - Δtext(1); + ɵɵtext(0); + ɵɵtext(1); } if (fs & RenderFlags.Update) { - ΔtextBinding(0, Δbind(ctx.s)); - ΔtextBinding(1, Δbind(ctx.n)); + ɵɵtextBinding(0, ɵɵbind(ctx.s)); + ɵɵtextBinding(1, ɵɵbind(ctx.n)); } } }); @@ -882,7 +889,7 @@ describe('providers', () => { [{provide: String, useValue: 'foo'}, {provide: Number, useValue: 2, multi: true}], }) class ComponentWithProviders { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ComponentWithProviders, selectors: [['component-with-providers']], factory: () => new ComponentWithProviders(), @@ -890,28 +897,28 @@ describe('providers', () => { vars: 0, template: function(fs: RenderFlags, ctx: ComponentWithProviders) { if (fs & RenderFlags.Create) { - ΔelementStart(0, 'div'); - { Δcontainer(1); } - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + { ɵɵcontainer(1); } + ɵɵelementEnd(); } if (fs & RenderFlags.Update) { - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshStart(1); { for (let i = 0; i < 3; i++) { - let rf1 = ΔembeddedViewStart(1, 1, 0); + let rf1 = ɵɵembeddedViewStart(1, 1, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'repeated'); + ɵɵelement(0, 'repeated'); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, features: [ - ΔProvidersFeature( + ɵɵProvidersFeature( [{provide: Number, useValue: 1, multi: true}], [{provide: String, useValue: 'foo'}, {provide: Number, useValue: 2, multi: true}]), ], @@ -935,24 +942,24 @@ describe('providers', () => { class Repeated { constructor(private s: String, private n: Number) {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Repeated, selectors: [['repeated']], - factory: () => new Repeated(ΔdirectiveInject(String), ΔdirectiveInject(Number)), + factory: () => new Repeated(ɵɵdirectiveInject(String), ɵɵdirectiveInject(Number)), consts: 2, vars: 2, template: function(fs: RenderFlags, ctx: Repeated) { if (fs & RenderFlags.Create) { - Δtext(0); - Δtext(1); + ɵɵtext(0); + ɵɵtext(1); } if (fs & RenderFlags.Update) { - ΔtextBinding(0, Δbind(ctx.s)); - ΔtextBinding(1, Δbind(ctx.n)); + ɵɵtextBinding(0, ɵɵbind(ctx.s)); + ɵɵtextBinding(1, ɵɵbind(ctx.n)); } }, features: [ - ΔProvidersFeature( + ɵɵProvidersFeature( [{provide: Number, useValue: 1, multi: true}], [{provide: String, useValue: 'bar'}, {provide: Number, useValue: 2, multi: true}]), ], @@ -968,7 +975,7 @@ describe('providers', () => { viewProviders: [{provide: toString, useValue: 'foo'}], }) class ComponentWithProviders { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ComponentWithProviders, selectors: [['component-with-providers']], factory: () => new ComponentWithProviders(), @@ -976,27 +983,27 @@ describe('providers', () => { vars: 0, template: function(fs: RenderFlags, ctx: ComponentWithProviders) { if (fs & RenderFlags.Create) { - ΔelementStart(0, 'div'); - { Δcontainer(1); } - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + { ɵɵcontainer(1); } + ɵɵelementEnd(); } if (fs & RenderFlags.Update) { - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshStart(1); { for (let i = 0; i < 3; i++) { - let rf1 = ΔembeddedViewStart(1, 1, 0); + let rf1 = ɵɵembeddedViewStart(1, 1, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'repeated'); + ɵɵelement(0, 'repeated'); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, - features: [ΔProvidersFeature([], [{provide: String, useValue: 'foo'}])], + features: [ɵɵProvidersFeature([], [{provide: String, useValue: 'foo'}])], directives: [Repeated] }); } @@ -1017,18 +1024,18 @@ describe('providers', () => { class EmbeddedComponent { constructor(private s: String) {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: EmbeddedComponent, selectors: [['embedded-cmp']], - factory: () => new EmbeddedComponent(ΔdirectiveInject(String)), + factory: () => new EmbeddedComponent(ɵɵdirectiveInject(String)), consts: 1, vars: 1, template: (rf: RenderFlags, cmp: EmbeddedComponent) => { if (rf & RenderFlags.Create) { - Δtext(0); + ɵɵtext(0); } if (rf & RenderFlags.Update) { - ΔtextBinding(0, Δinterpolation1('', cmp.s, '')); + ɵɵtextBinding(0, ɵɵinterpolation1('', cmp.s, '')); } } }); @@ -1038,20 +1045,20 @@ describe('providers', () => { class HostComponent { constructor(public vcref: ViewContainerRef, public cfr: ComponentFactoryResolver) {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: HostComponent, selectors: [['host-cmp']], factory: () => hostComponent = new HostComponent( - ΔdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), + ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), consts: 1, vars: 0, template: (rf: RenderFlags, cmp: HostComponent) => { if (rf & RenderFlags.Create) { - Δtext(0, 'foo'); + ɵɵtext(0, 'foo'); } }, features: [ - ΔProvidersFeature([{provide: String, useValue: 'From host component'}]), + ɵɵProvidersFeature([{provide: String, useValue: 'From host component'}]), ], }); } @@ -1063,7 +1070,7 @@ describe('providers', () => { class AppComponent { constructor() {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AppComponent, selectors: [['app-cmp']], factory: () => new AppComponent(), @@ -1071,11 +1078,11 @@ describe('providers', () => { vars: 0, template: (rf: RenderFlags, cmp: AppComponent) => { if (rf & RenderFlags.Create) { - Δelement(0, 'host-cmp'); + ɵɵelement(0, 'host-cmp'); } }, features: [ - ΔProvidersFeature([{provide: String, useValue: 'From app component'}]), + ɵɵProvidersFeature([{provide: String, useValue: 'From app component'}]), ], directives: [HostComponent] }); @@ -1104,7 +1111,7 @@ describe('providers', () => { expect(fixture.html).toEqual('foo'); class MyAppModule { - static ngInjectorDef = ΔdefineInjector({ + static ngInjectorDef = ɵɵdefineInjector({ factory: () => new MyAppModule(), imports: [], providers: [ @@ -1147,7 +1154,7 @@ describe('providers', () => { constructor(public value: String) {} static ngInjectableDef = - ΔdefineInjectable({factory: () => new MyService(Δinject(String))}); + ɵɵdefineInjectable({factory: () => new MyService(ɵɵinject(String))}); } expectProvidersScenario({ @@ -1155,8 +1162,8 @@ describe('providers', () => { providers: [MyService, {provide: String, useValue: 'providers'}], viewProviders: [{provide: String, useValue: 'viewProviders'}], componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual('viewProviders'); - expect(ΔdirectiveInject(MyService).value).toEqual('providers'); + expect(ɵɵdirectiveInject(String)).toEqual('viewProviders'); + expect(ɵɵdirectiveInject(MyService).value).toEqual('providers'); } } }); @@ -1164,7 +1171,7 @@ describe('providers', () => { it('should make sure that parent service does not see overrides in child directives', () => { class Greeter { - static ngInjectableDef = ΔdefineInjectable({factory: () => new Greeter(Δinject(String))}); + static ngInjectableDef = ɵɵdefineInjectable({factory: () => new Greeter(ɵɵinject(String))}); constructor(public greeting: String) {} } @@ -1175,7 +1182,7 @@ describe('providers', () => { viewChild: { providers: [{provide: String, useValue: 'view'}], componentAssertion: - () => { expect(ΔdirectiveInject(Greeter).greeting).toEqual('parent'); }, + () => { expect(ɵɵdirectiveInject(Greeter).greeting).toEqual('parent'); }, }, }); }); @@ -1183,7 +1190,7 @@ describe('providers', () => { describe('injection flags', () => { class MyModule { - static ngInjectorDef = ΔdefineInjector( + static ngInjectorDef = ɵɵdefineInjector( {factory: () => new MyModule(), providers: [{provide: String, useValue: 'Module'}]}); } it('should not fall through to ModuleInjector if flags limit the scope', () => { @@ -1191,9 +1198,9 @@ describe('providers', () => { ngModule: MyModule, parent: { componentAssertion: () => { - expect(ΔdirectiveInject(String)).toEqual('Module'); - expect(ΔdirectiveInject(String, InjectFlags.Optional | InjectFlags.Self)).toBeNull(); - expect(ΔdirectiveInject(String, InjectFlags.Optional | InjectFlags.Host)).toBeNull(); + expect(ɵɵdirectiveInject(String)).toEqual('Module'); + expect(ɵɵdirectiveInject(String, InjectFlags.Optional | InjectFlags.Self)).toBeNull(); + expect(ɵɵdirectiveInject(String, InjectFlags.Optional | InjectFlags.Host)).toBeNull(); } } }); @@ -1206,7 +1213,7 @@ describe('providers', () => { class SomeInj implements Some { constructor(public location: String) {} - static ngInjectableDef = ΔdefineInjectable({factory: () => new SomeInj(Δinject(String))}); + static ngInjectableDef = ɵɵdefineInjectable({factory: () => new SomeInj(ɵɵinject(String))}); } @Component({ @@ -1217,7 +1224,7 @@ describe('providers', () => { class MyComponent { constructor() {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: MyComponent, selectors: [['my-cmp']], factory: () => new MyComponent(), @@ -1225,11 +1232,11 @@ describe('providers', () => { vars: 0, template: (rf: RenderFlags, cmp: MyComponent) => { if (rf & RenderFlags.Create) { - Δelement(0, 'p'); + ɵɵelement(0, 'p'); } }, features: [ - ΔProvidersFeature( + ɵɵProvidersFeature( [{provide: String, useValue: 'From my component'}], [{provide: Number, useValue: 123}]), ], @@ -1244,7 +1251,7 @@ describe('providers', () => { class AppComponent { constructor() {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AppComponent, selectors: [['app-cmp']], factory: () => new AppComponent(), @@ -1252,11 +1259,11 @@ describe('providers', () => { vars: 0, template: (rf: RenderFlags, cmp: AppComponent) => { if (rf & RenderFlags.Create) { - Δelement(0, 'my-cmp'); + ɵɵelement(0, 'my-cmp'); } }, features: [ - ΔProvidersFeature([ + ɵɵProvidersFeature([ {provide: String, useValue: 'From app component'}, {provide: Some, useClass: SomeInj} ]), ], @@ -1307,18 +1314,18 @@ describe('providers', () => { class MyComponent { constructor(foo: InjectableWithLifeCycleHooks) {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: MyComponent, selectors: [['my-comp']], - factory: () => new MyComponent(ΔdirectiveInject(InjectableWithLifeCycleHooks)), + factory: () => new MyComponent(ɵɵdirectiveInject(InjectableWithLifeCycleHooks)), consts: 1, vars: 0, template: (rf: RenderFlags, ctx: MyComponent) => { if (rf & RenderFlags.Create) { - Δelement(0, 'span'); + ɵɵelement(0, 'span'); } }, - features: [ΔProvidersFeature([InjectableWithLifeCycleHooks])] + features: [ɵɵProvidersFeature([InjectableWithLifeCycleHooks])] }); } @@ -1334,7 +1341,7 @@ describe('providers', () => { class App { public condition = true; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: App, selectors: [['app-cmp']], factory: () => new App(), @@ -1342,24 +1349,24 @@ describe('providers', () => { vars: 0, template: (rf: RenderFlags, ctx: App) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - { Δcontainer(1); } - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + { ɵɵcontainer(1); } + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshStart(1); { if (ctx.condition) { - let rf1 = ΔembeddedViewStart(1, 2, 1); + let rf1 = ɵɵembeddedViewStart(1, 2, 1); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'my-comp'); + ɵɵelement(0, 'my-comp'); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, directives: [MyComponent] @@ -1409,7 +1416,7 @@ function expectProvidersScenario(defs: { } class ViewChildComponent { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ViewChildComponent, selectors: [['view-child']], consts: 1, @@ -1417,27 +1424,27 @@ function expectProvidersScenario(defs: { factory: () => testComponentInjection(defs.viewChild, new ViewChildComponent()), template: function(fs: RenderFlags, ctx: ViewChildComponent) { if (fs & RenderFlags.Create) { - Δtext(0, 'view-child'); + ɵɵtext(0, 'view-child'); } }, features: defs.viewChild && [ - ΔProvidersFeature(defs.viewChild.providers || [], defs.viewChild.viewProviders || []), + ɵɵProvidersFeature(defs.viewChild.providers || [], defs.viewChild.viewProviders || []), ], }); } class ViewChildDirective { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: ViewChildDirective, selectors: [['view-child']], factory: () => testDirectiveInjection(defs.viewChild, new ViewChildDirective()), - features: defs.viewChild && [ΔProvidersFeature(defs.viewChild.directiveProviders || [])], + features: defs.viewChild && [ɵɵProvidersFeature(defs.viewChild.directiveProviders || [])], }); } class ContentChildComponent { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ContentChildComponent, selectors: [['content-child']], consts: 1, @@ -1445,28 +1452,28 @@ function expectProvidersScenario(defs: { factory: () => testComponentInjection(defs.contentChild, new ContentChildComponent()), template: function(fs: RenderFlags, ctx: ParentComponent) { if (fs & RenderFlags.Create) { - Δtext(0, 'content-child'); + ɵɵtext(0, 'content-child'); } }, features: defs.contentChild && - [ΔProvidersFeature( + [ɵɵProvidersFeature( defs.contentChild.providers || [], defs.contentChild.viewProviders || [])], }); } class ContentChildDirective { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: ContentChildDirective, selectors: [['content-child']], factory: () => testDirectiveInjection(defs.contentChild, new ContentChildDirective()), features: - defs.contentChild && [ΔProvidersFeature(defs.contentChild.directiveProviders || [])], + defs.contentChild && [ɵɵProvidersFeature(defs.contentChild.directiveProviders || [])], }); } class ParentComponent { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ParentComponent, selectors: [['parent']], consts: 1, @@ -1474,36 +1481,36 @@ function expectProvidersScenario(defs: { factory: () => testComponentInjection(defs.parent, new ParentComponent()), template: function(fs: RenderFlags, ctx: ParentComponent) { if (fs & RenderFlags.Create) { - Δelement(0, 'view-child'); + ɵɵelement(0, 'view-child'); } }, features: defs.parent && - [ΔProvidersFeature(defs.parent.providers || [], defs.parent.viewProviders || [])], + [ɵɵProvidersFeature(defs.parent.providers || [], defs.parent.viewProviders || [])], directives: [ViewChildComponent, ViewChildDirective] }); } class ParentDirective { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: ParentDirective, selectors: [['parent']], factory: () => testDirectiveInjection(defs.parent, new ParentDirective()), - features: defs.parent && [ΔProvidersFeature(defs.parent.directiveProviders || [])], + features: defs.parent && [ɵɵProvidersFeature(defs.parent.directiveProviders || [])], }); } class ParentDirective2 { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: ParentDirective2, selectors: [['parent']], factory: () => testDirectiveInjection(defs.parent, new ParentDirective2()), - features: defs.parent && [ΔProvidersFeature(defs.parent.directive2Providers || [])], + features: defs.parent && [ɵɵProvidersFeature(defs.parent.directive2Providers || [])], }); } class App { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: App, selectors: [['app']], consts: 2, @@ -1511,13 +1518,13 @@ function expectProvidersScenario(defs: { factory: () => testComponentInjection(defs.app, new App()), template: function(fs: RenderFlags, ctx: App) { if (fs & RenderFlags.Create) { - ΔelementStart(0, 'parent'); - Δelement(1, 'content-child'); - ΔelementEnd(); + ɵɵelementStart(0, 'parent'); + ɵɵelement(1, 'content-child'); + ɵɵelementEnd(); } }, features: - defs.app && [ΔProvidersFeature(defs.app.providers || [], defs.app.viewProviders || [])], + defs.app && [ɵɵProvidersFeature(defs.app.providers || [], defs.app.viewProviders || [])], directives: [ ParentComponent, ParentDirective2, ParentDirective, ContentChildComponent, ContentChildDirective diff --git a/packages/core/test/render3/pure_function_spec.ts b/packages/core/test/render3/pure_function_spec.ts index f8a99c225a..42f7a17476 100644 --- a/packages/core/test/render3/pure_function_spec.ts +++ b/packages/core/test/render3/pure_function_spec.ts @@ -5,10 +5,10 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import {ΔdefineComponent} from '../../src/render3/index'; -import {Δbind, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔelementEnd, ΔelementProperty, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart} from '../../src/render3/instructions/all'; +import {ɵɵdefineComponent} from '../../src/render3/index'; +import {ɵɵbind, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelementEnd, ɵɵelementProperty, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; -import {ΔpureFunction2} from '../../src/render3/pure_function'; +import {ɵɵpureFunction2} from '../../src/render3/pure_function'; import {getDirectiveOnNode, renderToHtml} from '../../test/render3/render_util'; @@ -19,7 +19,7 @@ describe('object literals', () => { // TODO(issue/24571): remove '!'. config !: {[key: string]: any}; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ObjectComp, selectors: [['object-comp']], factory: function ObjectComp_Factory() { return objectComp = new ObjectComp(); }, @@ -45,27 +45,27 @@ describe('object literals', () => { */ function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { for (let i = 0; i < 2; i++) { - let rf1 = ΔembeddedViewStart(0, 1, 4); + let rf1 = ɵɵembeddedViewStart(0, 1, 4); if (rf1 & RenderFlags.Create) { - ΔelementStart(0, 'object-comp'); + ɵɵelementStart(0, 'object-comp'); objectComps.push(getDirectiveOnNode(0)); - ΔelementEnd(); + ɵɵelementEnd(); } if (rf1 & RenderFlags.Update) { - ΔelementProperty( - 0, 'config', - Δbind(ΔpureFunction2(1, e0_ff, ctx.configs[i].opacity, ctx.configs[i].duration))); + ɵɵelementProperty( + 0, 'config', ɵɵbind(ɵɵpureFunction2( + 1, e0_ff, ctx.configs[i].opacity, ctx.configs[i].duration))); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } diff --git a/packages/core/test/render3/query_spec.ts b/packages/core/test/render3/query_spec.ts index 0ee0ff8859..bc54502ab9 100644 --- a/packages/core/test/render3/query_spec.ts +++ b/packages/core/test/render3/query_spec.ts @@ -9,13 +9,13 @@ import {ElementRef, QueryList, TemplateRef, ViewContainerRef} from '@angular/core'; import {EventEmitter} from '../..'; -import {AttributeMarker, detectChanges, ΔProvidersFeature, ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index'; -import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdirectiveInject, Δelement, ΔelementContainerEnd, ΔelementContainerStart, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δload, Δtemplate, Δtext} from '../../src/render3/instructions/all'; +import {AttributeMarker, detectChanges, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index'; +import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdirectiveInject, ɵɵelement, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵload, ɵɵtemplate, ɵɵtext} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; -import {query, ΔcontentQuery, ΔloadContentQuery, ΔloadViewQuery, ΔqueryRefresh, ΔviewQuery} from '../../src/render3/query'; +import {query, ɵɵcontentQuery, ɵɵloadContentQuery, ɵɵloadViewQuery, ɵɵqueryRefresh, ɵɵviewQuery} from '../../src/render3/query'; import {getLView} from '../../src/render3/state'; import {getNativeByIndex} from '../../src/render3/util/view_utils'; -import {ΔtemplateRefExtractor} from '../../src/render3/view_engine_compatibility_prebound'; +import {ɵɵtemplateRefExtractor} from '../../src/render3/view_engine_compatibility_prebound'; import {ComponentFixture, TemplateFixture, createComponent, createDirective, getDirectiveOnNode, renderComponent} from './render_util'; @@ -68,9 +68,9 @@ describe('query', () => { * } */ if (rf & RenderFlags.Create) { - ΔelementStart(0, 'child'); - { Δelement(1, 'child'); } - ΔelementEnd(); + ɵɵelementStart(0, 'child'); + { ɵɵelement(1, 'child'); } + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { child1 = getDirectiveOnNode(0); @@ -80,14 +80,14 @@ describe('query', () => { 2, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(Child, false, null); - ΔviewQuery(Child, true, null); + ɵɵviewQuery(Child, false, null); + ɵɵviewQuery(Child, true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query0 = tmp as QueryList); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query1 = tmp as QueryList); } }); @@ -113,18 +113,18 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', '']); + ɵɵelement(0, 'div', ['child', '']); elToQuery = getNativeByIndex(0, getLView()); } }, 1, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(Child, false, ElementRef); + ɵɵviewQuery(Child, false, ElementRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -150,19 +150,19 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', ['child', '', 'otherChild', '']); + ɵɵelementStart(0, 'div', ['child', '', 'otherChild', '']); { otherChildInstance = getDirectiveOnNode(0, 1); } - ΔelementEnd(); + ɵɵelementEnd(); } }, 1, 0, [Child, OtherChild], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(Child, false, OtherChild); + ɵɵviewQuery(Child, false, OtherChild); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -186,17 +186,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', '']); + ɵɵelement(0, 'div', ['child', '']); } }, 1, 0, [Child, OtherChild], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(Child, false, OtherChild); + ɵɵviewQuery(Child, false, OtherChild); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -217,13 +217,13 @@ describe('query', () => { class MyDirective { constructor(public service: Service) {} - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: MyDirective, selectors: [['', 'myDir', '']], factory: function MyDirective_Factory() { - return directive = new MyDirective(ΔdirectiveInject(Service)); + return directive = new MyDirective(ɵɵdirectiveInject(Service)); }, - features: [ΔProvidersFeature([Service, {provide: Alias, useExisting: Service}])], + features: [ɵɵProvidersFeature([Service, {provide: Alias, useExisting: Service}])], }); } @@ -245,7 +245,7 @@ describe('query', () => { service?: Service; alias?: Alias; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: App, selectors: [['app']], consts: 1, @@ -253,21 +253,22 @@ describe('query', () => { factory: function App_Factory() { return new App(); }, template: function App_Template(rf: RenderFlags, ctx: App) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['myDir']); + ɵɵelement(0, 'div', ['myDir']); } }, viewQuery: function(rf: RenderFlags, ctx: App) { if (rf & RenderFlags.Create) { - ΔviewQuery(MyDirective, false, null); - ΔviewQuery(Service, false, null); - ΔviewQuery(Alias, false, null); + ɵɵviewQuery(MyDirective, false, null); + ɵɵviewQuery(Service, false, null); + ɵɵviewQuery(Alias, false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.directive = tmp.first); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && (ctx.service = tmp.first); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && (ctx.alias = tmp.first); + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && + (ctx.service = tmp.first); + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.alias = tmp.first); } }, directives: [MyDirective] @@ -291,7 +292,7 @@ describe('query', () => { class App { service?: Service; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: App, selectors: [['app']], consts: 1, @@ -299,16 +300,17 @@ describe('query', () => { factory: function App_Factory() { return new App(); }, template: function App_Template(rf: RenderFlags, ctx: App) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['myDir']); + ɵɵelement(0, 'div', ['myDir']); } }, viewQuery: function(rf: RenderFlags, ctx: App) { let tmp: any; if (rf & RenderFlags.Create) { - ΔviewQuery(MyDirective, false, Alias); + ɵɵviewQuery(MyDirective, false, Alias); } if (rf & RenderFlags.Update) { - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && (ctx.service = tmp.first); + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && + (ctx.service = tmp.first); } }, directives: [MyDirective] @@ -337,19 +339,19 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); elToQuery = getNativeByIndex(0, getLView()); - Δelement(2, 'div'); + ɵɵelement(2, 'div'); } }, 3, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, null); + ɵɵviewQuery(['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -375,22 +377,22 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '', 'bar', '']); + ɵɵelement(0, 'div', null, ['foo', '', 'bar', '']); elToQuery = getNativeByIndex(0, getLView()); - Δelement(3, 'div'); + ɵɵelement(3, 'div'); } }, 4, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, null); - ΔviewQuery(['bar'], false, null); + ɵɵviewQuery(['foo'], false, null); + ɵɵviewQuery(['bar'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.fooQuery = tmp as QueryList); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.barQuery = tmp as QueryList); } }); @@ -422,21 +424,21 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); el1ToQuery = getNativeByIndex(0, getLView()); - Δelement(2, 'div'); - Δelement(3, 'div', null, ['bar', '']); + ɵɵelement(2, 'div'); + ɵɵelement(3, 'div', null, ['bar', '']); el2ToQuery = getNativeByIndex(3, getLView()); } }, 5, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo', 'bar'], false, null); + ɵɵviewQuery(['foo', 'bar'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -462,19 +464,19 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); elToQuery = getNativeByIndex(0, getLView()); - Δelement(2, 'div'); + ɵɵelement(2, 'div'); } }, 3, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, null); + ɵɵviewQuery(['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -499,19 +501,19 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementContainerStart(0, null, ['foo', '']); + ɵɵelementContainerStart(0, null, ['foo', '']); elToQuery = getNativeByIndex(0, getLView()); - ΔelementContainerEnd(); + ɵɵelementContainerEnd(); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, ElementRef); + ɵɵviewQuery(['foo'], false, ElementRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -535,19 +537,19 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementContainerStart(0, null, ['foo', '']); + ɵɵelementContainerStart(0, null, ['foo', '']); elToQuery = getNativeByIndex(0, getLView()); - ΔelementContainerEnd(); + ɵɵelementContainerEnd(); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -597,25 +599,25 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementContainerStart(0); + ɵɵelementContainerStart(0); { - Δelement(1, 'div', null, ['foo', '']); + ɵɵelement(1, 'div', null, ['foo', '']); elToQuery = getNativeByIndex(3, getLView()); } - ΔelementContainerEnd(); + ɵɵelementContainerEnd(); } }, 3, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, ElementRef); - ΔviewQuery(['foo'], false, ElementRef); + ɵɵviewQuery(['foo'], true, ElementRef); + ɵɵviewQuery(['foo'], false, ElementRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.deep = tmp as QueryList); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.shallow = tmp as QueryList); } }); @@ -638,17 +640,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, ViewContainerRef); + ɵɵviewQuery(['foo'], false, ViewContainerRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -670,17 +672,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); + ɵɵtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, ViewContainerRef); + ɵɵviewQuery(['foo'], false, ViewContainerRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -703,18 +705,18 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); + ɵɵtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, ElementRef); + ɵɵviewQuery(['foo'], false, ElementRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -738,17 +740,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); + ɵɵtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, null); + ɵɵviewQuery(['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -771,17 +773,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); + ɵɵtemplate(0, null, 0, 0, 'ng-template', null, ['foo', '']); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, TemplateRef); + ɵɵviewQuery(['foo'], false, TemplateRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -806,7 +808,7 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'child', null, ['foo', '']); + ɵɵelement(0, 'child', null, ['foo', '']); } if (rf & RenderFlags.Update) { childInstance = getDirectiveOnNode(0); @@ -815,11 +817,11 @@ describe('query', () => { 2, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -834,7 +836,7 @@ describe('query', () => { let childInstance: Child; class Child { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Child, selectors: [['child']], factory: () => childInstance = new Child(), @@ -855,17 +857,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'child', null, ['foo', 'child']); + ɵɵelement(0, 'child', null, ['foo', 'child']); } }, 2, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -891,7 +893,7 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', ''], ['foo', 'child']); + ɵɵelement(0, 'div', ['child', ''], ['foo', 'child']); } if (rf & RenderFlags.Update) { childInstance = getDirectiveOnNode(0); @@ -900,11 +902,11 @@ describe('query', () => { 2, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -930,7 +932,7 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement( + ɵɵelement( 0, 'div', ['child1', '', 'child2', ''], ['foo', 'child1', 'bar', 'child2']); } if (rf & RenderFlags.Update) { @@ -941,11 +943,11 @@ describe('query', () => { 3, 0, [Child1, Child2], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo', 'bar'], true, null); + ɵɵviewQuery(['foo', 'bar'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -972,7 +974,7 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', ''], ['foo', 'child', 'bar', 'child']); + ɵɵelement(0, 'div', ['child', ''], ['foo', 'child', 'bar', 'child']); } if (rf & RenderFlags.Update) { childInstance = getDirectiveOnNode(0); @@ -981,14 +983,14 @@ describe('query', () => { 3, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); - ΔviewQuery(['bar'], true, null); + ɵɵviewQuery(['foo'], true, null); + ɵɵviewQuery(['bar'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.fooQuery = tmp as QueryList); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.barQuery = tmp as QueryList); } }); @@ -1018,18 +1020,18 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', ''], ['foo', 'child']); + ɵɵelement(0, 'div', ['child', ''], ['foo', 'child']); div = getNativeByIndex(0, getLView()); } }, 2, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, ElementRef); + ɵɵviewQuery(['foo'], false, ElementRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1054,7 +1056,7 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', ''], ['foo', '', 'bar', 'child']); + ɵɵelement(0, 'div', ['child', ''], ['foo', '', 'bar', 'child']); div = getNativeByIndex(0, getLView()); } if (rf & RenderFlags.Update) { @@ -1064,11 +1066,11 @@ describe('query', () => { 3, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo', 'bar'], false, null); + ɵɵviewQuery(['foo', 'bar'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1093,17 +1095,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['foo', '']); + ɵɵelement(0, 'div', ['foo', '']); } }, 2, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, Child); + ɵɵviewQuery(['foo'], false, Child); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1127,17 +1129,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', '']); + ɵɵelement(0, 'div', ['child', '']); } }, 1, 0, [Child, OtherChild], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(Child, false, OtherChild); + ɵɵviewQuery(Child, false, OtherChild); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1161,17 +1163,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', '']); + ɵɵelement(0, 'div', ['child', '']); } }, 1, 0, [Child, OtherChild], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(OtherChild, false, Child); + ɵɵviewQuery(OtherChild, false, Child); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1192,17 +1194,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div'); + ɵɵelement(0, 'div'); } }, 1, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(TemplateRef as any, false, ElementRef); + ɵɵviewQuery(TemplateRef as any, false, ElementRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1225,17 +1227,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', ''], ['foo', '']); + ɵɵelement(0, 'div', ['child', ''], ['foo', '']); } }, 2, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, Child); + ɵɵviewQuery(['foo'], false, Child); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1259,17 +1261,17 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['child', '']); + ɵɵelement(0, 'div', ['child', '']); } }, 1, 0, [Child], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(TemplateRef as any, false, null); + ɵɵviewQuery(TemplateRef as any, false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1282,9 +1284,9 @@ describe('query', () => { it('should query templates if the type is TemplateRef (and respect "read" option)', () => { function Cmpt_Template_1(rf: RenderFlags, ctx1: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - Δtext(1, 'Test'); - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + ɵɵtext(1, 'Test'); + ɵɵelementEnd(); } } /** @@ -1300,28 +1302,28 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtemplate( + ɵɵtemplate( 0, Cmpt_Template_1, 2, 0, 'ng-template', null, ['foo', ''], - ΔtemplateRefExtractor); - Δtemplate( + ɵɵtemplateRefExtractor); + ɵɵtemplate( 2, Cmpt_Template_1, 2, 0, 'ng-template', null, ['bar', ''], - ΔtemplateRefExtractor); - Δtemplate( + ɵɵtemplateRefExtractor); + ɵɵtemplate( 4, Cmpt_Template_1, 2, 0, 'ng-template', null, ['baz', ''], - ΔtemplateRefExtractor); + ɵɵtemplateRefExtractor); } }, 6, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(TemplateRef as any, false, null); - ΔviewQuery(TemplateRef as any, false, ElementRef); + ɵɵviewQuery(TemplateRef as any, false, null); + ɵɵviewQuery(TemplateRef as any, false, ElementRef); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.tmplQuery = tmp as QueryList); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.elemQuery = tmp as QueryList); } }); @@ -1360,33 +1362,33 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.exp) { - let rf1 = ΔembeddedViewStart(1, 2, 0); + let rf1 = ɵɵembeddedViewStart(1, 2, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); firstEl = getNativeByIndex(0, getLView()); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, 1, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1422,37 +1424,37 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'span', null, ['foo', '']); + ɵɵelement(0, 'span', null, ['foo', '']); firstEl = getNativeByIndex(0, getLView()); - Δcontainer(2); - Δelement(3, 'span', null, ['foo', '']); + ɵɵcontainer(2); + ɵɵelement(3, 'span', null, ['foo', '']); lastEl = getNativeByIndex(3, getLView()); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(2); + ɵɵcontainerRefreshStart(2); { if (ctx.exp) { - let rf1 = ΔembeddedViewStart(1, 2, 0); + let rf1 = ɵɵembeddedViewStart(1, 2, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); viewEl = getNativeByIndex(0, getLView()); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, 5, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1493,43 +1495,43 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.exp1) { - let rf0 = ΔembeddedViewStart(0, 2, 0); + let rf0 = ɵɵembeddedViewStart(0, 2, 0); { if (rf0 & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); firstEl = getNativeByIndex(0, getLView()); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } if (ctx.exp2) { - let rf1 = ΔembeddedViewStart(1, 2, 0); + let rf1 = ɵɵembeddedViewStart(1, 2, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'span', null, ['foo', '']); + ɵɵelement(0, 'span', null, ['foo', '']); lastEl = getNativeByIndex(0, getLView()); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, 1, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1567,50 +1569,50 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.exp1) { - let rf0 = ΔembeddedViewStart(0, 3, 0); + let rf0 = ɵɵembeddedViewStart(0, 3, 0); { if (rf0 & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); firstEl = getNativeByIndex(0, getLView()); - Δcontainer(2); + ɵɵcontainer(2); } if (rf0 & RenderFlags.Update) { - ΔcontainerRefreshStart(2); + ɵɵcontainerRefreshStart(2); { if (ctx.exp2) { - let rf2 = ΔembeddedViewStart(0, 2, 0); + let rf2 = ɵɵembeddedViewStart(0, 2, 0); { if (rf2) { - Δelement(0, 'span', null, ['foo', '']); + ɵɵelement(0, 'span', null, ['foo', '']); lastEl = getNativeByIndex(0, getLView()); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, 1, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1652,38 +1654,38 @@ describe('query', () => { 'cmpt', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); - Δelement(1, 'span', null, ['foo', '']); + ɵɵcontainer(0); + ɵɵelement(1, 'span', null, ['foo', '']); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (ctx.exp) { - let rf0 = ΔembeddedViewStart(0, 4, 0); + let rf0 = ɵɵembeddedViewStart(0, 4, 0); { if (rf0 & RenderFlags.Create) { - ΔelementStart(0, 'div', null, ['foo', '']); - { Δelement(2, 'div', null, ['foo', '']); } - ΔelementEnd(); + ɵɵelementStart(0, 'div', null, ['foo', '']); + { ɵɵelement(2, 'div', null, ['foo', '']); } + ɵɵelementEnd(); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, 3, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); - ΔviewQuery(['foo'], false, null); + ɵɵviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.deep = tmp as QueryList); - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.shallow = tmp as QueryList); } }); @@ -1722,37 +1724,37 @@ describe('query', () => { 'some-component-with-query', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', null, ['foo', '']); + ɵɵelement(0, 'div', null, ['foo', '']); } }, 2, 0, [], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], false, null); + ɵɵviewQuery(['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = queryInstance = tmp as QueryList); } }); - function createTemplate() { Δcontainer(0); } + function createTemplate() { ɵɵcontainer(0); } function updateTemplate() { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { if (condition) { - let rf1 = ΔembeddedViewStart(1, 1, 0); + let rf1 = ɵɵembeddedViewStart(1, 1, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'some-component-with-query'); + ɵɵelement(0, 'some-component-with-query'); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } /** @@ -1779,18 +1781,18 @@ describe('query', () => { this.vcr.createEmbeddedView(this.temp); } - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: SomeDir, selectors: [['', 'someDir', '']], factory: () => new SomeDir( - ΔdirectiveInject(ViewContainerRef as any), ΔdirectiveInject(TemplateRef as any)) + ɵɵdirectiveInject(ViewContainerRef as any), ɵɵdirectiveInject(TemplateRef as any)) }); } function AppComponent_Template_1(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div'); + ɵɵelement(0, 'div'); } } @@ -1802,19 +1804,19 @@ describe('query', () => { 'app', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtemplate( + ɵɵtemplate( 0, AppComponent_Template_1, 1, 0, 'div', [AttributeMarker.Template, 'someDir']); - Δelement(1, 'div', null, ['foo', '']); + ɵɵelement(1, 'div', null, ['foo', '']); } }, 3, 0, [SomeDir], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }); @@ -1840,17 +1842,17 @@ describe('query', () => { this.contentCheckedQuerySnapshot = this.foos ? this.foos.length : 0; } - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: WithContentDirective, selectors: [['', 'with-content', '']], factory: () => withContentInstance = new WithContentDirective(), contentQueries: (rf: RenderFlags, ctx: any, dirIndex: number) => { if (rf & RenderFlags.Create) { - ΔcontentQuery(dirIndex, ['foo'], true, null); + ɵɵcontentQuery(dirIndex, ['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadContentQuery()) && (ctx.foos = tmp); + ɵɵqueryRefresh(tmp = ɵɵloadContentQuery()) && (ctx.foos = tmp); } } }); @@ -1864,9 +1866,9 @@ describe('query', () => { */ const AppComponent = createComponent('app-component', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', [AttributeMarker.Bindings, 'with-content']); - { Δelement(1, 'span', null, ['foo', '']); } - ΔelementEnd(); + ɵɵelementStart(0, 'div', [AttributeMarker.Bindings, 'with-content']); + { ɵɵelement(1, 'span', null, ['foo', '']); } + ɵɵelementEnd(); } }, 3, 0, [WithContentDirective]); @@ -1895,23 +1897,23 @@ describe('query', () => { */ const AppComponent = createComponent('app-component', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δcontainer(0); + ɵɵcontainer(0); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(0); + ɵɵcontainerRefreshStart(0); { for (let i = 0; i < 3; i++) { - let rf = ΔembeddedViewStart(1, 3, 0); + let rf = ɵɵembeddedViewStart(1, 3, 0); if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', [AttributeMarker.Bindings, 'with-content']); - { Δelement(1, 'span', null, ['foo', '']); } - ΔelementEnd(); + ɵɵelementStart(0, 'div', [AttributeMarker.Bindings, 'with-content']); + { ɵɵelement(1, 'span', null, ['foo', '']); } + ɵɵelementEnd(); } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, 1, 0, [WithContentDirective]); @@ -1937,7 +1939,7 @@ describe('query', () => { */ const AppComponent = createComponent('app-component', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['with-content', ''], ['foo', '']); + ɵɵelement(0, 'div', ['with-content', ''], ['foo', '']); } }, 2, 0, [WithContentDirective]); @@ -1961,20 +1963,20 @@ describe('query', () => { 'app-component', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', ['with-content', '']); - { Δelement(1, 'div', null, ['foo', '']); } - ΔelementEnd(); - Δelement(3, 'div', ['id', 'after'], ['bar', '']); + ɵɵelementStart(0, 'div', ['with-content', '']); + { ɵɵelement(1, 'div', null, ['foo', '']); } + ɵɵelementEnd(); + ɵɵelement(3, 'div', ['id', 'after'], ['bar', '']); } }, 5, 0, [WithContentDirective], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo', 'bar'], true, null); + ɵɵviewQuery(['foo', 'bar'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.foos = tmp as QueryList); } }); @@ -2002,20 +2004,20 @@ describe('query', () => { 'app-component', function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', ['with-content', '']); - { Δelement(1, 'div', ['id', 'yes'], ['foo', '']); } - ΔelementEnd(); - Δelement(3, 'div', null, ['foo', '']); + ɵɵelementStart(0, 'div', ['with-content', '']); + { ɵɵelement(1, 'div', ['id', 'yes'], ['foo', '']); } + ɵɵelementEnd(); + ɵɵelement(3, 'div', null, ['foo', '']); } }, 5, 0, [WithContentDirective], [], function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['bar'], true, null); + ɵɵviewQuery(['bar'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.bars = tmp as QueryList); } }); @@ -2028,7 +2030,7 @@ describe('query', () => { it('should report results to appropriate queries where deep content queries are nested', () => { class QueryDirective { fooBars: any; - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: QueryDirective, selectors: [['', 'query', '']], exportAs: ['query'], @@ -2037,11 +2039,11 @@ describe('query', () => { // @ContentChildren('foo, bar, baz', {descendants: true}) // fooBars: QueryList; if (rf & RenderFlags.Create) { - ΔcontentQuery(dirIndex, ['foo', 'bar', 'baz'], true, null); + ɵɵcontentQuery(dirIndex, ['foo', 'bar', 'baz'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadContentQuery()) && (ctx.fooBars = tmp); + ɵɵqueryRefresh(tmp = ɵɵloadContentQuery()) && (ctx.fooBars = tmp); } } }); @@ -2063,19 +2065,19 @@ describe('query', () => { */ function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', [AttributeMarker.Bindings, 'query'], ['out', 'query']); + ɵɵelementStart(0, 'div', [AttributeMarker.Bindings, 'query'], ['out', 'query']); { - Δelement(2, 'span', ['id', 'foo'], ['foo', '']); - ΔelementStart(4, 'div', [AttributeMarker.Bindings, 'query'], ['in', 'query']); - { Δelement(6, 'span', ['id', 'bar'], ['bar', '']); } - ΔelementEnd(); - Δelement(8, 'span', ['id', 'baz'], ['baz', '']); + ɵɵelement(2, 'span', ['id', 'foo'], ['foo', '']); + ɵɵelementStart(4, 'div', [AttributeMarker.Bindings, 'query'], ['in', 'query']); + { ɵɵelement(6, 'span', ['id', 'bar'], ['bar', '']); } + ɵɵelementEnd(); + ɵɵelement(8, 'span', ['id', 'baz'], ['baz', '']); } - ΔelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - outInstance = Δload(1); - inInstance = Δload(5); + outInstance = ɵɵload(1); + inInstance = ɵɵload(5); } }, 10, 0, [QueryDirective]); @@ -2092,7 +2094,7 @@ describe('query', () => { class QueryDirective { fooBars: any; - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: QueryDirective, selectors: [['', 'query', '']], exportAs: ['query'], @@ -2101,11 +2103,11 @@ describe('query', () => { // @ContentChildren('foo', {descendants: true}) // fooBars: QueryList; if (rf & RenderFlags.Create) { - ΔcontentQuery(dirIndex, ['foo'], false, null); + ɵɵcontentQuery(dirIndex, ['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadContentQuery()) && (ctx.fooBars = tmp); + ɵɵqueryRefresh(tmp = ɵɵloadContentQuery()) && (ctx.fooBars = tmp); } } }); @@ -2122,17 +2124,17 @@ describe('query', () => { */ function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', ['query', ''], ['out', 'query']); + ɵɵelementStart(0, 'div', ['query', ''], ['out', 'query']); { - ΔelementStart(2, 'div', ['query', ''], ['in', 'query', 'foo', '']); - { Δelement(5, 'span', ['id', 'bar'], ['foo', '']); } - ΔelementEnd(); + ɵɵelementStart(2, 'div', ['query', ''], ['in', 'query', 'foo', '']); + { ɵɵelement(5, 'span', ['id', 'bar'], ['foo', '']); } + ɵɵelementEnd(); } - ΔelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - outInstance = Δload(1); - inInstance = Δload(3); + outInstance = ɵɵload(1); + inInstance = ɵɵload(3); } }, 7, 0, [QueryDirective]); @@ -2148,7 +2150,7 @@ describe('query', () => { class QueryDirective { fooBars: any; - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: QueryDirective, selectors: [['', 'query', '']], exportAs: ['query'], @@ -2157,11 +2159,11 @@ describe('query', () => { // @ContentChildren('foo', {descendants: true}) // fooBars: QueryList; if (rf & RenderFlags.Create) { - ΔcontentQuery(dirIndex, ['foo'], false, null); + ɵɵcontentQuery(dirIndex, ['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadContentQuery()) && (ctx.fooBars = tmp); + ɵɵqueryRefresh(tmp = ɵɵloadContentQuery()) && (ctx.fooBars = tmp); } } }); @@ -2178,17 +2180,17 @@ describe('query', () => { */ function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', ['query', ''], ['out', 'query']); + ɵɵelementStart(0, 'div', ['query', ''], ['out', 'query']); { - ΔelementStart(2, 'div', ['query', ''], ['in', 'query', 'foo', '']); - { Δelement(5, 'span', ['id', 'bar'], ['foo', '']); } - ΔelementEnd(); + ɵɵelementStart(2, 'div', ['query', ''], ['in', 'query', 'foo', '']); + { ɵɵelement(5, 'span', ['id', 'bar'], ['foo', '']); } + ɵɵelementEnd(); } - ΔelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - outInstance = Δload(1); - inInstance = Δload(3); + outInstance = ɵɵload(1); + inInstance = ɵɵload(3); } }, 7, 0, [QueryDirective]); @@ -2208,7 +2210,7 @@ describe('query', () => { () => { class ShallowQueryDirective { foos: any; - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: ShallowQueryDirective, selectors: [['', 'shallow-query', '']], exportAs: ['shallow-query'], @@ -2217,11 +2219,11 @@ describe('query', () => { // @ContentChildren('foo', {descendants: false}) // foos: QueryList; if (rf & RenderFlags.Create) { - ΔcontentQuery(dirIndex, ['foo'], false, null); + ɵɵcontentQuery(dirIndex, ['foo'], false, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadContentQuery()) && (ctx.foos = tmp); + ɵɵqueryRefresh(tmp = ɵɵloadContentQuery()) && (ctx.foos = tmp); } } }); @@ -2229,7 +2231,7 @@ describe('query', () => { class DeepQueryDirective { foos: any; - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: DeepQueryDirective, selectors: [['', 'deep-query', '']], exportAs: ['deep-query'], @@ -2238,11 +2240,11 @@ describe('query', () => { // @ContentChildren('foo', {descendants: true}) // foos: QueryList; if (rf & RenderFlags.Create) { - ΔcontentQuery(dirIndex, ['foo'], true, null); + ɵɵcontentQuery(dirIndex, ['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadContentQuery()) && (ctx.foos = tmp); + ɵɵqueryRefresh(tmp = ɵɵloadContentQuery()) && (ctx.foos = tmp); } } }); @@ -2263,20 +2265,20 @@ describe('query', () => { */ function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart( + ɵɵelementStart( 0, 'div', [AttributeMarker.Bindings, 'shallow-query', 'deep-query'], ['shallow', 'shallow-query', 'deep', 'deep-query']); { - Δelement(3, 'span', null, ['foo', '']); - ΔelementStart(5, 'div'); - { Δelement(6, 'span', null, ['foo', '']); } - ΔelementEnd(); + ɵɵelement(3, 'span', null, ['foo', '']); + ɵɵelementStart(5, 'div'); + { ɵɵelement(6, 'span', null, ['foo', '']); } + ɵɵelementEnd(); } - ΔelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - shallowInstance = Δload(1); - deepInstance = Δload(2); + shallowInstance = ɵɵload(1); + deepInstance = ɵɵload(2); } }, 8, 0, [ShallowQueryDirective, DeepQueryDirective]); @@ -2291,7 +2293,7 @@ describe('query', () => { class TextDirective { value !: string; - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: TextDirective, selectors: [['', 'text', '']], factory: () => new TextDirective(), @@ -2306,7 +2308,7 @@ describe('query', () => { // @ContentChildren(TextDirective) texts !: QueryList; - static ngComponentDef = ΔdefineDirective({ + static ngComponentDef = ɵɵdefineDirective({ type: ContentQueryDirective, selectors: [['', 'content-query', '']], factory: () => contentQueryDirective = new ContentQueryDirective(), @@ -2314,11 +2316,11 @@ describe('query', () => { // @ContentChildren(TextDirective, {descendants: true}) // texts: QueryList; if (rf & RenderFlags.Create) { - ΔcontentQuery(dirIndex, TextDirective, true, null); + ɵɵcontentQuery(dirIndex, TextDirective, true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadContentQuery()) && (ctx.texts = tmp); + ɵɵqueryRefresh(tmp = ɵɵloadContentQuery()) && (ctx.texts = tmp); } } }); @@ -2339,17 +2341,17 @@ describe('query', () => { */ function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', ['content-query']); + ɵɵelementStart(0, 'div', ['content-query']); { - Δelement(1, 'span', ['text', 'A']); - ΔelementStart(2, 'div', ['text', 'B']); - ΔelementStart(3, 'span', ['text', 'C']); - { Δelement(4, 'span', ['text', 'D']); } - ΔelementEnd(); - ΔelementEnd(); - Δelement(5, 'span', ['text', 'E']); + ɵɵelement(1, 'span', ['text', 'A']); + ɵɵelementStart(2, 'div', ['text', 'B']); + ɵɵelementStart(3, 'span', ['text', 'C']); + { ɵɵelement(4, 'span', ['text', 'D']); } + ɵɵelementEnd(); + ɵɵelementEnd(); + ɵɵelement(5, 'span', ['text', 'E']); } - ΔelementEnd(); + ɵɵelementEnd(); } }, 6, 0, [TextDirective, ContentQueryDirective]); @@ -2374,19 +2376,19 @@ describe('query', () => { // @ViewChildren(TextDirective) texts !: QueryList; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: ViewQueryComponent, selectors: [['view-query']], factory: () => new ViewQueryComponent(), template: function(rf: RenderFlags, ctx: ViewQueryComponent) { if (rf & RenderFlags.Create) { - Δelement(0, 'span', ['text', 'A']); - ΔelementStart(1, 'div', ['text', 'B']); - ΔelementStart(2, 'span', ['text', 'C']); - { Δelement(3, 'span', ['text', 'D']); } - ΔelementEnd(); - ΔelementEnd(); - Δelement(4, 'span', ['text', 'E']); + ɵɵelement(0, 'span', ['text', 'A']); + ɵɵelementStart(1, 'div', ['text', 'B']); + ɵɵelementStart(2, 'span', ['text', 'C']); + { ɵɵelement(3, 'span', ['text', 'D']); } + ɵɵelementEnd(); + ɵɵelementEnd(); + ɵɵelement(4, 'span', ['text', 'E']); } }, consts: 5, @@ -2394,10 +2396,10 @@ describe('query', () => { viewQuery: function(rf: RenderFlags, ctx: ViewQueryComponent) { let tmp: any; if (rf & RenderFlags.Create) { - ΔviewQuery(TextDirective, true, null); + ɵɵviewQuery(TextDirective, true, null); } if (rf & RenderFlags.Update) { - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.texts = tmp as QueryList); } }, diff --git a/packages/core/test/render3/render_util.ts b/packages/core/test/render3/render_util.ts index 37c836b80a..51e8d418d5 100644 --- a/packages/core/test/render3/render_util.ts +++ b/packages/core/test/render3/render_util.ts @@ -28,7 +28,7 @@ import {CreateComponentOptions} from '../../src/render3/component'; import {getDirectivesAtNodeIndex, getLContext, isComponentInstance} from '../../src/render3/context_discovery'; import {extractDirectiveDef, extractPipeDef} from '../../src/render3/definition'; import {NG_ELEMENT_ID} from '../../src/render3/fields'; -import {ComponentDef, ComponentTemplate, ComponentType, DirectiveDef, DirectiveType, RenderFlags, renderComponent as _renderComponent, tick, ΔProvidersFeature, ΔdefineComponent, ΔdefineDirective} from '../../src/render3/index'; +import {ComponentDef, ComponentTemplate, ComponentType, DirectiveDef, DirectiveType, RenderFlags, renderComponent as _renderComponent, tick, ɵɵProvidersFeature, ɵɵdefineComponent, ɵɵdefineDirective} from '../../src/render3/index'; import {DirectiveDefList, DirectiveDefListOrFactory, DirectiveTypesOrFactory, HostBindingsFunction, PipeDef, PipeDefList, PipeDefListOrFactory, PipeTypesOrFactory} from '../../src/render3/interfaces/definition'; import {PlayerHandler} from '../../src/render3/interfaces/player'; import {ProceduralRenderer3, RComment, RElement, RNode, RText, Renderer3, RendererFactory3, RendererStyleFlags3, domRendererFactory3} from '../../src/render3/interfaces/renderer'; @@ -258,7 +258,7 @@ export function renderTemplate( LViewFlags.CheckAlways | LViewFlags.IsRoot, null, null, providedRendererFactory, renderer); enterView(hostLView, null); // SUSPECT! why do we need to enter the View? - const def: ComponentDef = ΔdefineComponent({ + const def: ComponentDef = ɵɵdefineComponent({ factory: () => null, selectors: [], type: Object, @@ -367,7 +367,7 @@ export function createComponent( viewProviders: Provider[] = [], hostBindings?: HostBindingsFunction): ComponentType { return class Component { value: any; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Component, selectors: [[name]], consts: consts, @@ -378,7 +378,7 @@ export function createComponent( directives: directives, hostBindings, pipes: pipes, features: (providers.length > 0 || viewProviders.length > 0)? - [ΔProvidersFeature(providers || [], viewProviders || [])]: [] + [ɵɵProvidersFeature(providers || [], viewProviders || [])]: [] }); }; } @@ -386,7 +386,7 @@ export function createComponent( export function createDirective( name: string, {exportAs}: {exportAs?: string[]} = {}): DirectiveType { return class Directive { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: Directive, selectors: [['', name, '']], factory: () => new Directive(), diff --git a/packages/core/test/render3/renderer_factory_spec.ts b/packages/core/test/render3/renderer_factory_spec.ts index b13582d769..1e7473bdbd 100644 --- a/packages/core/test/render3/renderer_factory_spec.ts +++ b/packages/core/test/render3/renderer_factory_spec.ts @@ -7,8 +7,8 @@ */ import {RendererType2, ViewEncapsulation} from '../../src/core'; -import {ΔdefineComponent} from '../../src/render3/index'; -import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δtext} from '../../src/render3/instructions/all'; +import {ɵɵdefineComponent} from '../../src/render3/index'; +import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵtext} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; import {getRendererFactory2} from './imported_renderer2'; @@ -26,7 +26,7 @@ describe('renderer factory lifecycle', () => { rendererFactory.end = () => logs.push('end'); class SomeComponent { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: SomeComponent, encapsulation: ViewEncapsulation.None, selectors: [['some-component']], @@ -35,7 +35,7 @@ describe('renderer factory lifecycle', () => { template: function(rf: RenderFlags, ctx: SomeComponent) { if (rf & RenderFlags.Create) { logs.push('component create'); - Δtext(0, 'foo'); + ɵɵtext(0, 'foo'); } if (rf & RenderFlags.Update) { logs.push('component update'); @@ -46,7 +46,7 @@ describe('renderer factory lifecycle', () => { } class SomeComponentWhichThrows { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: SomeComponentWhichThrows, encapsulation: ViewEncapsulation.None, selectors: [['some-component-with-Error']], @@ -62,7 +62,7 @@ describe('renderer factory lifecycle', () => { function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { logs.push('function create'); - Δtext(0, 'bar'); + ɵɵtext(0, 'bar'); } if (rf & RenderFlags.Update) { logs.push('function update'); @@ -74,8 +74,8 @@ describe('renderer factory lifecycle', () => { function TemplateWithComponent(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { logs.push('function_with_component create'); - Δtext(0, 'bar'); - Δelement(1, 'some-component'); + ɵɵtext(0, 'bar'); + ɵɵelement(1, 'some-component'); } if (rf & RenderFlags.Update) { logs.push('function_with_component update'); @@ -114,27 +114,27 @@ describe('Renderer2 destruction hooks', () => { let condition = true; function createTemplate() { - ΔelementStart(0, 'div'); - { Δcontainer(1); } - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + { ɵɵcontainer(1); } + ɵɵelementEnd(); } function updateTemplate() { - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshStart(1); { if (condition) { - let rf1 = ΔembeddedViewStart(1, 3, 0); + let rf1 = ɵɵembeddedViewStart(1, 3, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'span'); - Δelement(1, 'span'); - Δelement(2, 'span'); + ɵɵelement(0, 'span'); + ɵɵelement(1, 'span'); + ɵɵelement(2, 'span'); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } const t = new TemplateFixture( @@ -150,7 +150,7 @@ describe('Renderer2 destruction hooks', () => { it('should call renderer.destroy for each component destroyed', () => { class SimpleComponent { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: SimpleComponent, encapsulation: ViewEncapsulation.None, selectors: [['simple']], @@ -158,7 +158,7 @@ describe('Renderer2 destruction hooks', () => { vars: 0, template: function(rf: RenderFlags, ctx: SimpleComponent) { if (rf & RenderFlags.Create) { - Δelement(0, 'span'); + ɵɵelement(0, 'span'); } }, factory: () => new SimpleComponent, @@ -168,27 +168,27 @@ describe('Renderer2 destruction hooks', () => { let condition = true; function createTemplate() { - ΔelementStart(0, 'div'); - { Δcontainer(1); } - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + { ɵɵcontainer(1); } + ɵɵelementEnd(); } function updateTemplate() { - ΔcontainerRefreshStart(1); + ɵɵcontainerRefreshStart(1); { if (condition) { - let rf1 = ΔembeddedViewStart(1, 3, 0); + let rf1 = ɵɵembeddedViewStart(1, 3, 0); { if (rf1 & RenderFlags.Create) { - Δelement(0, 'simple'); - Δelement(1, 'span'); - Δelement(2, 'simple'); + ɵɵelement(0, 'simple'); + ɵɵelement(1, 'span'); + ɵɵelement(2, 'simple'); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } const t = new TemplateFixture( diff --git a/packages/core/test/render3/styling/class_and_style_bindings_spec.ts b/packages/core/test/render3/styling/class_and_style_bindings_spec.ts index f85cc1e3af..3dfecb239f 100644 --- a/packages/core/test/render3/styling/class_and_style_bindings_spec.ts +++ b/packages/core/test/render3/styling/class_and_style_bindings_spec.ts @@ -9,7 +9,7 @@ import {createLView, createTView} from '@angular/core/src/render3/instructions/s import {createRootContext} from '../../../src/render3/component'; import {getLContext} from '../../../src/render3/context_discovery'; -import {ΔclassMap, ΔclassProp, ΔdefineComponent, ΔdefineDirective, ΔelementEnd, ΔelementStart, ΔnamespaceSVG, Δselect, ΔstyleMap, ΔstyleProp, Δstyling, ΔstylingApply} from '../../../src/render3/index'; +import {ɵɵclassMap, ɵɵclassProp, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵelementEnd, ɵɵelementStart, ɵɵnamespaceSVG, ɵɵselect, ɵɵstyleMap, ɵɵstyleProp, ɵɵstyling, ɵɵstylingApply} from '../../../src/render3/index'; import {RenderFlags} from '../../../src/render3/interfaces/definition'; import {AttributeMarker, TAttributes} from '../../../src/render3/interfaces/node'; import {BindingStore, BindingType, PlayState, Player, PlayerContext, PlayerFactory, PlayerHandler} from '../../../src/render3/interfaces/player'; @@ -22,7 +22,7 @@ import {CorePlayerHandler} from '../../../src/render3/styling/core_player_handle import {registerHostDirective} from '../../../src/render3/styling/host_instructions_queue'; import {BoundPlayerFactory, bindPlayerFactory} from '../../../src/render3/styling/player_factory'; import {allocStylingContext, createEmptyStylingContext} from '../../../src/render3/styling/util'; -import {ΔdefaultStyleSanitizer} from '../../../src/sanitization/sanitization'; +import {ɵɵdefaultStyleSanitizer} from '../../../src/sanitization/sanitization'; import {StyleSanitizeFn} from '../../../src/sanitization/style_sanitizer'; import {ComponentFixture, renderToHtml} from '../render_util'; @@ -383,7 +383,7 @@ describe('style and class based bindings', () => { () => { function Template(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'span', [ + ɵɵelementStart(0, 'span', [ AttributeMarker.Styles, 'width', '200px', @@ -392,14 +392,14 @@ describe('style and class based bindings', () => { 'opacity', '0.5', ]); - Δstyling(null, ['width']); - ΔelementEnd(); + ɵɵstyling(null, ['width']); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstyleMap(ctx.myStyles); - ΔstyleProp(0, ctx.myWidth); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstyleMap(ctx.myStyles); + ɵɵstyleProp(0, ctx.myWidth); + ɵɵstylingApply(); } } @@ -419,7 +419,7 @@ describe('style and class based bindings', () => { class Comp { diameter: number = 100; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Comp, selectors: [['comp']], factory: () => new Comp(), @@ -427,18 +427,18 @@ describe('style and class based bindings', () => { vars: 0, template: (rf: RenderFlags, ctx: Comp) => { if (rf & RenderFlags.Create) { - ΔnamespaceSVG(); - ΔelementStart(0, 'svg'); - Δstyling(null, ['width', 'height']); - ΔelementStart(1, 'circle', ['stroke', 'green', 'fill', 'yellow']); - ΔelementEnd(); - ΔelementEnd(); + ɵɵnamespaceSVG(); + ɵɵelementStart(0, 'svg'); + ɵɵstyling(null, ['width', 'height']); + ɵɵelementStart(1, 'circle', ['stroke', 'green', 'fill', 'yellow']); + ɵɵelementEnd(); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstyleProp(0, ctx.diameter, 'px'); - ΔstyleProp(1, ctx.diameter, 'px'); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstyleProp(0, ctx.diameter, 'px'); + ɵɵstyleProp(1, ctx.diameter, 'px'); + ɵɵstylingApply(); } } }); @@ -462,7 +462,7 @@ describe('style and class based bindings', () => { borderWidth: string = '3px'; borderColor: string = 'red'; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Comp, selectors: [['comp']], factory: () => new Comp(), @@ -470,15 +470,15 @@ describe('style and class based bindings', () => { vars: 0, template: (rf: RenderFlags, ctx: Comp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - Δstyling(null, ['borderWidth', 'border-color']); - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + ɵɵstyling(null, ['borderWidth', 'border-color']); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstyleProp(0, ctx.borderWidth); - ΔstyleProp(1, ctx.borderColor); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstyleProp(0, ctx.borderWidth); + ɵɵstyleProp(1, ctx.borderColor); + ɵɵstylingApply(); } } }); @@ -1279,7 +1279,7 @@ describe('style and class based bindings', () => { () => { const getStyles = trackStylesFactory(); const styleBindings = ['border-image', 'border-width']; - const styleSanitizer = ΔdefaultStyleSanitizer; + const styleSanitizer = ɵɵdefaultStyleSanitizer; const stylingContext = createStylingContext(null, styleBindings, null, null, styleSanitizer); @@ -3099,7 +3099,7 @@ describe('style and class based bindings', () => { const fooFactory = bindPlayerFactory(classBuildFn, true); class Comp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Comp, selectors: [['comp']], directives: [Comp], @@ -3108,17 +3108,17 @@ describe('style and class based bindings', () => { vars: 0, template: (rf: RenderFlags, ctx: Comp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - Δstyling(['foo'], ['width']); - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + ɵɵstyling(['foo'], ['width']); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstyleMap(styleMapFactory); - ΔclassMap(classMapFactory); - ΔstyleProp(0, widthFactory); - ΔclassProp(0, fooFactory); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstyleMap(styleMapFactory); + ɵɵclassMap(classMapFactory); + ɵɵstyleProp(0, widthFactory); + ɵɵclassProp(0, fooFactory); + ɵɵstylingApply(); } } }); @@ -3174,7 +3174,7 @@ describe('style and class based bindings', () => { let fooFactory = bindPlayerFactory(buildFn, true) as BoundPlayerFactory; class Comp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Comp, selectors: [['comp']], directives: [Comp], @@ -3183,17 +3183,17 @@ describe('style and class based bindings', () => { vars: 0, template: (rf: RenderFlags, ctx: Comp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - Δstyling(['foo'], ['width']); - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + ɵɵstyling(['foo'], ['width']); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstyleMap(styleMapFactory); - ΔclassMap(classMapFactory); - ΔstyleProp(0, widthFactory); - ΔclassProp(0, fooFactory); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstyleMap(styleMapFactory); + ɵɵclassMap(classMapFactory); + ɵɵstyleProp(0, widthFactory); + ɵɵclassProp(0, fooFactory); + ɵɵstylingApply(); } } }); @@ -3251,18 +3251,18 @@ describe('style and class based bindings', () => { const fooFactory2 = bindPlayerFactory(classBuildFn, true); class MyDir { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: MyDir, selectors: [['', 'my-dir', '']], factory: () => new MyDir(), hostBindings: function(rf: RenderFlags, ctx: MyDir, elementIndex: number) { if (rf & RenderFlags.Create) { - Δstyling(['foo'], ['width']); + ɵɵstyling(['foo'], ['width']); } if (rf & RenderFlags.Update) { - ΔstyleProp(0, ctx.widthFactory); - ΔclassProp(0, ctx.fooFactory); - ΔstylingApply(); + ɵɵstyleProp(0, ctx.widthFactory); + ɵɵclassProp(0, ctx.fooFactory); + ɵɵstylingApply(); } } }); @@ -3272,7 +3272,7 @@ describe('style and class based bindings', () => { } class Comp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Comp, selectors: [['comp']], directives: [Comp, MyDir], @@ -3281,15 +3281,15 @@ describe('style and class based bindings', () => { vars: 0, template: (rf: RenderFlags, ctx: Comp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div', ['my-dir', '']); - Δstyling(['foo'], ['width']); - ΔelementEnd(); + ɵɵelementStart(0, 'div', ['my-dir', '']); + ɵɵstyling(['foo'], ['width']); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstyleProp(0, ctx.widthFactory); - ΔclassProp(0, ctx.fooFactory); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstyleProp(0, ctx.widthFactory); + ɵɵclassProp(0, ctx.fooFactory); + ɵɵstylingApply(); } } }); diff --git a/packages/core/test/render3/styling/players_spec.ts b/packages/core/test/render3/styling/players_spec.ts index 5f73651386..f0b494ddf5 100644 --- a/packages/core/test/render3/styling/players_spec.ts +++ b/packages/core/test/render3/styling/players_spec.ts @@ -8,12 +8,12 @@ import {QueryList} from '@angular/core'; import {RenderFlags} from '@angular/core/src/render3'; -import {getHostElement, ΔdefineComponent, ΔloadViewQuery, ΔviewQuery} from '../../../src/render3/index'; -import {markDirty, Δelement, ΔelementEnd, ΔelementStart, Δselect, Δstyling, ΔstylingApply} from '../../../src/render3/instructions/all'; +import {getHostElement, ɵɵdefineComponent, ɵɵloadViewQuery, ɵɵviewQuery} from '../../../src/render3/index'; +import {markDirty, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵselect, ɵɵstyling, ɵɵstylingApply} from '../../../src/render3/instructions/all'; import {PlayState, Player, PlayerHandler} from '../../../src/render3/interfaces/player'; import {RElement} from '../../../src/render3/interfaces/renderer'; import {addPlayer, getPlayers} from '../../../src/render3/players'; -import {ΔqueryRefresh} from '../../../src/render3/query'; +import {ɵɵqueryRefresh} from '../../../src/render3/query'; import {getOrCreatePlayerContext} from '../../../src/render3/styling/util'; import {ComponentFixture} from '../render_util'; @@ -228,7 +228,7 @@ function buildElementWithStyling() { } class Comp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: Comp, exportAs: ['child'], selectors: [['child-comp']], @@ -237,7 +237,7 @@ class Comp { vars: 0, template: (rf: RenderFlags, ctx: Comp) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div'); + ɵɵelement(0, 'div'); } ctx.logger(); } @@ -248,7 +248,7 @@ class Comp { } class CompWithStyling { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: CompWithStyling, exportAs: ['child-styled'], selectors: [['child-styled-comp']], @@ -257,13 +257,13 @@ class CompWithStyling { vars: 0, template: (rf: RenderFlags, ctx: CompWithStyling) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - Δstyling(['fooClass']); - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + ɵɵstyling(['fooClass']); + ɵɵelementEnd(); } if (rf & RenderFlags.Update) { - Δselect(0); - ΔstylingApply(); + ɵɵselect(0); + ɵɵstylingApply(); } } }); @@ -272,7 +272,7 @@ class CompWithStyling { } class SuperComp { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: SuperComp, selectors: [['super-comp']], factory: () => new SuperComp(), @@ -280,18 +280,18 @@ class SuperComp { vars: 0, template: (rf: RenderFlags, ctx: SuperComp) => { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'div'); - Δelement(1, 'child-comp', ['child', ''], ['child', 'child']); - ΔelementEnd(); + ɵɵelementStart(0, 'div'); + ɵɵelement(1, 'child-comp', ['child', ''], ['child', 'child']); + ɵɵelementEnd(); } }, viewQuery: function(rf: RenderFlags, ctx: SuperComp) { if (rf & RenderFlags.Create) { - ΔviewQuery(['child'], true, null); + ɵɵviewQuery(['child'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.query = tmp as QueryList); } }, diff --git a/packages/core/test/render3/view_container_ref_spec.ts b/packages/core/test/render3/view_container_ref_spec.ts index bfdadb8472..a56f0834ae 100644 --- a/packages/core/test/render3/view_container_ref_spec.ts +++ b/packages/core/test/render3/view_container_ref_spec.ts @@ -8,9 +8,9 @@ import {ChangeDetectorRef, Component as _Component, ComponentFactoryResolver, ComponentRef, ElementRef, QueryList, TemplateRef, ViewContainerRef, ViewRef,} from '../../src/core'; import {ViewEncapsulation} from '../../src/metadata'; -import {injectComponentFactoryResolver, ΔdefineComponent, ΔdefineDirective, Δlistener, ΔloadViewQuery, ΔqueryRefresh, ΔviewQuery,} from '../../src/render3/index'; +import {injectComponentFactoryResolver, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵlistener, ɵɵloadViewQuery, ɵɵqueryRefresh, ɵɵviewQuery,} from '../../src/render3/index'; -import {Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdirectiveInject, Δelement, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δtemplate, Δtext,} from '../../src/render3/instructions/all'; +import {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdirectiveInject, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵtemplate, ɵɵtext,} from '../../src/render3/instructions/all'; import {RenderFlags} from '../../src/render3/interfaces/definition'; import {RElement} from '../../src/render3/interfaces/renderer'; import {getLView} from '../../src/render3/state'; @@ -29,12 +29,12 @@ describe('ViewContainerRef', () => { beforeEach(() => directiveInstance = null); class DirectiveWithVCRef { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: DirectiveWithVCRef, selectors: [['', 'vcref', '']], factory: () => directiveInstance = new DirectiveWithVCRef( - ΔdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), + ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), inputs: {tplRef: 'tplRef', name: 'name'} }); @@ -57,13 +57,13 @@ describe('ViewContainerRef', () => { let directiveInstances: TestDirective[] = []; class TestDirective { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: TestDirective, selectors: [['', 'testdir', '']], factory: () => { const instance = new TestDirective( - ΔdirectiveInject(ViewContainerRef as any), - ΔdirectiveInject(TemplateRef as any)); + ɵɵdirectiveInject(ViewContainerRef as any), + ɵɵdirectiveInject(TemplateRef as any)); directiveInstances.push(instance); @@ -80,13 +80,13 @@ describe('ViewContainerRef', () => { function EmbeddedTemplateA(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtext(0, 'A'); + ɵɵtext(0, 'A'); } } function EmbeddedTemplateB(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtext(0, 'B'); + ɵɵtext(0, 'B'); } } @@ -99,7 +99,7 @@ describe('ViewContainerRef', () => { class TestComponent { // TODO(issue/24571): remove '!'. testDir !: TestDirective; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: TestComponent, encapsulation: ViewEncapsulation.None, selectors: [['test-cmp']], @@ -108,10 +108,10 @@ describe('ViewContainerRef', () => { vars: 0, template: (rf: RenderFlags, cmp: TestComponent) => { if (rf & RenderFlags.Create) { - Δtext(0, 'before|'); - Δtemplate(1, EmbeddedTemplateA, 1, 0, 'ng-template', ['testdir', '']); - Δtemplate(2, EmbeddedTemplateB, 1, 0, 'ng-template', ['testdir', '']); - Δtext(3, '|after'); + ɵɵtext(0, 'before|'); + ɵɵtemplate(1, EmbeddedTemplateA, 1, 0, 'ng-template', ['testdir', '']); + ɵɵtemplate(2, EmbeddedTemplateB, 1, 0, 'ng-template', ['testdir', '']); + ɵɵtext(3, '|after'); } }, directives: [TestDirective] @@ -134,12 +134,12 @@ describe('ViewContainerRef', () => { let directiveInstance: TestDirective; class TestDirective { - static ngDirectiveDef = ΔdefineDirective({ + static ngDirectiveDef = ɵɵdefineDirective({ type: TestDirective, selectors: [['', 'testdir', '']], factory: () => directiveInstance = new TestDirective( - ΔdirectiveInject(ViewContainerRef as any), - ΔdirectiveInject(TemplateRef as any)) + ɵɵdirectiveInject(ViewContainerRef as any), + ɵɵdirectiveInject(TemplateRef as any)) }); constructor(private _vcRef: ViewContainerRef, private _tplRef: TemplateRef<{}>) {} @@ -156,7 +156,7 @@ describe('ViewContainerRef', () => { function EmbeddedTemplateA(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - Δtext(0, 'A'); + ɵɵtext(0, 'A'); } } @@ -172,7 +172,7 @@ describe('ViewContainerRef', () => { condition = false; // TODO(issue/24571): remove '!'. testDir !: TestDirective; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: TestComponent, encapsulation: ViewEncapsulation.None, selectors: [['test-cmp']], @@ -181,25 +181,25 @@ describe('ViewContainerRef', () => { factory: () => new TestComponent(), template: (rf: RenderFlags, cmp: TestComponent) => { if (rf & RenderFlags.Create) { - Δtext(0, 'before|'); - Δtemplate(1, EmbeddedTemplateA, 1, 0, 'ng-template', ['testdir', '']); - Δcontainer(2); - Δtext(3, '|after'); + ɵɵtext(0, 'before|'); + ɵɵtemplate(1, EmbeddedTemplateA, 1, 0, 'ng-template', ['testdir', '']); + ɵɵcontainer(2); + ɵɵtext(3, '|after'); } if (rf & RenderFlags.Update) { - ΔcontainerRefreshStart(2); + ɵɵcontainerRefreshStart(2); { if (cmp.condition) { - let rf1 = ΔembeddedViewStart(0, 1, 0); + let rf1 = ɵɵembeddedViewStart(0, 1, 0); { if (rf1 & RenderFlags.Create) { - Δtext(0, 'B'); + ɵɵtext(0, 'B'); } } - ΔembeddedViewEnd(); + ɵɵembeddedViewEnd(); } } - ΔcontainerRefreshEnd(); + ɵɵcontainerRefreshEnd(); } }, directives: [TestDirective] @@ -239,12 +239,12 @@ describe('ViewContainerRef', () => { class AppComp { constructor(public vcr: ViewContainerRef, public cfr: ComponentFactoryResolver) {} - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AppComp, selectors: [['app-comp']], factory: () => new AppComp( - ΔdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), + ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), consts: 0, vars: 0, template: (rf: RenderFlags, cmp: AppComp) => {} @@ -256,7 +256,7 @@ describe('ViewContainerRef', () => { ngDoCheck() { this.doCheckCount++; } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: DynamicComp, selectors: [['dynamic-comp']], factory: () => dynamicComp = new DynamicComp(), @@ -316,8 +316,8 @@ describe('ViewContainerRef', () => { describe('getters', () => { it('should work on elements', () => { function createTemplate() { - Δelement(0, 'header', ['vcref', '']); - Δelement(1, 'footer'); + ɵɵelement(0, 'header', ['vcref', '']); + ɵɵelement(1, 'footer'); } new TemplateFixture(createTemplate, undefined, 2, 0, [DirectiveWithVCRef]); @@ -335,8 +335,8 @@ describe('ViewContainerRef', () => { createComponent('header-cmp', function(rf: RenderFlags, ctx: any) {}); function createTemplate() { - Δelement(0, 'header-cmp', ['vcref', '']); - Δelement(1, 'footer'); + ɵɵelement(0, 'header-cmp', ['vcref', '']); + ɵɵelement(1, 'footer'); } new TemplateFixture(createTemplate, undefined, 2, 0, [HeaderComponent, DirectiveWithVCRef]); @@ -355,11 +355,11 @@ describe('ViewContainerRef', () => { @Component({selector: 'app', template: ''}) class AppCmpt { - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: AppCmpt, selectors: [['app']], factory: () => new AppCmpt( - ΔdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), + ɵɵdirectiveInject(ViewContainerRef as any), injectComponentFactoryResolver()), consts: 0, vars: 0, template: (rf: RenderFlags, cmp: AppCmpt) => {} @@ -383,7 +383,7 @@ describe('ViewContainerRef', () => { const DynamicComponent = createComponent('dynamic-cmpt', function(rf: RenderFlags, parent: any) { if (rf & RenderFlags.Create) { - Δtext(0, 'inserted dynamically'); + ɵɵtext(0, 'inserted dynamically'); } }, 1, 0); @@ -424,7 +424,7 @@ describe('ViewContainerRef', () => { // @ViewChildren('foo') foo !: QueryList; - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: DynamicCompWithViewQueries, selectors: [['dynamic-cmpt-with-view-queries']], factory: () => dynamicComp = new DynamicCompWithViewQueries(), @@ -432,18 +432,18 @@ describe('ViewContainerRef', () => { vars: 0, template: (rf: RenderFlags, ctx: DynamicCompWithViewQueries) => { if (rf & RenderFlags.Create) { - Δelement(0, 'div', ['bar', ''], ['foo', '']); + ɵɵelement(0, 'div', ['bar', ''], ['foo', '']); } // testing only fooEl = getNativeByIndex(0, getLView()) as RElement; }, viewQuery: function(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔviewQuery(['foo'], true, null); + ɵɵviewQuery(['foo'], true, null); } if (rf & RenderFlags.Update) { let tmp: any; - ΔqueryRefresh(tmp = ΔloadViewQuery>()) && + ɵɵqueryRefresh(tmp = ɵɵloadViewQuery>()) && (ctx.foo = tmp as QueryList); } } @@ -468,7 +468,7 @@ describe('ViewContainerRef', () => { ngOnDestroy() { this.viewRef.destroy(); } - static ngComponentDef = ΔdefineComponent({ + static ngComponentDef = ɵɵdefineComponent({ type: CompWithListenerThatDestroysItself, selectors: [['comp-with-listener-and-on-destroy']], consts: 2, @@ -476,18 +476,18 @@ describe('ViewContainerRef', () => { /** */ template: function CompTemplate(rf: RenderFlags, ctx: any) { if (rf & RenderFlags.Create) { - ΔelementStart(0, 'button'); + ɵɵelementStart(0, 'button'); { - Δlistener('click', function() { return ctx.onClick(); }); - Δtext(1, 'Click me'); + ɵɵlistener('click', function() { return ctx.onClick(); }); + ɵɵtext(1, 'Click me'); } - ΔelementEnd(); + ɵɵelementEnd(); } }, // We want the ViewRef, so we rely on the knowledge that `ViewRef` is actually given // when injecting `ChangeDetectorRef`. factory: () => new CompWithListenerThatDestroysItself( - ΔdirectiveInject(ChangeDetectorRef as any)), + ɵɵdirectiveInject(ChangeDetectorRef as any)), }); } @@ -495,7 +495,7 @@ describe('ViewContainerRef', () => { it('should not error when destroying a view with listeners twice', () => { const CompWithChildListener = createComponent('test-app', (rf: RenderFlags, ctx: any) => { if (rf & RenderFlags.Create) { - Δelement(0, 'comp-with-listener-and-on-destroy'); + ɵɵelement(0, 'comp-with-listener-and-on-destroy'); } }, 1, 0, [CompWithListenerThatDestroysItself]); diff --git a/packages/core/test/sanitization/sanatization_spec.ts b/packages/core/test/sanitization/sanatization_spec.ts index 2b5b2eee51..6c42ec2120 100644 --- a/packages/core/test/sanitization/sanatization_spec.ts +++ b/packages/core/test/sanitization/sanatization_spec.ts @@ -12,7 +12,7 @@ import {HEADER_OFFSET, LView} from '@angular/core/src/render3/interfaces/view'; import {setTNodeAndViewData} from '@angular/core/src/render3/state'; import {bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl} from '../../src/sanitization/bypass'; -import {getUrlSanitizer, ΔsanitizeHtml, ΔsanitizeResourceUrl, ΔsanitizeScript, ΔsanitizeStyle, ΔsanitizeUrl, ΔsanitizeUrlOrResourceUrl} from '../../src/sanitization/sanitization'; +import {getUrlSanitizer, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl} from '../../src/sanitization/sanitization'; import {SecurityContext} from '../../src/sanitization/security'; function fakeLView(): LView { @@ -27,54 +27,54 @@ describe('sanitization', () => { toString() { return this.value; } } it('should sanitize html', () => { - expect(ΔsanitizeHtml('
')).toEqual('
'); - expect(ΔsanitizeHtml(new Wrap('
'))).toEqual('
'); - expect(ΔsanitizeHtml('')) + expect(ɵɵsanitizeHtml('
')).toEqual('
'); + expect(ɵɵsanitizeHtml(new Wrap('
'))).toEqual('
'); + expect(ɵɵsanitizeHtml('')) .toEqual(''); - expect(ΔsanitizeHtml(new Wrap(''))) + expect(ɵɵsanitizeHtml(new Wrap(''))) .toEqual(''); - expect(ΔsanitizeHtml(bypassSanitizationTrustUrl(''))) + expect(ɵɵsanitizeHtml(bypassSanitizationTrustUrl(''))) .toEqual(''); - expect(ΔsanitizeHtml(bypassSanitizationTrustHtml(''))) + expect(ɵɵsanitizeHtml(bypassSanitizationTrustHtml(''))) .toEqual(''); }); it('should sanitize url', () => { - expect(ΔsanitizeUrl('http://server')).toEqual('http://server'); - expect(ΔsanitizeUrl(new Wrap('http://server'))).toEqual('http://server'); - expect(ΔsanitizeUrl('javascript:true')).toEqual('unsafe:javascript:true'); - expect(ΔsanitizeUrl(new Wrap('javascript:true'))).toEqual('unsafe:javascript:true'); - expect(ΔsanitizeUrl(bypassSanitizationTrustHtml('javascript:true'))) + expect(ɵɵsanitizeUrl('http://server')).toEqual('http://server'); + expect(ɵɵsanitizeUrl(new Wrap('http://server'))).toEqual('http://server'); + expect(ɵɵsanitizeUrl('javascript:true')).toEqual('unsafe:javascript:true'); + expect(ɵɵsanitizeUrl(new Wrap('javascript:true'))).toEqual('unsafe:javascript:true'); + expect(ɵɵsanitizeUrl(bypassSanitizationTrustHtml('javascript:true'))) .toEqual('unsafe:javascript:true'); - expect(ΔsanitizeUrl(bypassSanitizationTrustUrl('javascript:true'))).toEqual('javascript:true'); + expect(ɵɵsanitizeUrl(bypassSanitizationTrustUrl('javascript:true'))).toEqual('javascript:true'); }); it('should sanitize resourceUrl', () => { const ERROR = 'unsafe value used in a resource URL context (see http://g.co/ng/security#xss)'; - expect(() => ΔsanitizeResourceUrl('http://server')).toThrowError(ERROR); - expect(() => ΔsanitizeResourceUrl('javascript:true')).toThrowError(ERROR); - expect(() => ΔsanitizeResourceUrl(bypassSanitizationTrustHtml('javascript:true'))) + expect(() => ɵɵsanitizeResourceUrl('http://server')).toThrowError(ERROR); + expect(() => ɵɵsanitizeResourceUrl('javascript:true')).toThrowError(ERROR); + expect(() => ɵɵsanitizeResourceUrl(bypassSanitizationTrustHtml('javascript:true'))) .toThrowError(ERROR); - expect(ΔsanitizeResourceUrl(bypassSanitizationTrustResourceUrl('javascript:true'))) + expect(ɵɵsanitizeResourceUrl(bypassSanitizationTrustResourceUrl('javascript:true'))) .toEqual('javascript:true'); }); it('should sanitize style', () => { - expect(ΔsanitizeStyle('red')).toEqual('red'); - expect(ΔsanitizeStyle(new Wrap('red'))).toEqual('red'); - expect(ΔsanitizeStyle('url("http://server")')).toEqual('unsafe'); - expect(ΔsanitizeStyle(new Wrap('url("http://server")'))).toEqual('unsafe'); - expect(ΔsanitizeStyle(bypassSanitizationTrustHtml('url("http://server")'))).toEqual('unsafe'); - expect(ΔsanitizeStyle(bypassSanitizationTrustStyle('url("http://server")'))) + expect(ɵɵsanitizeStyle('red')).toEqual('red'); + expect(ɵɵsanitizeStyle(new Wrap('red'))).toEqual('red'); + expect(ɵɵsanitizeStyle('url("http://server")')).toEqual('unsafe'); + expect(ɵɵsanitizeStyle(new Wrap('url("http://server")'))).toEqual('unsafe'); + expect(ɵɵsanitizeStyle(bypassSanitizationTrustHtml('url("http://server")'))).toEqual('unsafe'); + expect(ɵɵsanitizeStyle(bypassSanitizationTrustStyle('url("http://server")'))) .toEqual('url("http://server")'); }); it('should sanitize script', () => { const ERROR = 'unsafe value used in a script context'; - expect(() => ΔsanitizeScript('true')).toThrowError(ERROR); - expect(() => ΔsanitizeScript('true')).toThrowError(ERROR); - expect(() => ΔsanitizeScript(bypassSanitizationTrustHtml('true'))).toThrowError(ERROR); - expect(ΔsanitizeScript(bypassSanitizationTrustScript('true'))).toEqual('true'); + expect(() => ɵɵsanitizeScript('true')).toThrowError(ERROR); + expect(() => ɵɵsanitizeScript('true')).toThrowError(ERROR); + expect(() => ɵɵsanitizeScript(bypassSanitizationTrustHtml('true'))).toThrowError(ERROR); + expect(ɵɵsanitizeScript(bypassSanitizationTrustScript('true'))).toEqual('true'); }); it('should select correct sanitizer for URL props', () => { @@ -83,7 +83,7 @@ describe('sanitization', () => { const schema = SECURITY_SCHEMA(); const contextsByProp: Map> = new Map(); const sanitizerNameByContext: Map = new Map([ - [SecurityContext.URL, ΔsanitizeUrl], [SecurityContext.RESOURCE_URL, ΔsanitizeResourceUrl] + [SecurityContext.URL, ɵɵsanitizeUrl], [SecurityContext.RESOURCE_URL, ɵɵsanitizeResourceUrl] ]); Object.keys(schema).forEach(key => { const context = schema[key]; @@ -102,28 +102,29 @@ describe('sanitization', () => { it('should sanitize resourceUrls via sanitizeUrlOrResourceUrl', () => { const ERROR = 'unsafe value used in a resource URL context (see http://g.co/ng/security#xss)'; - expect(() => ΔsanitizeUrlOrResourceUrl('http://server', 'iframe', 'src')).toThrowError(ERROR); - expect(() => ΔsanitizeUrlOrResourceUrl('javascript:true', 'iframe', 'src')).toThrowError(ERROR); + expect(() => ɵɵsanitizeUrlOrResourceUrl('http://server', 'iframe', 'src')).toThrowError(ERROR); + expect(() => ɵɵsanitizeUrlOrResourceUrl('javascript:true', 'iframe', 'src')) + .toThrowError(ERROR); expect( - () => ΔsanitizeUrlOrResourceUrl( + () => ɵɵsanitizeUrlOrResourceUrl( bypassSanitizationTrustHtml('javascript:true'), 'iframe', 'src')) .toThrowError(ERROR); - expect(ΔsanitizeUrlOrResourceUrl( + expect(ɵɵsanitizeUrlOrResourceUrl( bypassSanitizationTrustResourceUrl('javascript:true'), 'iframe', 'src')) .toEqual('javascript:true'); }); it('should sanitize urls via sanitizeUrlOrResourceUrl', () => { - expect(ΔsanitizeUrlOrResourceUrl('http://server', 'a', 'href')).toEqual('http://server'); - expect(ΔsanitizeUrlOrResourceUrl(new Wrap('http://server'), 'a', 'href')) + expect(ɵɵsanitizeUrlOrResourceUrl('http://server', 'a', 'href')).toEqual('http://server'); + expect(ɵɵsanitizeUrlOrResourceUrl(new Wrap('http://server'), 'a', 'href')) .toEqual('http://server'); - expect(ΔsanitizeUrlOrResourceUrl('javascript:true', 'a', 'href')) + expect(ɵɵsanitizeUrlOrResourceUrl('javascript:true', 'a', 'href')) .toEqual('unsafe:javascript:true'); - expect(ΔsanitizeUrlOrResourceUrl(new Wrap('javascript:true'), 'a', 'href')) + expect(ɵɵsanitizeUrlOrResourceUrl(new Wrap('javascript:true'), 'a', 'href')) .toEqual('unsafe:javascript:true'); - expect(ΔsanitizeUrlOrResourceUrl(bypassSanitizationTrustHtml('javascript:true'), 'a', 'href')) + expect(ɵɵsanitizeUrlOrResourceUrl(bypassSanitizationTrustHtml('javascript:true'), 'a', 'href')) .toEqual('unsafe:javascript:true'); - expect(ΔsanitizeUrlOrResourceUrl(bypassSanitizationTrustUrl('javascript:true'), 'a', 'href')) + expect(ɵɵsanitizeUrlOrResourceUrl(bypassSanitizationTrustUrl('javascript:true'), 'a', 'href')) .toEqual('javascript:true'); }); }); diff --git a/packages/core/test/strict_types/inheritance_spec.ts b/packages/core/test/strict_types/inheritance_spec.ts index 39693adc84..b1b5261bd5 100644 --- a/packages/core/test/strict_types/inheritance_spec.ts +++ b/packages/core/test/strict_types/inheritance_spec.ts @@ -6,10 +6,10 @@ * found in the LICENSE file at https://angular.io/license */ -import {ΔComponentDefWithMeta, ΔPipeDefWithMeta as PipeDefWithMeta} from '@angular/core'; +import {ɵɵComponentDefWithMeta, ɵɵPipeDefWithMeta as PipeDefWithMeta} from '@angular/core'; declare class SuperComponent { - static ngComponentDef: ΔComponentDefWithMeta; + static ngComponentDef: ɵɵComponentDefWithMeta; } declare class SubComponent extends SuperComponent { @@ -18,7 +18,7 @@ declare class SubComponent extends SuperComponent { // would produce type errors when the "strictFunctionTypes" option is enabled. onlyInSubtype: string; - static ngComponentDef: ΔComponentDefWithMeta; + static ngComponentDef: ɵɵComponentDefWithMeta; } declare class SuperPipe { static ngPipeDef: PipeDefWithMeta; } diff --git a/packages/core/test/test_bed_spec.ts b/packages/core/test/test_bed_spec.ts index a2b32bbd9c..fa546d6ac1 100644 --- a/packages/core/test/test_bed_spec.ts +++ b/packages/core/test/test_bed_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {Component, Directive, ErrorHandler, Inject, Injectable, InjectionToken, Input, NgModule, Optional, Pipe, ɵsetClassMetadata as setClassMetadata, ΔdefineComponent as defineComponent, Δtext as text} from '@angular/core'; +import {Component, Directive, ErrorHandler, Inject, Injectable, InjectionToken, Input, NgModule, Optional, Pipe, ɵsetClassMetadata as setClassMetadata, ɵɵdefineComponent as defineComponent, ɵɵtext as text} from '@angular/core'; import {TestBed, getTestBed} from '@angular/core/testing/src/test_bed'; import {By} from '@angular/platform-browser'; import {expect} from '@angular/platform-browser/testing/src/matchers'; diff --git a/packages/core/test/view/ng_module_spec.ts b/packages/core/test/view/ng_module_spec.ts index 0f270b9cb2..ec81d5c0ed 100644 --- a/packages/core/test/view/ng_module_spec.ts +++ b/packages/core/test/view/ng_module_spec.ts @@ -10,7 +10,7 @@ import {NgModuleRef} from '@angular/core'; import {InjectFlags, inject} from '@angular/core/src/di'; import {Injector} from '@angular/core/src/di/injector'; import {INJECTOR} from '@angular/core/src/di/injector_compatibility'; -import {ΔInjectableDef, ΔdefineInjectable} from '@angular/core/src/di/interface/defs'; +import {ɵɵInjectableDef, ɵɵdefineInjectable} from '@angular/core/src/di/interface/defs'; import {NgModuleDefinition, NgModuleProviderDef, NodeFlags} from '@angular/core/src/view'; import {moduleDef} from '@angular/core/src/view/ng_module'; import {createNgModuleRef} from '@angular/core/src/view/refs'; @@ -27,14 +27,14 @@ class MyChildModule {} class NotMyModule {} class Bar { - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new Bar(), providedIn: MyModule, }); } class Baz { - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new Baz(), providedIn: NotMyModule, }); @@ -43,7 +43,7 @@ class Baz { class HasNormalDep { constructor(public foo: Foo) {} - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new HasNormalDep(inject(Foo)), providedIn: MyModule, }); @@ -52,7 +52,7 @@ class HasNormalDep { class HasDefinedDep { constructor(public bar: Bar) {} - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new HasDefinedDep(inject(Bar)), providedIn: MyModule, }); @@ -61,14 +61,14 @@ class HasDefinedDep { class HasOptionalDep { constructor(public baz: Baz|null) {} - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new HasOptionalDep(inject(Baz, InjectFlags.Optional)), providedIn: MyModule, }); } class ChildDep { - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new ChildDep(), providedIn: MyChildModule, }); @@ -76,7 +76,7 @@ class ChildDep { class FromChildWithOptionalDep { constructor(public baz: Baz|null) {} - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new FromChildWithOptionalDep(inject(Baz, InjectFlags.Default)), providedIn: MyChildModule, }); @@ -86,7 +86,7 @@ class FromChildWithSkipSelfDep { constructor( public skipSelfChildDep: ChildDep|null, public selfChildDep: ChildDep|null, public optionalSelfBar: Bar|null) {} - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new FromChildWithSkipSelfDep( inject(ChildDep, InjectFlags.SkipSelf|InjectFlags.Optional), inject(ChildDep, InjectFlags.Self), @@ -209,7 +209,7 @@ describe('NgModuleRef_ injector', () => { ngOnDestroy(): void { Service.destroyed++; } - static ngInjectableDef: ΔInjectableDef = ΔdefineInjectable({ + static ngInjectableDef: ɵɵInjectableDef = ɵɵdefineInjectable({ factory: () => new Service(), providedIn: 'root', }); diff --git a/packages/core/testing/src/r3_test_bed_compiler.ts b/packages/core/testing/src/r3_test_bed_compiler.ts index c9153b4063..e18e7f81fa 100644 --- a/packages/core/testing/src/r3_test_bed_compiler.ts +++ b/packages/core/testing/src/r3_test_bed_compiler.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {ApplicationInitStatus, COMPILER_OPTIONS, Compiler, Component, Directive, ModuleWithComponentFactories, NgModule, NgModuleFactory, NgZone, Injector, Pipe, PlatformRef, Provider, Type, ɵcompileComponent as compileComponent, ɵcompileDirective as compileDirective, ɵcompileNgModuleDefs as compileNgModuleDefs, ɵcompilePipe as compilePipe, ɵgetInjectableDef as getInjectableDef, ɵNG_COMPONENT_DEF as NG_COMPONENT_DEF, ɵNG_DIRECTIVE_DEF as NG_DIRECTIVE_DEF, ɵNG_INJECTOR_DEF as NG_INJECTOR_DEF, ɵNG_MODULE_DEF as NG_MODULE_DEF, ɵNG_PIPE_DEF as NG_PIPE_DEF, ɵRender3ComponentFactory as ComponentFactory, ɵRender3NgModuleRef as NgModuleRef, ΔInjectableDef as InjectableDef, ɵNgModuleFactory as R3NgModuleFactory, ɵNgModuleTransitiveScopes as NgModuleTransitiveScopes, ɵNgModuleType as NgModuleType, ɵDirectiveDef as DirectiveDef, ɵpatchComponentDefWithScope as patchComponentDefWithScope, ɵtransitiveScopesFor as transitiveScopesFor,} from '@angular/core'; +import {ApplicationInitStatus, COMPILER_OPTIONS, Compiler, Component, Directive, ModuleWithComponentFactories, NgModule, NgModuleFactory, NgZone, Injector, Pipe, PlatformRef, Provider, Type, ɵcompileComponent as compileComponent, ɵcompileDirective as compileDirective, ɵcompileNgModuleDefs as compileNgModuleDefs, ɵcompilePipe as compilePipe, ɵgetInjectableDef as getInjectableDef, ɵNG_COMPONENT_DEF as NG_COMPONENT_DEF, ɵNG_DIRECTIVE_DEF as NG_DIRECTIVE_DEF, ɵNG_INJECTOR_DEF as NG_INJECTOR_DEF, ɵNG_MODULE_DEF as NG_MODULE_DEF, ɵNG_PIPE_DEF as NG_PIPE_DEF, ɵRender3ComponentFactory as ComponentFactory, ɵRender3NgModuleRef as NgModuleRef, ɵɵInjectableDef as InjectableDef, ɵNgModuleFactory as R3NgModuleFactory, ɵNgModuleTransitiveScopes as NgModuleTransitiveScopes, ɵNgModuleType as NgModuleType, ɵDirectiveDef as DirectiveDef, ɵpatchComponentDefWithScope as patchComponentDefWithScope, ɵtransitiveScopesFor as transitiveScopesFor,} from '@angular/core'; import {ResourceLoader} from '@angular/compiler'; import {clearResolutionOfComponentResourcesQueue, restoreComponentResolutionQueue, resolveComponentResources, isComponentDefPendingResolution} from '../../src/metadata/resource_loading'; diff --git a/packages/core/testing/src/test_bed.ts b/packages/core/testing/src/test_bed.ts index 880e1ae3da..77961d62bb 100644 --- a/packages/core/testing/src/test_bed.ts +++ b/packages/core/testing/src/test_bed.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {ApplicationInitStatus, CompilerOptions, Component, Directive, InjectFlags, InjectionToken, Injector, NgModule, NgModuleFactory, NgModuleRef, NgZone, Optional, Pipe, PlatformRef, Provider, SchemaMetadata, SkipSelf, StaticProvider, Type, ɵAPP_ROOT as APP_ROOT, ɵDepFlags as DepFlags, ɵNodeFlags as NodeFlags, ɵclearOverrides as clearOverrides, ɵgetInjectableDef as getInjectableDef, ɵivyEnabled as ivyEnabled, ɵoverrideComponentView as overrideComponentView, ɵoverrideProvider as overrideProvider, ɵstringify as stringify, ΔInjectableDef} from '@angular/core'; +import {ApplicationInitStatus, CompilerOptions, Component, Directive, InjectFlags, InjectionToken, Injector, NgModule, NgModuleFactory, NgModuleRef, NgZone, Optional, Pipe, PlatformRef, Provider, SchemaMetadata, SkipSelf, StaticProvider, Type, ɵAPP_ROOT as APP_ROOT, ɵDepFlags as DepFlags, ɵNodeFlags as NodeFlags, ɵclearOverrides as clearOverrides, ɵgetInjectableDef as getInjectableDef, ɵivyEnabled as ivyEnabled, ɵoverrideComponentView as overrideComponentView, ɵoverrideProvider as overrideProvider, ɵstringify as stringify, ɵɵInjectableDef} from '@angular/core'; import {AsyncTestCompleter} from './async_test_completer'; import {ComponentFixture} from './component_fixture'; @@ -559,7 +559,7 @@ export class TestBedViewEngine implements Injector, TestBed { deps?: any[], }, deprecated = false): void { - let def: ΔInjectableDef|null = null; + let def: ɵɵInjectableDef|null = null; if (typeof token !== 'string' && (def = getInjectableDef(token)) && def.providedIn === 'root') { if (provider.useFactory) { this._rootProviderOverrides.push( diff --git a/packages/platform-browser/src/browser/meta.ts b/packages/platform-browser/src/browser/meta.ts index e32b984a46..eb8ad345d3 100644 --- a/packages/platform-browser/src/browser/meta.ts +++ b/packages/platform-browser/src/browser/meta.ts @@ -7,7 +7,7 @@ */ import {DOCUMENT} from '@angular/common'; -import {Inject, Injectable, Δinject} from '@angular/core'; +import {Inject, Injectable, ɵɵinject} from '@angular/core'; import {DomAdapter, getDOM} from '../dom/dom_adapter'; @@ -34,7 +34,7 @@ export type MetaDefinition = { * Factory to create Meta service. */ export function createMeta() { - return new Meta(Δinject(DOCUMENT)); + return new Meta(ɵɵinject(DOCUMENT)); } /** diff --git a/packages/platform-browser/src/browser/title.ts b/packages/platform-browser/src/browser/title.ts index a5f7b807fa..623f2f8ea8 100644 --- a/packages/platform-browser/src/browser/title.ts +++ b/packages/platform-browser/src/browser/title.ts @@ -7,7 +7,7 @@ */ import {DOCUMENT} from '@angular/common'; -import {Inject, Injectable, Δinject} from '@angular/core'; +import {Inject, Injectable, ɵɵinject} from '@angular/core'; import {getDOM} from '../dom/dom_adapter'; @@ -15,7 +15,7 @@ import {getDOM} from '../dom/dom_adapter'; * Factory to create Title service. */ export function createTitle() { - return new Title(Δinject(DOCUMENT)); + return new Title(ɵɵinject(DOCUMENT)); } /** diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index dc664d6c6f..1a3c687730 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -266,7 +266,7 @@ export declare class DefaultIterableDiffer implements IterableDiffer, Iter } /** @deprecated */ -export declare const defineInjectable: typeof ΔdefineInjectable; +export declare const defineInjectable: typeof ɵɵdefineInjectable; export declare function destroyPlatform(): void; @@ -383,7 +383,7 @@ export interface HostListenerDecorator { new (eventName: string, args?: string[]): any; } -export declare const inject: typeof Δinject; +export declare const inject: typeof ɵɵinject; export interface Inject { token: any; @@ -659,6 +659,386 @@ export interface OutputDecorator { new (bindingPropertyName?: string): any; } +export declare function ɵɵallocHostVars(count: number): void; + +export interface ɵɵBaseDef { + contentQueries: ContentQueriesFunction | null; + /** @deprecated */ readonly declaredInputs: { + [P in keyof T]: string; + }; + hostBindings: HostBindingsFunction | null; + readonly inputs: { + [P in keyof T]: string; + }; + readonly outputs: { + [P in keyof T]: string; + }; + viewQuery: ViewQueriesFunction | null; +} + +export declare function ɵɵbind(value: T): T | NO_CHANGE; + +export declare function ɵɵclassMap(classes: { + [styleName: string]: any; +} | NO_CHANGE | string | null): void; + +export declare function ɵɵclassProp(classIndex: number, value: boolean | PlayerFactory, forceOverride?: boolean): void; + +export declare type ɵɵComponentDefWithMeta = ComponentDef; + +export declare function ɵɵcomponentHostSyntheticListener(eventName: string, listenerFn: (e?: any) => any, useCapture?: boolean, eventTargetResolver?: GlobalTargetResolver): void; + +export declare function ɵɵcomponentHostSyntheticProperty(index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): void; + +export declare function ɵɵcontainer(index: number): void; + +export declare function ɵɵcontainerRefreshEnd(): void; + +export declare function ɵɵcontainerRefreshStart(index: number): void; + +export declare function ɵɵcontentQuery(directiveIndex: number, predicate: Type | string[], descend: boolean, read: any): QueryList; + +export declare const ɵɵdefaultStyleSanitizer: StyleSanitizeFn; + +export declare function ɵɵdefineBase(baseDefinition: { + inputs?: { + [P in keyof T]?: string | [string, string]; + }; + outputs?: { + [P in keyof T]?: string; + }; + contentQueries?: ContentQueriesFunction | null; + viewQuery?: ViewQueriesFunction | null; + hostBindings?: HostBindingsFunction; +}): ɵɵBaseDef; + +export declare function ɵɵdefineComponent(componentDefinition: { + type: Type; + selectors: CssSelectorList; + factory: FactoryFn; + consts: number; + vars: number; + inputs?: { + [P in keyof T]?: string | [string, string]; + }; + outputs?: { + [P in keyof T]?: string; + }; + hostBindings?: HostBindingsFunction; + contentQueries?: ContentQueriesFunction; + exportAs?: string[]; + template: ComponentTemplate; + ngContentSelectors?: string[]; + viewQuery?: ViewQueriesFunction | null; + features?: ComponentDefFeature[]; + encapsulation?: ViewEncapsulation; + data?: { + [kind: string]: any; + }; + styles?: string[]; + changeDetection?: ChangeDetectionStrategy; + directives?: DirectiveTypesOrFactory | null; + pipes?: PipeTypesOrFactory | null; + schemas?: SchemaMetadata[] | null; +}): never; + +export declare const ɵɵdefineDirective: (directiveDefinition: { + type: Type; + selectors: (string | SelectorFlags)[][]; + factory: FactoryFn; + inputs?: { [P in keyof T]?: string | [string, string] | undefined; } | undefined; + outputs?: { [P in keyof T]?: string | undefined; } | undefined; + features?: DirectiveDefFeature[] | undefined; + hostBindings?: HostBindingsFunction | undefined; + contentQueries?: ContentQueriesFunction | undefined; + viewQuery?: ViewQueriesFunction | null | undefined; + exportAs?: string[] | undefined; +}) => never; + +export declare function ɵɵdefineInjectable(opts: { + providedIn?: Type | 'root' | 'any' | null; + factory: () => T; +}): never; + +export declare function ɵɵdefineInjector(options: { + factory: () => any; + providers?: any[]; + imports?: any[]; +}): never; + +export declare function ɵɵdefineNgModule(def: { + type: T; + bootstrap?: Type[] | (() => Type[]); + declarations?: Type[] | (() => Type[]); + imports?: Type[] | (() => Type[]); + exports?: Type[] | (() => Type[]); + schemas?: SchemaMetadata[] | null; + id?: string | null; +}): never; + +export declare function ɵɵdefinePipe(pipeDef: { + name: string; + type: Type; + factory: FactoryFn; + pure?: boolean; +}): never; + +export declare type ɵɵDirectiveDefWithMeta = DirectiveDef; + +export declare function ɵɵdirectiveInject(token: Type | InjectionToken): T; +export declare function ɵɵdirectiveInject(token: Type | InjectionToken, flags: InjectFlags): T; + +export declare function ɵɵdisableBindings(): void; + +export declare function ɵɵelement(index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void; + +export declare function ɵɵelementAttribute(index: number, name: string, value: any, sanitizer?: SanitizerFn | null, namespace?: string): void; + +export declare function ɵɵelementContainerEnd(): void; + +export declare function ɵɵelementContainerStart(index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void; + +export declare function ɵɵelementEnd(): void; + +export declare function ɵɵelementHostAttrs(attrs: TAttributes): void; + +export declare function ɵɵelementProperty(index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): void; + +export declare function ɵɵelementStart(index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void; + +export declare function ɵɵembeddedViewEnd(): void; + +export declare function ɵɵembeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags; + +export declare function ɵɵenableBindings(): void; + +export declare function ɵɵgetCurrentView(): OpaqueViewState; + +export declare function ɵɵgetFactoryOf(type: Type): ((type: Type | null) => T) | null; + +export declare function ɵɵgetInheritedFactory(type: Type): (type: Type) => T; + +export declare function ɵɵi18n(index: number, message: string, subTemplateIndex?: number): void; + +export declare function ɵɵi18nApply(index: number): void; + +export declare function ɵɵi18nAttributes(index: number, values: string[]): void; + +export declare function ɵɵi18nEnd(): void; + +export declare function ɵɵi18nExp(expression: T | NO_CHANGE): void; + +/** @deprecated */ +export declare function ɵɵi18nLocalize(input: string, placeholders?: { + [key: string]: string; +}): string; + +export declare function ɵɵi18nPostprocess(message: string, replacements?: { + [key: string]: (string | string[]); +}): string; + +export declare function ɵɵi18nStart(index: number, message: string, subTemplateIndex?: number): void; + +export declare function ɵɵInheritDefinitionFeature(definition: DirectiveDef | ComponentDef): void; + +export declare function ɵɵinject(token: Type | InjectionToken): T; +export declare function ɵɵinject(token: Type | InjectionToken, flags?: InjectFlags): T | null; + +export interface ɵɵInjectableDef { + factory: () => T; + providedIn: InjectorType | 'root' | 'any' | null; + value: T | undefined; +} + +export declare function ɵɵinjectAttribute(attrNameToInject: string): string | null; + +export interface ɵɵInjectorDef { + factory: () => T; + imports: (InjectorType | InjectorTypeWithProviders)[]; + providers: (Type | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | any[])[]; +} + +export declare function ɵɵinterpolation1(prefix: string, v0: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolation2(prefix: string, v0: any, i0: string, v1: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolation3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolation4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolation5(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolation6(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolation7(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolation8(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string): string | NO_CHANGE; + +export declare function ɵɵinterpolationV(values: any[]): string | NO_CHANGE; + +export declare function ɵɵlistener(eventName: string, listenerFn: (e?: any) => any, useCapture?: boolean, eventTargetResolver?: GlobalTargetResolver): void; + +export declare function ɵɵload(index: number): T; + +export declare function ɵɵloadContentQuery(): QueryList; + +export declare function ɵɵloadViewQuery(): T; + +export declare function ɵɵnamespaceHTML(): void; + +export declare function ɵɵnamespaceMathML(): void; + +export declare function ɵɵnamespaceSVG(): void; + +export declare function ɵɵnextContext(level?: number): T; + +export declare type ɵɵNgModuleDefWithMeta = NgModuleDef; + +export declare function ɵɵNgOnChangesFeature(): DirectiveDefFeature; + +export declare function ɵɵpipe(index: number, pipeName: string): any; + +export declare function ɵɵpipeBind1(index: number, slotOffset: number, v1: any): any; + +export declare function ɵɵpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any; + +export declare function ɵɵpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any; + +export declare function ɵɵpipeBind4(index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any; + +export declare function ɵɵpipeBindV(index: number, slotOffset: number, values: any[]): any; + +export declare type ɵɵPipeDefWithMeta = PipeDef; + +export declare function ɵɵprojection(nodeIndex: number, selectorIndex?: number, attrs?: TAttributes): void; + +export declare function ɵɵprojectionDef(selectors?: CssSelectorList[]): void; + +export declare function ɵɵproperty(propName: string, value: T, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate(propName: string, v0: any, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate1(propName: string, prefix: string, v0: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate2(propName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate3(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate4(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate5(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate6(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate7(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolate8(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵpropertyInterpolateV(propName: string, values: any[], sanitizer?: SanitizerFn): TsickleIssue1009; + +export declare function ɵɵProvidersFeature(providers: Provider[], viewProviders?: Provider[]): (definition: DirectiveDef) => void; + +export declare function ɵɵpureFunction0(slotOffset: number, pureFn: () => T, thisArg?: any): T; + +export declare function ɵɵpureFunction1(slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any; + +export declare function ɵɵpureFunction2(slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any, thisArg?: any): any; + +export declare function ɵɵpureFunction3(slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any, thisArg?: any): any; + +export declare function ɵɵpureFunction4(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, thisArg?: any): any; + +export declare function ɵɵpureFunction5(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any; + +export declare function ɵɵpureFunction6(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any; + +export declare function ɵɵpureFunction7(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any; + +export declare function ɵɵpureFunction8(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any, thisArg?: any): any; + +export declare function ɵɵpureFunctionV(slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any; + +export declare function ɵɵqueryRefresh(queryList: QueryList): boolean; + +export declare function ɵɵreference(index: number): T; + +export declare function ɵɵresolveBody(element: RElement & { + ownerDocument: Document; +}): { + name: string; + target: HTMLElement; +}; + +export declare function ɵɵresolveDocument(element: RElement & { + ownerDocument: Document; +}): { + name: string; + target: Document; +}; + +export declare function ɵɵresolveWindow(element: RElement & { + ownerDocument: Document; +}): { + name: string; + target: Window | null; +}; + +export declare function ɵɵrestoreView(viewToRestore: OpaqueViewState): void; + +export declare function ɵɵsanitizeHtml(unsafeHtml: any): string; + +export declare function ɵɵsanitizeResourceUrl(unsafeResourceUrl: any): string; + +export declare function ɵɵsanitizeScript(unsafeScript: any): string; + +export declare function ɵɵsanitizeStyle(unsafeStyle: any): string; + +export declare function ɵɵsanitizeUrl(unsafeUrl: any): string; + +export declare function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any; + +export declare function ɵɵselect(index: number): void; + +export declare function ɵɵsetComponentScope(type: ComponentType, directives: Type[], pipes: Type[]): void; + +export declare function ɵɵsetNgModuleScope(type: any, scope: { + declarations?: Type[] | (() => Type[]); + imports?: Type[] | (() => Type[]); + exports?: Type[] | (() => Type[]); +}): void; + +export declare function ɵɵstaticContentQuery(directiveIndex: number, predicate: Type | string[], descend: boolean, read: any): void; + +export declare function ɵɵstaticViewQuery(predicate: Type | string[], descend: boolean, read: any): void; + +export declare function ɵɵstyleMap(styles: { + [styleName: string]: any; +} | NO_CHANGE | null): void; + +export declare function ɵɵstyleProp(styleIndex: number, value: string | number | String | PlayerFactory | null, suffix?: string | null, forceOverride?: boolean): void; + +export declare function ɵɵstyling(classBindingNames?: string[] | null, styleBindingNames?: string[] | null, styleSanitizer?: StyleSanitizeFn | null): void; + +export declare function ɵɵstylingApply(): void; + +export declare function ɵɵtemplate(index: number, templateFn: ComponentTemplate | null, consts: number, vars: number, tagName?: string | null, attrs?: TAttributes | null, localRefs?: string[] | null, localRefExtractor?: LocalRefExtractor): void; + +export declare function ɵɵtemplateRefExtractor(tNode: TNode, currentView: LView): ViewEngine_TemplateRef<{}> | null; + +export declare function ɵɵtext(index: number, value?: any): void; + +export declare function ɵɵtextBinding(index: number, value: T | NO_CHANGE): void; + +export declare function ɵɵviewQuery(predicate: Type | string[], descend: boolean, read: any): QueryList; + export declare const PACKAGE_ROOT_URL: InjectionToken; export interface Pipe { @@ -1051,383 +1431,3 @@ export interface WtfScopeFn { } export declare const wtfStartTimeRange: (rangeType: string, action: string) => any; - -export declare function ΔallocHostVars(count: number): void; - -export interface ΔBaseDef { - contentQueries: ContentQueriesFunction | null; - /** @deprecated */ readonly declaredInputs: { - [P in keyof T]: string; - }; - hostBindings: HostBindingsFunction | null; - readonly inputs: { - [P in keyof T]: string; - }; - readonly outputs: { - [P in keyof T]: string; - }; - viewQuery: ViewQueriesFunction | null; -} - -export declare function Δbind(value: T): T | NO_CHANGE; - -export declare function ΔclassMap(classes: { - [styleName: string]: any; -} | NO_CHANGE | string | null): void; - -export declare function ΔclassProp(classIndex: number, value: boolean | PlayerFactory, forceOverride?: boolean): void; - -export declare type ΔComponentDefWithMeta = ComponentDef; - -export declare function ΔcomponentHostSyntheticListener(eventName: string, listenerFn: (e?: any) => any, useCapture?: boolean, eventTargetResolver?: GlobalTargetResolver): void; - -export declare function ΔcomponentHostSyntheticProperty(index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): void; - -export declare function Δcontainer(index: number): void; - -export declare function ΔcontainerRefreshEnd(): void; - -export declare function ΔcontainerRefreshStart(index: number): void; - -export declare function ΔcontentQuery(directiveIndex: number, predicate: Type | string[], descend: boolean, read: any): QueryList; - -export declare const ΔdefaultStyleSanitizer: StyleSanitizeFn; - -export declare function ΔdefineBase(baseDefinition: { - inputs?: { - [P in keyof T]?: string | [string, string]; - }; - outputs?: { - [P in keyof T]?: string; - }; - contentQueries?: ContentQueriesFunction | null; - viewQuery?: ViewQueriesFunction | null; - hostBindings?: HostBindingsFunction; -}): ΔBaseDef; - -export declare function ΔdefineComponent(componentDefinition: { - type: Type; - selectors: CssSelectorList; - factory: FactoryFn; - consts: number; - vars: number; - inputs?: { - [P in keyof T]?: string | [string, string]; - }; - outputs?: { - [P in keyof T]?: string; - }; - hostBindings?: HostBindingsFunction; - contentQueries?: ContentQueriesFunction; - exportAs?: string[]; - template: ComponentTemplate; - ngContentSelectors?: string[]; - viewQuery?: ViewQueriesFunction | null; - features?: ComponentDefFeature[]; - encapsulation?: ViewEncapsulation; - data?: { - [kind: string]: any; - }; - styles?: string[]; - changeDetection?: ChangeDetectionStrategy; - directives?: DirectiveTypesOrFactory | null; - pipes?: PipeTypesOrFactory | null; - schemas?: SchemaMetadata[] | null; -}): never; - -export declare const ΔdefineDirective: (directiveDefinition: { - type: Type; - selectors: (string | SelectorFlags)[][]; - factory: FactoryFn; - inputs?: { [P in keyof T]?: string | [string, string] | undefined; } | undefined; - outputs?: { [P in keyof T]?: string | undefined; } | undefined; - features?: DirectiveDefFeature[] | undefined; - hostBindings?: HostBindingsFunction | undefined; - contentQueries?: ContentQueriesFunction | undefined; - viewQuery?: ViewQueriesFunction | null | undefined; - exportAs?: string[] | undefined; -}) => never; - -export declare function ΔdefineInjectable(opts: { - providedIn?: Type | 'root' | 'any' | null; - factory: () => T; -}): never; - -export declare function ΔdefineInjector(options: { - factory: () => any; - providers?: any[]; - imports?: any[]; -}): never; - -export declare function ΔdefineNgModule(def: { - type: T; - bootstrap?: Type[] | (() => Type[]); - declarations?: Type[] | (() => Type[]); - imports?: Type[] | (() => Type[]); - exports?: Type[] | (() => Type[]); - schemas?: SchemaMetadata[] | null; - id?: string | null; -}): never; - -export declare function ΔdefinePipe(pipeDef: { - name: string; - type: Type; - factory: FactoryFn; - pure?: boolean; -}): never; - -export declare type ΔDirectiveDefWithMeta = DirectiveDef; - -export declare function ΔdirectiveInject(token: Type | InjectionToken): T; -export declare function ΔdirectiveInject(token: Type | InjectionToken, flags: InjectFlags): T; - -export declare function ΔdisableBindings(): void; - -export declare function Δelement(index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void; - -export declare function ΔelementAttribute(index: number, name: string, value: any, sanitizer?: SanitizerFn | null, namespace?: string): void; - -export declare function ΔelementContainerEnd(): void; - -export declare function ΔelementContainerStart(index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void; - -export declare function ΔelementEnd(): void; - -export declare function ΔelementHostAttrs(attrs: TAttributes): void; - -export declare function ΔelementProperty(index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): void; - -export declare function ΔelementStart(index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void; - -export declare function ΔembeddedViewEnd(): void; - -export declare function ΔembeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags; - -export declare function ΔenableBindings(): void; - -export declare function ΔgetCurrentView(): OpaqueViewState; - -export declare function ΔgetFactoryOf(type: Type): ((type: Type | null) => T) | null; - -export declare function ΔgetInheritedFactory(type: Type): (type: Type) => T; - -export declare function Δi18n(index: number, message: string, subTemplateIndex?: number): void; - -export declare function Δi18nApply(index: number): void; - -export declare function Δi18nAttributes(index: number, values: string[]): void; - -export declare function Δi18nEnd(): void; - -export declare function Δi18nExp(expression: T | NO_CHANGE): void; - -/** @deprecated */ -export declare function Δi18nLocalize(input: string, placeholders?: { - [key: string]: string; -}): string; - -export declare function Δi18nPostprocess(message: string, replacements?: { - [key: string]: (string | string[]); -}): string; - -export declare function Δi18nStart(index: number, message: string, subTemplateIndex?: number): void; - -export declare function ΔInheritDefinitionFeature(definition: DirectiveDef | ComponentDef): void; - -export declare function Δinject(token: Type | InjectionToken): T; -export declare function Δinject(token: Type | InjectionToken, flags?: InjectFlags): T | null; - -export interface ΔInjectableDef { - factory: () => T; - providedIn: InjectorType | 'root' | 'any' | null; - value: T | undefined; -} - -export declare function ΔinjectAttribute(attrNameToInject: string): string | null; - -export interface ΔInjectorDef { - factory: () => T; - imports: (InjectorType | InjectorTypeWithProviders)[]; - providers: (Type | ValueProvider | ExistingProvider | FactoryProvider | ConstructorProvider | StaticClassProvider | ClassProvider | any[])[]; -} - -export declare function Δinterpolation1(prefix: string, v0: any, suffix: string): string | NO_CHANGE; - -export declare function Δinterpolation2(prefix: string, v0: any, i0: string, v1: any, suffix: string): string | NO_CHANGE; - -export declare function Δinterpolation3(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): string | NO_CHANGE; - -export declare function Δinterpolation4(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string): string | NO_CHANGE; - -export declare function Δinterpolation5(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string): string | NO_CHANGE; - -export declare function Δinterpolation6(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string): string | NO_CHANGE; - -export declare function Δinterpolation7(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string | NO_CHANGE; - -export declare function Δinterpolation8(prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string): string | NO_CHANGE; - -export declare function ΔinterpolationV(values: any[]): string | NO_CHANGE; - -export declare function Δlistener(eventName: string, listenerFn: (e?: any) => any, useCapture?: boolean, eventTargetResolver?: GlobalTargetResolver): void; - -export declare function Δload(index: number): T; - -export declare function ΔloadContentQuery(): QueryList; - -export declare function ΔloadViewQuery(): T; - -export declare function ΔnamespaceHTML(): void; - -export declare function ΔnamespaceMathML(): void; - -export declare function ΔnamespaceSVG(): void; - -export declare function ΔnextContext(level?: number): T; - -export declare type ΔNgModuleDefWithMeta = NgModuleDef; - -export declare function ΔNgOnChangesFeature(): DirectiveDefFeature; - -export declare function Δpipe(index: number, pipeName: string): any; - -export declare function ΔpipeBind1(index: number, slotOffset: number, v1: any): any; - -export declare function ΔpipeBind2(index: number, slotOffset: number, v1: any, v2: any): any; - -export declare function ΔpipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any; - -export declare function ΔpipeBind4(index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any; - -export declare function ΔpipeBindV(index: number, slotOffset: number, values: any[]): any; - -export declare type ΔPipeDefWithMeta = PipeDef; - -export declare function Δprojection(nodeIndex: number, selectorIndex?: number, attrs?: TAttributes): void; - -export declare function ΔprojectionDef(selectors?: CssSelectorList[]): void; - -export declare function Δproperty(propName: string, value: T, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): TsickleIssue1009; - -export declare function ΔpropertyInterpolate(propName: string, v0: any, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate1(propName: string, prefix: string, v0: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate2(propName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate3(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate4(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate5(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate6(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate7(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolate8(propName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any, suffix: string, sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔpropertyInterpolateV(propName: string, values: any[], sanitizer?: SanitizerFn): TsickleIssue1009; - -export declare function ΔProvidersFeature(providers: Provider[], viewProviders?: Provider[]): (definition: DirectiveDef) => void; - -export declare function ΔpureFunction0(slotOffset: number, pureFn: () => T, thisArg?: any): T; - -export declare function ΔpureFunction1(slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any; - -export declare function ΔpureFunction2(slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any, thisArg?: any): any; - -export declare function ΔpureFunction3(slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any, thisArg?: any): any; - -export declare function ΔpureFunction4(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, thisArg?: any): any; - -export declare function ΔpureFunction5(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any; - -export declare function ΔpureFunction6(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any; - -export declare function ΔpureFunction7(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any; - -export declare function ΔpureFunction8(slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any, exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any, thisArg?: any): any; - -export declare function ΔpureFunctionV(slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any; - -export declare function ΔqueryRefresh(queryList: QueryList): boolean; - -export declare function Δreference(index: number): T; - -export declare function ΔresolveBody(element: RElement & { - ownerDocument: Document; -}): { - name: string; - target: HTMLElement; -}; - -export declare function ΔresolveDocument(element: RElement & { - ownerDocument: Document; -}): { - name: string; - target: Document; -}; - -export declare function ΔresolveWindow(element: RElement & { - ownerDocument: Document; -}): { - name: string; - target: Window | null; -}; - -export declare function ΔrestoreView(viewToRestore: OpaqueViewState): void; - -export declare function ΔsanitizeHtml(unsafeHtml: any): string; - -export declare function ΔsanitizeResourceUrl(unsafeResourceUrl: any): string; - -export declare function ΔsanitizeScript(unsafeScript: any): string; - -export declare function ΔsanitizeStyle(unsafeStyle: any): string; - -export declare function ΔsanitizeUrl(unsafeUrl: any): string; - -export declare function ΔsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string): any; - -export declare function Δselect(index: number): void; - -export declare function ΔsetComponentScope(type: ComponentType, directives: Type[], pipes: Type[]): void; - -export declare function ΔsetNgModuleScope(type: any, scope: { - declarations?: Type[] | (() => Type[]); - imports?: Type[] | (() => Type[]); - exports?: Type[] | (() => Type[]); -}): void; - -export declare function ΔstaticContentQuery(directiveIndex: number, predicate: Type | string[], descend: boolean, read: any): void; - -export declare function ΔstaticViewQuery(predicate: Type | string[], descend: boolean, read: any): void; - -export declare function ΔstyleMap(styles: { - [styleName: string]: any; -} | NO_CHANGE | null): void; - -export declare function ΔstyleProp(styleIndex: number, value: string | number | String | PlayerFactory | null, suffix?: string | null, forceOverride?: boolean): void; - -export declare function Δstyling(classBindingNames?: string[] | null, styleBindingNames?: string[] | null, styleSanitizer?: StyleSanitizeFn | null): void; - -export declare function ΔstylingApply(): void; - -export declare function Δtemplate(index: number, templateFn: ComponentTemplate | null, consts: number, vars: number, tagName?: string | null, attrs?: TAttributes | null, localRefs?: string[] | null, localRefExtractor?: LocalRefExtractor): void; - -export declare function ΔtemplateRefExtractor(tNode: TNode, currentView: LView): ViewEngine_TemplateRef<{}> | null; - -export declare function Δtext(index: number, value?: any): void; - -export declare function ΔtextBinding(index: number, value: T | NO_CHANGE): void; - -export declare function ΔviewQuery(predicate: Type | string[], descend: boolean, read: any): QueryList; diff --git a/tools/ts-api-guardian/index.bzl b/tools/ts-api-guardian/index.bzl index 71f35129b8..da378c2882 100644 --- a/tools/ts-api-guardian/index.bzl +++ b/tools/ts-api-guardian/index.bzl @@ -24,7 +24,7 @@ def ts_api_guardian_test( golden, actual, data = [], - strip_export_pattern = ["^__", "^ɵ"], + strip_export_pattern = ["^__", "^ɵ[^ɵ]"], allow_module_identifiers = COMMON_MODULE_IDENTIFIERS, use_angular_tag_rules = True, **kwargs):