refactor(core): remove deprecated `ɵɵselect` instruction (#38733)

This instruction was deprecated in 664e0015d4
and is no longer referenced in any meaningful
way, so it can be removed.

PR Close #38733
This commit is contained in:
Pete Bacon Darwin 2020-09-07 12:35:44 +01:00 committed by atscott
parent 926ffcd8ac
commit 83ace4ed30
6 changed files with 6 additions and 21 deletions

View File

@ -29,7 +29,6 @@ export class Identifiers {
static elementEnd: o.ExternalReference = {name: 'ɵɵelementEnd', moduleName: CORE};
static select: o.ExternalReference = {name: 'ɵɵselect', moduleName: CORE};
static advance: o.ExternalReference = {name: 'ɵɵadvance', moduleName: CORE};
static syntheticHostProperty:

View File

@ -201,7 +201,6 @@ export {
ɵɵresolveWindow,
ɵɵrestoreView,
ɵɵselect,
ɵɵsetComponentScope,
ɵɵsetNgModuleScope,
ɵɵstaticContentQuery,

View File

@ -88,8 +88,6 @@ export {
ɵɵreference,
// TODO: remove `select` once we've refactored all of the tests not to use it.
ɵɵselect,
ɵɵstyleMap,
ɵɵstyleMapInterpolate1,
ɵɵstyleMapInterpolate2,

View File

@ -39,16 +39,6 @@ export function ɵɵadvance(delta: number): void {
selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, getCheckNoChangesMode());
}
/**
* Selects an element for later binding instructions.
* @deprecated No longer being generated, but still used in unit tests.
* @codeGenApi
*/
export function ɵɵselect(index: number): void {
// TODO(misko): Remove this function as it is no longer being used.
selectIndexInternal(getTView(), getLView(), index, getCheckNoChangesMode());
}
export function selectIndexInternal(
tView: TView, lView: LView, index: number, checkNoChangesMode: boolean) {
ngDevMode && assertGreaterThan(index, -1, 'Invalid index');

View File

@ -134,7 +134,6 @@ export const angularCoreEnv: {[name: string]: Function} =
'ɵɵstylePropInterpolate8': r3.ɵɵstylePropInterpolate8,
'ɵɵstylePropInterpolateV': r3.ɵɵstylePropInterpolateV,
'ɵɵclassProp': r3.ɵɵclassProp,
'ɵɵselect': r3.ɵɵselect,
'ɵɵadvance': r3.ɵɵadvance,
'ɵɵtemplate': r3.ɵɵtemplate,
'ɵɵtext': r3.ɵɵtext,

View File

@ -10,7 +10,7 @@ import {NgForOfContext} from '@angular/common';
import {getSortedClassName} from '@angular/core/testing/src/styling';
import {ɵɵdefineComponent} from '../../src/render3/definition';
import {RenderFlags, ɵɵattribute, ɵɵclassMap, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵproperty, ɵɵselect, ɵɵstyleMap, ɵɵstyleProp, ɵɵtemplate, ɵɵtext, ɵɵtextInterpolate1} from '../../src/render3/index';
import {RenderFlags, ɵɵadvance, ɵɵattribute, ɵɵclassMap, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵproperty, ɵɵstyleMap, ɵɵstyleProp, ɵɵtemplate, ɵɵtext, ɵɵtextInterpolate1} from '../../src/render3/index';
import {AttributeMarker} from '../../src/render3/interfaces/node';
import {bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, getSanitizationBypassType, SafeValue, unwrapSafeValue} from '../../src/sanitization/bypass';
import {ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl} from '../../src/sanitization/sanitization';
@ -33,18 +33,18 @@ describe('instructions', () => {
ɵɵelement(0, 'script');
}
describe('ɵɵselect', () => {
describe('ɵɵadvance', () => {
it('should error in DevMode if index is out of range', () => {
// Only one constant added, meaning only index `0` is valid.
const t = new TemplateFixture(createDiv, () => {}, 1, 0);
expect(() => {
t.update(() => {
ɵɵselect(-1);
ɵɵadvance(-1);
});
}).toThrow();
expect(() => {
t.update(() => {
ɵɵselect(1);
ɵɵadvance(1);
});
}).toThrow();
});
@ -225,7 +225,7 @@ describe('instructions', () => {
}
if (rf & RenderFlags.Update) {
const row_r2 = ctx0.$implicit;
ɵɵselect(1);
ɵɵadvance(1);
ɵɵproperty('ngForOf', row_r2);
}
}
@ -239,7 +239,7 @@ describe('instructions', () => {
}
if (rf & RenderFlags.Update) {
const col_r3 = ctx1.$implicit;
ɵɵselect(1);
ɵɵadvance(1);
ɵɵtextInterpolate1('', col_r3, '');
}
}