feat(core): missing-injectable migration should migrate empty object literal providers (#33709)
In View Engine, providers which neither used `useValue`, `useClass`, `useFactory` or `useExisting`, were interpreted differently. e.g. ``` {provide: X} -> {provide: X, useValue: undefined}, // this is how it works in View Engine {provide: X} -> {provide: X, useClass: X}, // this is how it works in Ivy ``` The missing-injectable migration should migrate such providers to the explicit `useValue` provider. This ensures that there is no unexpected behavioral change when updating to v9. PR Close #33709
This commit is contained in:

committed by
Alex Rickabaugh

parent
71b8e271b3
commit
15fefdbb8d
@ -54,5 +54,13 @@ export class TslintUpdateRecorder implements UpdateRecorder {
|
||||
this.ruleName, fix));
|
||||
}
|
||||
|
||||
|
||||
updateObjectLiteral(node: ts.ObjectLiteralExpression, newText: string): void {
|
||||
this.failures.push(new RuleFailure(
|
||||
this.sourceFile, node.getStart(), node.getEnd(),
|
||||
`Object literal needs to be updated to: ${newText}`, this.ruleName,
|
||||
Replacement.replaceFromTo(node.getStart(), node.getEnd(), newText)));
|
||||
}
|
||||
|
||||
commitUpdate() {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user