[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | (function (factory) {
|
---|
| 9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
| 10 | var v = factory(require, exports);
|
---|
| 11 | if (v !== undefined) module.exports = v;
|
---|
| 12 | }
|
---|
| 13 | else if (typeof define === "function" && define.amd) {
|
---|
| 14 | define("@angular/compiler-cli/src/tooling", ["require", "exports", "tslib", "@angular/compiler-cli/src/ngtsc/reflection", "@angular/compiler-cli/src/transformers/downlevel_decorators_transform"], factory);
|
---|
| 15 | }
|
---|
| 16 | })(function (require, exports) {
|
---|
| 17 | "use strict";
|
---|
| 18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 19 | exports.constructorParametersDownlevelTransform = exports.GLOBAL_DEFS_FOR_TERSER_WITH_AOT = exports.GLOBAL_DEFS_FOR_TERSER = void 0;
|
---|
| 20 | var tslib_1 = require("tslib");
|
---|
| 21 | var reflection_1 = require("@angular/compiler-cli/src/ngtsc/reflection");
|
---|
| 22 | var downlevel_decorators_transform_1 = require("@angular/compiler-cli/src/transformers/downlevel_decorators_transform");
|
---|
| 23 | /**
|
---|
| 24 | * Known values for global variables in `@angular/core` that Terser should set using
|
---|
| 25 | * https://github.com/terser-js/terser#conditional-compilation
|
---|
| 26 | */
|
---|
| 27 | exports.GLOBAL_DEFS_FOR_TERSER = {
|
---|
| 28 | ngDevMode: false,
|
---|
| 29 | ngI18nClosureMode: false,
|
---|
| 30 | };
|
---|
| 31 | exports.GLOBAL_DEFS_FOR_TERSER_WITH_AOT = tslib_1.__assign(tslib_1.__assign({}, exports.GLOBAL_DEFS_FOR_TERSER), { ngJitMode: false });
|
---|
| 32 | /**
|
---|
| 33 | * Transform for downleveling Angular decorators and Angular-decorated class constructor
|
---|
| 34 | * parameters for dependency injection. This transform can be used by the CLI for JIT-mode
|
---|
| 35 | * compilation where constructor parameters and associated Angular decorators should be
|
---|
| 36 | * downleveled so that apps are not exposed to the ES2015 temporal dead zone limitation
|
---|
| 37 | * in TypeScript. See https://github.com/angular/angular-cli/pull/14473 for more details.
|
---|
| 38 | */
|
---|
| 39 | function constructorParametersDownlevelTransform(program) {
|
---|
| 40 | var typeChecker = program.getTypeChecker();
|
---|
| 41 | var reflectionHost = new reflection_1.TypeScriptReflectionHost(typeChecker);
|
---|
| 42 | return downlevel_decorators_transform_1.getDownlevelDecoratorsTransform(typeChecker, reflectionHost, [], /* isCore */ false,
|
---|
| 43 | /* enableClosureCompiler */ false, /* skipClassDecorators */ true);
|
---|
| 44 | }
|
---|
| 45 | exports.constructorParametersDownlevelTransform = constructorParametersDownlevelTransform;
|
---|
| 46 | });
|
---|
| 47 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9zcmMvdG9vbGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7O0lBV0gseUVBQTREO0lBQzVELHdIQUE4RjtJQUU5Rjs7O09BR0c7SUFDVSxRQUFBLHNCQUFzQixHQUFHO1FBQ3BDLFNBQVMsRUFBRSxLQUFLO1FBQ2hCLGlCQUFpQixFQUFFLEtBQUs7S0FDekIsQ0FBQztJQUVXLFFBQUEsK0JBQStCLHlDQUN2Qyw4QkFBc0IsS0FDekIsU0FBUyxFQUFFLEtBQUssSUFDaEI7SUFFRjs7Ozs7O09BTUc7SUFDSCxTQUFnQix1Q0FBdUMsQ0FBQyxPQUFtQjtRQUV6RSxJQUFNLFdBQVcsR0FBRyxPQUFPLENBQU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