fix(ngcc): handle aliases in UMD export declarations (#38959)

Sometimes UMD exports appear in the following form:

```
exports.MyClass = alias1 = alias2 = <<declaration>>
```

Previously the declaration of the export would have been captured
as `alias1 = alias2 = <<declaration>>`, which the `PartialInterpreter`
would have failed on, since it cannot handle assignments.

Now we skip over these aliases capturing only the `<<declaration>>`
expression.

Fixes #38947

PR Close #38959
This commit is contained in:
Pete Bacon Darwin
2020-09-23 22:02:13 +01:00
committed by atscott
parent 11485d96fb
commit 5038e5741b
3 changed files with 22 additions and 3 deletions

View File

@ -638,7 +638,8 @@ runInEachFileSystem(() => {
` exports.d = b;\n` +
` exports.e = e;\n` +
` exports.DirectiveX = core.Directive;\n` +
` exports.SomeClass = SomeClass;\n` +
` var SomeClass_1;\n` +
` exports.SomeClass = SomeClass_1 = SomeClass;\n` +
`})));\n`,
},
{