-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ivy): identify all ESM5 decorated classes #27848
fix(ivy): identify all ESM5 decorated classes #27848
Conversation
You can preview 1598e41 at https://pr27848-1598e41.ngbuilds.io/. |
1598e41
to
e87a297
Compare
You can preview e87a297 at https://pr27848-e87a297.ngbuilds.io/. |
e87a297
to
da9bacf
Compare
You can preview da9bacf at https://pr27848-da9bacf.ngbuilds.io/. |
da9bacf
to
40f2886
Compare
You can preview 40f2886 at https://pr27848-40f2886.ngbuilds.io/. |
@@ -662,8 +662,10 @@ export class Esm2015ReflectionHost extends TypeScriptReflectionHost implements N | |||
*/ | |||
protected getHelperCall(statement: ts.Statement, helperName: string): ts.CallExpression|null { | |||
if (ts.isExpressionStatement(statement)) { | |||
const expression = | |||
isAssignmentStatement(statement) ? statement.expression.right : statement.expression; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isAssignmentStatement
has now gone unused it seems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in Esm5ReflectionHost.
In ESM5 decorated classes can be indicated by calls to `__decorate()`. Previously the `ReflectionHost.findDecoratedClasses()` call would identify helper calls of the form: ``` SomeClass = tslib_1.__decorate(...); ``` But it was missing calls of the form: ``` SomeClass = SomeClass_1 = tslib_1.__decorate(...); ``` This form is common in `@NgModule()` decorations, where the class being decorated is referenced inside the decorator or another member. This commit now ensures that a chain of assignments, of any length, is now identified as a class decoration if it results in a call to `__decorate()`. Fixes angular#27841
40f2886
to
d09190a
Compare
You can preview d09190a at https://pr27848-d09190a.ngbuilds.io/. |
In ESM5 decorated classes can be indicated by calls to `__decorate()`. Previously the `ReflectionHost.findDecoratedClasses()` call would identify helper calls of the form: ``` SomeClass = tslib_1.__decorate(...); ``` But it was missing calls of the form: ``` SomeClass = SomeClass_1 = tslib_1.__decorate(...); ``` This form is common in `@NgModule()` decorations, where the class being decorated is referenced inside the decorator or another member. This commit now ensures that a chain of assignments, of any length, is now identified as a class decoration if it results in a call to `__decorate()`. Fixes angular#27841 PR Close angular#27848
In ESM5 decorated classes can be indicated by calls to `__decorate()`. Previously the `ReflectionHost.findDecoratedClasses()` call would identify helper calls of the form: ``` SomeClass = tslib_1.__decorate(...); ``` But it was missing calls of the form: ``` SomeClass = SomeClass_1 = tslib_1.__decorate(...); ``` This form is common in `@NgModule()` decorations, where the class being decorated is referenced inside the decorator or another member. This commit now ensures that a chain of assignments, of any length, is now identified as a class decoration if it results in a call to `__decorate()`. Fixes angular#27841 PR Close angular#27848
In ESM5 decorated classes can be indicated by calls to `__decorate()`. Previously the `ReflectionHost.findDecoratedClasses()` call would identify helper calls of the form: ``` SomeClass = tslib_1.__decorate(...); ``` But it was missing calls of the form: ``` SomeClass = SomeClass_1 = tslib_1.__decorate(...); ``` This form is common in `@NgModule()` decorations, where the class being decorated is referenced inside the decorator or another member. This commit now ensures that a chain of assignments, of any length, is now identified as a class decoration if it results in a call to `__decorate()`. Fixes angular#27841 PR Close angular#27848
In ESM5 decorated classes can be indicated by calls to `__decorate()`. Previously the `ReflectionHost.findDecoratedClasses()` call would identify helper calls of the form: ``` SomeClass = tslib_1.__decorate(...); ``` But it was missing calls of the form: ``` SomeClass = SomeClass_1 = tslib_1.__decorate(...); ``` This form is common in `@NgModule()` decorations, where the class being decorated is referenced inside the decorator or another member. This commit now ensures that a chain of assignments, of any length, is now identified as a class decoration if it results in a call to `__decorate()`. Fixes angular#27841 PR Close angular#27848
In ESM5 decorated classes can be indicated by calls to `__decorate()`. Previously the `ReflectionHost.findDecoratedClasses()` call would identify helper calls of the form: ``` SomeClass = tslib_1.__decorate(...); ``` But it was missing calls of the form: ``` SomeClass = SomeClass_1 = tslib_1.__decorate(...); ``` This form is common in `@NgModule()` decorations, where the class being decorated is referenced inside the decorator or another member. This commit now ensures that a chain of assignments, of any length, is now identified as a class decoration if it results in a call to `__decorate()`. Fixes angular#27841 PR Close angular#27848
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
TODO:
Fixes #27841