Skip to content

ctorParameters not stripped from BrowserPlatformLocation and TestabilityRegistry in prod builds #15194

@IgorMinar

Description

@IgorMinar

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

yes

Description

A clear and concise description of the problem...

🔬 Minimal Reproduction

yarn global add @angular/cli@next
ng new test-app
cd test-app
ng build --prod

🔥 Exception or Error





If I disable terser mangling, I'll see that ctorParams survived the build optimizer scrub pass on:

            /** @nocollapse */            return BrowserPlatformLocation.ctorParameters = () => [ {
                type: void 0,
                decorators: [ {
                    type: Inject,
                    args: [ DOCUMENT ]
                } ]
            } ], BrowserPlatformLocation;

and

            TestabilityRegistry.ctorParameters = () => [], TestabilityRegistry;

This happens both with and without Ivy

🌍 Your Environment




Angular CLI: 8.2.0-rc.0
Node: 10.11.0
OS: darwin x64
Angular: 8.2.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.802.0-rc.0
@angular-devkit/build-angular     0.802.0-rc.0
@angular-devkit/build-optimizer   0.802.0-rc.0
@angular-devkit/build-webpack     0.802.0-rc.0
@angular-devkit/core              8.2.0-rc.0
@angular-devkit/schematics        8.2.0-rc.0
@ngtools/webpack                  8.2.0-rc.0
@schematics/angular               8.2.0-rc.0
@schematics/update                0.802.0-rc.0
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.38.0

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions