Skip to content
Permalink
Browse files

fix(core): fix interpolate identifier in AOT (#30243)

This commit fixes a regression introduced in PR 29692 where
the interpolate symbol in View Engine was improperly prefixed
with the ɵɵ that signifies private instructions for Ivy. It
resulted in interpolations of 10+ values not working correctly
in AOT mode. This commit removes the prefix.

PR Close #30243
  • Loading branch information...
kara committed May 2, 2019
1 parent b70d20b commit 30d1f292c930d0ba8c198757b3333d4b594692d8
Showing with 19 additions and 1 deletion.
  1. +1 −1 packages/compiler/src/identifiers.ts
  2. +18 −0 packages/core/test/acceptance/properties_spec.ts
@@ -92,7 +92,7 @@ export class Identifiers {
name: 'ɵinlineInterpolate', name: 'ɵinlineInterpolate',
moduleName: CORE, moduleName: CORE,
}; };
static interpolate: o.ExternalReference = {name: 'ɵɵinterpolate', moduleName: CORE}; static interpolate: o.ExternalReference = {name: 'ɵinterpolate', moduleName: CORE};
static EMPTY_ARRAY: o.ExternalReference = {name: 'ɵEMPTY_ARRAY', moduleName: CORE}; static EMPTY_ARRAY: o.ExternalReference = {name: 'ɵEMPTY_ARRAY', moduleName: CORE};
static EMPTY_MAP: o.ExternalReference = {name: 'ɵEMPTY_MAP', moduleName: CORE}; static EMPTY_MAP: o.ExternalReference = {name: 'ɵEMPTY_MAP', moduleName: CORE};
static Renderer: o.ExternalReference = {name: 'Renderer', moduleName: CORE}; static Renderer: o.ExternalReference = {name: 'Renderer', moduleName: CORE};
@@ -212,4 +212,22 @@ describe('property instructions', () => {


expect(img.src.indexOf('unsafe:')).toBe(0); expect(img.src.indexOf('unsafe:')).toBe(0);
}); });

it('should handle interpolations with 10+ values', () => {
@Component({
selector: 'app-comp',
template: `
<a href="http://g.com/?one={{'1'}}&two={{'2'}}&three={{'3'}}&four={{'4'}}&five={{'5'}}&six={{'6'}}&seven={{'7'}}&eight={{'8'}}&nine={{'9'}}&ten={{'10'}}">link2</a>`
})
class AppComp {
}

TestBed.configureTestingModule({declarations: [AppComp]});
const fixture = TestBed.createComponent(AppComp);
fixture.detectChanges();
const anchor = fixture.debugElement.query(By.css('a')).nativeElement;
expect(anchor.getAttribute('href'))
.toEqual(
`http://g.com/?one=1&two=2&three=3&four=4&five=5&six=6&seven=7&eight=8&nine=9&ten=10`);
});
}); });

0 comments on commit 30d1f29

Please sign in to comment.
You can’t perform that action at this time.