refactor(compiler-cli): avoid superfluous parenthesis around statements (#33514)
Previously, due to a bug a `Context` with `isStatement: false` could be returned in places where a `Context` with `isStatement: true` was requested. As a result, some statements would be unnecessarily wrapped in parenthesis. This commit fixes the bug in `Context#withStatementMode` to always return a `Context` with the correct `isStatement` value. Note that this does not have any impact on the generated code other than avoiding some superfluous parenthesis on certain statements. PR Close #33514
This commit is contained in:

committed by
Kara Erickson

parent
4c706086a7
commit
1c1240c21a
@ -183,9 +183,9 @@ describe('compiler compliance: dependency injection', () => {
|
||||
factory: function MyService_Factory(t) {
|
||||
var r = null;
|
||||
if (t) {
|
||||
(r = new t());
|
||||
r = new t();
|
||||
} else {
|
||||
(r = (() => new MyAlternateFactory())($r3$.ɵɵinject(SomeDep)));
|
||||
r = (() => new MyAlternateFactory())($r3$.ɵɵinject(SomeDep));
|
||||
}
|
||||
return r;
|
||||
},
|
||||
@ -258,9 +258,9 @@ describe('compiler compliance: dependency injection', () => {
|
||||
factory: function MyService_Factory(t) {
|
||||
var r = null;
|
||||
if (t) {
|
||||
(r = new t());
|
||||
r = new t();
|
||||
} else {
|
||||
(r = new MyAlternateService($r3$.ɵɵinject(SomeDep)));
|
||||
r = new MyAlternateService($r3$.ɵɵinject(SomeDep));
|
||||
}
|
||||
return r;
|
||||
},
|
||||
|
Reference in New Issue
Block a user