@angular/core 20.1.0 → 20.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.d.ts +1 -1
- package/chrome_dev_tools_performance.d.d.ts +1 -1
- package/discovery.d.d.ts +1 -1
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/core.mjs +47 -27
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +51 -11
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/resource.mjs +1 -1
- package/fesm2022/root_effect_scheduler.mjs +112 -53
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +2 -2
- package/fesm2022/signal.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/fesm2022/untracked.mjs +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/graph.d.d.ts +1 -1
- package/index.d.ts +15 -2
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/{apply_import_manager-B0fYYMpr.cjs → apply_import_manager-DnZuC0qd.cjs} +3 -3
- package/schematics/bundles/{checker-DLInMAS3.cjs → checker-CwUJ2eKt.cjs} +91 -21
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/{compiler_host-Doj9KVJf.cjs → compiler_host-CH53_d32.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +3 -3
- package/schematics/bundles/document-core.cjs +5 -5
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/{index-Bp8sCiq1.cjs → index-BEVODdVo.cjs} +4 -4
- package/schematics/bundles/{index-BmuUS1AB.cjs → index-C5Zc9zTo.cjs} +12 -12
- package/schematics/bundles/inject-flags.cjs +5 -5
- package/schematics/bundles/inject-migration.cjs +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-CmZ0155c.cjs → migrate_ts_type_references-i9f_TsT7.cjs} +5 -441
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/{project_paths-D2SJWT7x.cjs → project_paths-BrdiLiLU.cjs} +3 -3
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +3 -3
- package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
- package/schematics/bundles/signal-input-migration.cjs +8 -8
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +4 -4
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +4 -4
- package/signal.d.d.ts +1 -1
- package/testing/index.d.ts +1 -1
- package/weak_ref.d.d.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.1.
|
|
3
|
+
* @license Angular v20.1.1
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var index = require('./index-
|
|
11
|
+
var checker = require('./checker-CwUJ2eKt.cjs');
|
|
12
|
+
var index = require('./index-C5Zc9zTo.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
15
|
+
var project_paths = require('./project_paths-BrdiLiLU.cjs');
|
|
16
16
|
|
|
17
17
|
function getMemberName(member) {
|
|
18
18
|
if (member.name === undefined) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.1.
|
|
3
|
+
* @license Angular v20.1.1
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-CwUJ2eKt.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
var p = require('path');
|
|
12
12
|
require('os');
|
|
@@ -891,7 +891,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
891
891
|
function compileDeclareClassMetadata(metadata) {
|
|
892
892
|
const definitionMap = new checker.DefinitionMap();
|
|
893
893
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
894
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
894
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
895
895
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
896
896
|
definitionMap.set('type', metadata.type);
|
|
897
897
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -909,7 +909,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
909
909
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
|
|
910
910
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
|
|
911
911
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
912
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
912
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
913
913
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
914
914
|
definitionMap.set('type', metadata.type);
|
|
915
915
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -1004,7 +1004,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
1004
1004
|
const definitionMap = new checker.DefinitionMap();
|
|
1005
1005
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
1006
1006
|
definitionMap.set('minVersion', checker.literal(minVersion));
|
|
1007
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
1007
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
1008
1008
|
// e.g. `type: MyDirective`
|
|
1009
1009
|
definitionMap.set('type', meta.type.value);
|
|
1010
1010
|
if (meta.isStandalone !== undefined) {
|
|
@@ -1420,7 +1420,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
1420
1420
|
function compileDeclareFactoryFunction(meta) {
|
|
1421
1421
|
const definitionMap = new checker.DefinitionMap();
|
|
1422
1422
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
1423
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
1423
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
1424
1424
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1425
1425
|
definitionMap.set('type', meta.type.value);
|
|
1426
1426
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -1455,7 +1455,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
1455
1455
|
function createInjectableDefinitionMap(meta) {
|
|
1456
1456
|
const definitionMap = new checker.DefinitionMap();
|
|
1457
1457
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
1458
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
1458
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
1459
1459
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1460
1460
|
definitionMap.set('type', meta.type.value);
|
|
1461
1461
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -1506,7 +1506,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
1506
1506
|
function createInjectorDefinitionMap(meta) {
|
|
1507
1507
|
const definitionMap = new checker.DefinitionMap();
|
|
1508
1508
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
1509
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
1509
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
1510
1510
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1511
1511
|
definitionMap.set('type', meta.type.value);
|
|
1512
1512
|
definitionMap.set('providers', meta.providers);
|
|
@@ -1539,7 +1539,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
1539
1539
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
1540
1540
|
}
|
|
1541
1541
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
1542
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
1542
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
1543
1543
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1544
1544
|
definitionMap.set('type', meta.type.value);
|
|
1545
1545
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -1590,7 +1590,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
1590
1590
|
function createPipeDefinitionMap(meta) {
|
|
1591
1591
|
const definitionMap = new checker.DefinitionMap();
|
|
1592
1592
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
1593
|
-
definitionMap.set('version', checker.literal('20.1.
|
|
1593
|
+
definitionMap.set('version', checker.literal('20.1.1'));
|
|
1594
1594
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1595
1595
|
// e.g. `type: MyPipe`
|
|
1596
1596
|
definitionMap.set('type', meta.type.value);
|
|
@@ -12321,7 +12321,7 @@ class PipeDecoratorHandler {
|
|
|
12321
12321
|
* @description
|
|
12322
12322
|
* Entry point for all public APIs of the compiler-cli package.
|
|
12323
12323
|
*/
|
|
12324
|
-
new checker.Version('20.1.
|
|
12324
|
+
new checker.Version('20.1.1');
|
|
12325
12325
|
|
|
12326
12326
|
/**
|
|
12327
12327
|
* Whether a given decorator should be treated as an Angular decorator.
|
|
@@ -20278,7 +20278,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
|
|
|
20278
20278
|
* @param minVersion Minimum required version for the feature.
|
|
20279
20279
|
*/
|
|
20280
20280
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
20281
|
-
// A version of `20.1.
|
|
20281
|
+
// A version of `20.1.1` usually means that core is at head so it supports
|
|
20282
20282
|
// all features. Use string interpolation prevent the placeholder from being replaced
|
|
20283
20283
|
// with the current version during build time.
|
|
20284
20284
|
if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.1.
|
|
3
|
+
* @license Angular v20.1.1
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
require('./index-
|
|
11
|
+
var checker = require('./checker-CwUJ2eKt.cjs');
|
|
12
|
+
require('./index-C5Zc9zTo.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
16
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
15
|
+
var project_paths = require('./project_paths-BrdiLiLU.cjs');
|
|
16
|
+
var apply_import_manager = require('./apply_import_manager-DnZuC0qd.cjs');
|
|
17
17
|
var imports = require('./imports-CIX-JgAN.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
|
19
19
|
require('node:path/posix');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.1.
|
|
3
|
+
* @license Angular v20.1.1
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var p = require('path');
|
|
11
|
-
var compiler_host = require('./compiler_host-
|
|
11
|
+
var compiler_host = require('./compiler_host-CH53_d32.cjs');
|
|
12
12
|
var ts = require('typescript');
|
|
13
13
|
var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
|
|
14
14
|
var imports = require('./imports-CIX-JgAN.cjs');
|
|
15
15
|
var nodes = require('./nodes-B16H9JUd.cjs');
|
|
16
16
|
var leading_space = require('./leading_space-D9nQ8UQC.cjs');
|
|
17
|
-
require('./checker-
|
|
17
|
+
require('./checker-CwUJ2eKt.cjs');
|
|
18
18
|
require('os');
|
|
19
19
|
require('fs');
|
|
20
20
|
require('module');
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.1.
|
|
3
|
+
* @license Angular v20.1.1
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-CwUJ2eKt.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
12
|
var assert = require('assert');
|
|
13
|
-
var index = require('./index-
|
|
14
|
-
var project_paths = require('./project_paths-
|
|
13
|
+
var index = require('./index-BEVODdVo.cjs');
|
|
14
|
+
var project_paths = require('./project_paths-BrdiLiLU.cjs');
|
|
15
15
|
var leading_space = require('./leading_space-D9nQ8UQC.cjs');
|
|
16
|
-
require('./index-
|
|
16
|
+
require('./index-C5Zc9zTo.cjs');
|
|
17
17
|
require('path');
|
|
18
18
|
require('node:path');
|
|
19
19
|
|
|
@@ -77,441 +77,6 @@ function pickFieldIncompatibility(a, b) {
|
|
|
77
77
|
return a;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
/**
|
|
81
|
-
* A lazily created TextEncoder instance for converting strings into UTF-8 bytes
|
|
82
|
-
*/
|
|
83
|
-
// Utils
|
|
84
|
-
var Endian;
|
|
85
|
-
(function (Endian) {
|
|
86
|
-
Endian[Endian["Little"] = 0] = "Little";
|
|
87
|
-
Endian[Endian["Big"] = 1] = "Big";
|
|
88
|
-
})(Endian || (Endian = {}));
|
|
89
|
-
|
|
90
|
-
//// Types
|
|
91
|
-
var TypeModifier;
|
|
92
|
-
(function (TypeModifier) {
|
|
93
|
-
TypeModifier[TypeModifier["None"] = 0] = "None";
|
|
94
|
-
TypeModifier[TypeModifier["Const"] = 1] = "Const";
|
|
95
|
-
})(TypeModifier || (TypeModifier = {}));
|
|
96
|
-
class Type {
|
|
97
|
-
modifiers;
|
|
98
|
-
constructor(modifiers = TypeModifier.None) {
|
|
99
|
-
this.modifiers = modifiers;
|
|
100
|
-
}
|
|
101
|
-
hasModifier(modifier) {
|
|
102
|
-
return (this.modifiers & modifier) !== 0;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
var BuiltinTypeName;
|
|
106
|
-
(function (BuiltinTypeName) {
|
|
107
|
-
BuiltinTypeName[BuiltinTypeName["Dynamic"] = 0] = "Dynamic";
|
|
108
|
-
BuiltinTypeName[BuiltinTypeName["Bool"] = 1] = "Bool";
|
|
109
|
-
BuiltinTypeName[BuiltinTypeName["String"] = 2] = "String";
|
|
110
|
-
BuiltinTypeName[BuiltinTypeName["Int"] = 3] = "Int";
|
|
111
|
-
BuiltinTypeName[BuiltinTypeName["Number"] = 4] = "Number";
|
|
112
|
-
BuiltinTypeName[BuiltinTypeName["Function"] = 5] = "Function";
|
|
113
|
-
BuiltinTypeName[BuiltinTypeName["Inferred"] = 6] = "Inferred";
|
|
114
|
-
BuiltinTypeName[BuiltinTypeName["None"] = 7] = "None";
|
|
115
|
-
})(BuiltinTypeName || (BuiltinTypeName = {}));
|
|
116
|
-
class BuiltinType extends Type {
|
|
117
|
-
name;
|
|
118
|
-
constructor(name, modifiers) {
|
|
119
|
-
super(modifiers);
|
|
120
|
-
this.name = name;
|
|
121
|
-
}
|
|
122
|
-
visitType(visitor, context) {
|
|
123
|
-
return visitor.visitBuiltinType(this, context);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
new BuiltinType(BuiltinTypeName.Dynamic);
|
|
127
|
-
const INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);
|
|
128
|
-
new BuiltinType(BuiltinTypeName.Bool);
|
|
129
|
-
new BuiltinType(BuiltinTypeName.Int);
|
|
130
|
-
new BuiltinType(BuiltinTypeName.Number);
|
|
131
|
-
new BuiltinType(BuiltinTypeName.String);
|
|
132
|
-
new BuiltinType(BuiltinTypeName.Function);
|
|
133
|
-
new BuiltinType(BuiltinTypeName.None);
|
|
134
|
-
///// Expressions
|
|
135
|
-
var UnaryOperator;
|
|
136
|
-
(function (UnaryOperator) {
|
|
137
|
-
UnaryOperator[UnaryOperator["Minus"] = 0] = "Minus";
|
|
138
|
-
UnaryOperator[UnaryOperator["Plus"] = 1] = "Plus";
|
|
139
|
-
})(UnaryOperator || (UnaryOperator = {}));
|
|
140
|
-
var BinaryOperator;
|
|
141
|
-
(function (BinaryOperator) {
|
|
142
|
-
BinaryOperator[BinaryOperator["Equals"] = 0] = "Equals";
|
|
143
|
-
BinaryOperator[BinaryOperator["NotEquals"] = 1] = "NotEquals";
|
|
144
|
-
BinaryOperator[BinaryOperator["Assign"] = 2] = "Assign";
|
|
145
|
-
BinaryOperator[BinaryOperator["Identical"] = 3] = "Identical";
|
|
146
|
-
BinaryOperator[BinaryOperator["NotIdentical"] = 4] = "NotIdentical";
|
|
147
|
-
BinaryOperator[BinaryOperator["Minus"] = 5] = "Minus";
|
|
148
|
-
BinaryOperator[BinaryOperator["Plus"] = 6] = "Plus";
|
|
149
|
-
BinaryOperator[BinaryOperator["Divide"] = 7] = "Divide";
|
|
150
|
-
BinaryOperator[BinaryOperator["Multiply"] = 8] = "Multiply";
|
|
151
|
-
BinaryOperator[BinaryOperator["Modulo"] = 9] = "Modulo";
|
|
152
|
-
BinaryOperator[BinaryOperator["And"] = 10] = "And";
|
|
153
|
-
BinaryOperator[BinaryOperator["Or"] = 11] = "Or";
|
|
154
|
-
BinaryOperator[BinaryOperator["BitwiseOr"] = 12] = "BitwiseOr";
|
|
155
|
-
BinaryOperator[BinaryOperator["BitwiseAnd"] = 13] = "BitwiseAnd";
|
|
156
|
-
BinaryOperator[BinaryOperator["Lower"] = 14] = "Lower";
|
|
157
|
-
BinaryOperator[BinaryOperator["LowerEquals"] = 15] = "LowerEquals";
|
|
158
|
-
BinaryOperator[BinaryOperator["Bigger"] = 16] = "Bigger";
|
|
159
|
-
BinaryOperator[BinaryOperator["BiggerEquals"] = 17] = "BiggerEquals";
|
|
160
|
-
BinaryOperator[BinaryOperator["NullishCoalesce"] = 18] = "NullishCoalesce";
|
|
161
|
-
BinaryOperator[BinaryOperator["Exponentiation"] = 19] = "Exponentiation";
|
|
162
|
-
BinaryOperator[BinaryOperator["In"] = 20] = "In";
|
|
163
|
-
BinaryOperator[BinaryOperator["AdditionAssignment"] = 21] = "AdditionAssignment";
|
|
164
|
-
BinaryOperator[BinaryOperator["SubtractionAssignment"] = 22] = "SubtractionAssignment";
|
|
165
|
-
BinaryOperator[BinaryOperator["MultiplicationAssignment"] = 23] = "MultiplicationAssignment";
|
|
166
|
-
BinaryOperator[BinaryOperator["DivisionAssignment"] = 24] = "DivisionAssignment";
|
|
167
|
-
BinaryOperator[BinaryOperator["RemainderAssignment"] = 25] = "RemainderAssignment";
|
|
168
|
-
BinaryOperator[BinaryOperator["ExponentiationAssignment"] = 26] = "ExponentiationAssignment";
|
|
169
|
-
BinaryOperator[BinaryOperator["AndAssignment"] = 27] = "AndAssignment";
|
|
170
|
-
BinaryOperator[BinaryOperator["OrAssignment"] = 28] = "OrAssignment";
|
|
171
|
-
BinaryOperator[BinaryOperator["NullishCoalesceAssignment"] = 29] = "NullishCoalesceAssignment";
|
|
172
|
-
})(BinaryOperator || (BinaryOperator = {}));
|
|
173
|
-
function nullSafeIsEquivalent(base, other) {
|
|
174
|
-
if (base == null || other == null) {
|
|
175
|
-
return base == other;
|
|
176
|
-
}
|
|
177
|
-
return base.isEquivalent(other);
|
|
178
|
-
}
|
|
179
|
-
function areAllEquivalentPredicate(base, other, equivalentPredicate) {
|
|
180
|
-
const len = base.length;
|
|
181
|
-
if (len !== other.length) {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
for (let i = 0; i < len; i++) {
|
|
185
|
-
if (!equivalentPredicate(base[i], other[i])) {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return true;
|
|
190
|
-
}
|
|
191
|
-
function areAllEquivalent(base, other) {
|
|
192
|
-
return areAllEquivalentPredicate(base, other, (baseElement, otherElement) => baseElement.isEquivalent(otherElement));
|
|
193
|
-
}
|
|
194
|
-
class Expression {
|
|
195
|
-
type;
|
|
196
|
-
sourceSpan;
|
|
197
|
-
constructor(type, sourceSpan) {
|
|
198
|
-
this.type = type || null;
|
|
199
|
-
this.sourceSpan = sourceSpan || null;
|
|
200
|
-
}
|
|
201
|
-
prop(name, sourceSpan) {
|
|
202
|
-
return new ReadPropExpr(this, name, null, sourceSpan);
|
|
203
|
-
}
|
|
204
|
-
key(index, type, sourceSpan) {
|
|
205
|
-
return new ReadKeyExpr(this, index, type, sourceSpan);
|
|
206
|
-
}
|
|
207
|
-
callFn(params, sourceSpan, pure) {
|
|
208
|
-
return new InvokeFunctionExpr(this, params, null, sourceSpan, pure);
|
|
209
|
-
}
|
|
210
|
-
instantiate(params, type, sourceSpan) {
|
|
211
|
-
return new InstantiateExpr(this, params, type, sourceSpan);
|
|
212
|
-
}
|
|
213
|
-
conditional(trueCase, falseCase = null, sourceSpan) {
|
|
214
|
-
return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);
|
|
215
|
-
}
|
|
216
|
-
equals(rhs, sourceSpan) {
|
|
217
|
-
return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);
|
|
218
|
-
}
|
|
219
|
-
notEquals(rhs, sourceSpan) {
|
|
220
|
-
return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);
|
|
221
|
-
}
|
|
222
|
-
identical(rhs, sourceSpan) {
|
|
223
|
-
return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);
|
|
224
|
-
}
|
|
225
|
-
notIdentical(rhs, sourceSpan) {
|
|
226
|
-
return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);
|
|
227
|
-
}
|
|
228
|
-
minus(rhs, sourceSpan) {
|
|
229
|
-
return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);
|
|
230
|
-
}
|
|
231
|
-
plus(rhs, sourceSpan) {
|
|
232
|
-
return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);
|
|
233
|
-
}
|
|
234
|
-
divide(rhs, sourceSpan) {
|
|
235
|
-
return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);
|
|
236
|
-
}
|
|
237
|
-
multiply(rhs, sourceSpan) {
|
|
238
|
-
return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);
|
|
239
|
-
}
|
|
240
|
-
modulo(rhs, sourceSpan) {
|
|
241
|
-
return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);
|
|
242
|
-
}
|
|
243
|
-
power(rhs, sourceSpan) {
|
|
244
|
-
return new BinaryOperatorExpr(BinaryOperator.Exponentiation, this, rhs, null, sourceSpan);
|
|
245
|
-
}
|
|
246
|
-
and(rhs, sourceSpan) {
|
|
247
|
-
return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);
|
|
248
|
-
}
|
|
249
|
-
bitwiseOr(rhs, sourceSpan) {
|
|
250
|
-
return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan);
|
|
251
|
-
}
|
|
252
|
-
bitwiseAnd(rhs, sourceSpan) {
|
|
253
|
-
return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan);
|
|
254
|
-
}
|
|
255
|
-
or(rhs, sourceSpan) {
|
|
256
|
-
return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);
|
|
257
|
-
}
|
|
258
|
-
lower(rhs, sourceSpan) {
|
|
259
|
-
return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);
|
|
260
|
-
}
|
|
261
|
-
lowerEquals(rhs, sourceSpan) {
|
|
262
|
-
return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);
|
|
263
|
-
}
|
|
264
|
-
bigger(rhs, sourceSpan) {
|
|
265
|
-
return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);
|
|
266
|
-
}
|
|
267
|
-
biggerEquals(rhs, sourceSpan) {
|
|
268
|
-
return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);
|
|
269
|
-
}
|
|
270
|
-
isBlank(sourceSpan) {
|
|
271
|
-
// Note: We use equals by purpose here to compare to null and undefined in JS.
|
|
272
|
-
// We use the typed null to allow strictNullChecks to narrow types.
|
|
273
|
-
return this.equals(TYPED_NULL_EXPR, sourceSpan);
|
|
274
|
-
}
|
|
275
|
-
nullishCoalesce(rhs, sourceSpan) {
|
|
276
|
-
return new BinaryOperatorExpr(BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan);
|
|
277
|
-
}
|
|
278
|
-
toStmt() {
|
|
279
|
-
return new ExpressionStatement(this, null);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
class InvokeFunctionExpr extends Expression {
|
|
283
|
-
fn;
|
|
284
|
-
args;
|
|
285
|
-
pure;
|
|
286
|
-
constructor(fn, args, type, sourceSpan, pure = false) {
|
|
287
|
-
super(type, sourceSpan);
|
|
288
|
-
this.fn = fn;
|
|
289
|
-
this.args = args;
|
|
290
|
-
this.pure = pure;
|
|
291
|
-
}
|
|
292
|
-
// An alias for fn, which allows other logic to handle calls and property reads together.
|
|
293
|
-
get receiver() {
|
|
294
|
-
return this.fn;
|
|
295
|
-
}
|
|
296
|
-
isEquivalent(e) {
|
|
297
|
-
return (e instanceof InvokeFunctionExpr &&
|
|
298
|
-
this.fn.isEquivalent(e.fn) &&
|
|
299
|
-
areAllEquivalent(this.args, e.args) &&
|
|
300
|
-
this.pure === e.pure);
|
|
301
|
-
}
|
|
302
|
-
isConstant() {
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
|
-
visitExpression(visitor, context) {
|
|
306
|
-
return visitor.visitInvokeFunctionExpr(this, context);
|
|
307
|
-
}
|
|
308
|
-
clone() {
|
|
309
|
-
return new InvokeFunctionExpr(this.fn.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan, this.pure);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
class InstantiateExpr extends Expression {
|
|
313
|
-
classExpr;
|
|
314
|
-
args;
|
|
315
|
-
constructor(classExpr, args, type, sourceSpan) {
|
|
316
|
-
super(type, sourceSpan);
|
|
317
|
-
this.classExpr = classExpr;
|
|
318
|
-
this.args = args;
|
|
319
|
-
}
|
|
320
|
-
isEquivalent(e) {
|
|
321
|
-
return (e instanceof InstantiateExpr &&
|
|
322
|
-
this.classExpr.isEquivalent(e.classExpr) &&
|
|
323
|
-
areAllEquivalent(this.args, e.args));
|
|
324
|
-
}
|
|
325
|
-
isConstant() {
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
visitExpression(visitor, context) {
|
|
329
|
-
return visitor.visitInstantiateExpr(this, context);
|
|
330
|
-
}
|
|
331
|
-
clone() {
|
|
332
|
-
return new InstantiateExpr(this.classExpr.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
class LiteralExpr extends Expression {
|
|
336
|
-
value;
|
|
337
|
-
constructor(value, type, sourceSpan) {
|
|
338
|
-
super(type, sourceSpan);
|
|
339
|
-
this.value = value;
|
|
340
|
-
}
|
|
341
|
-
isEquivalent(e) {
|
|
342
|
-
return e instanceof LiteralExpr && this.value === e.value;
|
|
343
|
-
}
|
|
344
|
-
isConstant() {
|
|
345
|
-
return true;
|
|
346
|
-
}
|
|
347
|
-
visitExpression(visitor, context) {
|
|
348
|
-
return visitor.visitLiteralExpr(this, context);
|
|
349
|
-
}
|
|
350
|
-
clone() {
|
|
351
|
-
return new LiteralExpr(this.value, this.type, this.sourceSpan);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
class ConditionalExpr extends Expression {
|
|
355
|
-
condition;
|
|
356
|
-
falseCase;
|
|
357
|
-
trueCase;
|
|
358
|
-
constructor(condition, trueCase, falseCase = null, type, sourceSpan) {
|
|
359
|
-
super(type || trueCase.type, sourceSpan);
|
|
360
|
-
this.condition = condition;
|
|
361
|
-
this.falseCase = falseCase;
|
|
362
|
-
this.trueCase = trueCase;
|
|
363
|
-
}
|
|
364
|
-
isEquivalent(e) {
|
|
365
|
-
return (e instanceof ConditionalExpr &&
|
|
366
|
-
this.condition.isEquivalent(e.condition) &&
|
|
367
|
-
this.trueCase.isEquivalent(e.trueCase) &&
|
|
368
|
-
nullSafeIsEquivalent(this.falseCase, e.falseCase));
|
|
369
|
-
}
|
|
370
|
-
isConstant() {
|
|
371
|
-
return false;
|
|
372
|
-
}
|
|
373
|
-
visitExpression(visitor, context) {
|
|
374
|
-
return visitor.visitConditionalExpr(this, context);
|
|
375
|
-
}
|
|
376
|
-
clone() {
|
|
377
|
-
return new ConditionalExpr(this.condition.clone(), this.trueCase.clone(), this.falseCase?.clone(), this.type, this.sourceSpan);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
class BinaryOperatorExpr extends Expression {
|
|
381
|
-
operator;
|
|
382
|
-
rhs;
|
|
383
|
-
lhs;
|
|
384
|
-
constructor(operator, lhs, rhs, type, sourceSpan) {
|
|
385
|
-
super(type || lhs.type, sourceSpan);
|
|
386
|
-
this.operator = operator;
|
|
387
|
-
this.rhs = rhs;
|
|
388
|
-
this.lhs = lhs;
|
|
389
|
-
}
|
|
390
|
-
isEquivalent(e) {
|
|
391
|
-
return (e instanceof BinaryOperatorExpr &&
|
|
392
|
-
this.operator === e.operator &&
|
|
393
|
-
this.lhs.isEquivalent(e.lhs) &&
|
|
394
|
-
this.rhs.isEquivalent(e.rhs));
|
|
395
|
-
}
|
|
396
|
-
isConstant() {
|
|
397
|
-
return false;
|
|
398
|
-
}
|
|
399
|
-
visitExpression(visitor, context) {
|
|
400
|
-
return visitor.visitBinaryOperatorExpr(this, context);
|
|
401
|
-
}
|
|
402
|
-
clone() {
|
|
403
|
-
return new BinaryOperatorExpr(this.operator, this.lhs.clone(), this.rhs.clone(), this.type, this.sourceSpan);
|
|
404
|
-
}
|
|
405
|
-
isAssignment() {
|
|
406
|
-
const op = this.operator;
|
|
407
|
-
return (op === BinaryOperator.Assign ||
|
|
408
|
-
op === BinaryOperator.AdditionAssignment ||
|
|
409
|
-
op === BinaryOperator.SubtractionAssignment ||
|
|
410
|
-
op === BinaryOperator.MultiplicationAssignment ||
|
|
411
|
-
op === BinaryOperator.DivisionAssignment ||
|
|
412
|
-
op === BinaryOperator.RemainderAssignment ||
|
|
413
|
-
op === BinaryOperator.ExponentiationAssignment ||
|
|
414
|
-
op === BinaryOperator.AndAssignment ||
|
|
415
|
-
op === BinaryOperator.OrAssignment ||
|
|
416
|
-
op === BinaryOperator.NullishCoalesceAssignment);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
class ReadPropExpr extends Expression {
|
|
420
|
-
receiver;
|
|
421
|
-
name;
|
|
422
|
-
constructor(receiver, name, type, sourceSpan) {
|
|
423
|
-
super(type, sourceSpan);
|
|
424
|
-
this.receiver = receiver;
|
|
425
|
-
this.name = name;
|
|
426
|
-
}
|
|
427
|
-
// An alias for name, which allows other logic to handle property reads and keyed reads together.
|
|
428
|
-
get index() {
|
|
429
|
-
return this.name;
|
|
430
|
-
}
|
|
431
|
-
isEquivalent(e) {
|
|
432
|
-
return (e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) && this.name === e.name);
|
|
433
|
-
}
|
|
434
|
-
isConstant() {
|
|
435
|
-
return false;
|
|
436
|
-
}
|
|
437
|
-
visitExpression(visitor, context) {
|
|
438
|
-
return visitor.visitReadPropExpr(this, context);
|
|
439
|
-
}
|
|
440
|
-
set(value) {
|
|
441
|
-
return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.prop(this.name), value, null, this.sourceSpan);
|
|
442
|
-
}
|
|
443
|
-
clone() {
|
|
444
|
-
return new ReadPropExpr(this.receiver.clone(), this.name, this.type, this.sourceSpan);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
class ReadKeyExpr extends Expression {
|
|
448
|
-
receiver;
|
|
449
|
-
index;
|
|
450
|
-
constructor(receiver, index, type, sourceSpan) {
|
|
451
|
-
super(type, sourceSpan);
|
|
452
|
-
this.receiver = receiver;
|
|
453
|
-
this.index = index;
|
|
454
|
-
}
|
|
455
|
-
isEquivalent(e) {
|
|
456
|
-
return (e instanceof ReadKeyExpr &&
|
|
457
|
-
this.receiver.isEquivalent(e.receiver) &&
|
|
458
|
-
this.index.isEquivalent(e.index));
|
|
459
|
-
}
|
|
460
|
-
isConstant() {
|
|
461
|
-
return false;
|
|
462
|
-
}
|
|
463
|
-
visitExpression(visitor, context) {
|
|
464
|
-
return visitor.visitReadKeyExpr(this, context);
|
|
465
|
-
}
|
|
466
|
-
set(value) {
|
|
467
|
-
return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.key(this.index), value, null, this.sourceSpan);
|
|
468
|
-
}
|
|
469
|
-
clone() {
|
|
470
|
-
return new ReadKeyExpr(this.receiver.clone(), this.index.clone(), this.type, this.sourceSpan);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
const NULL_EXPR = new LiteralExpr(null, null, null);
|
|
474
|
-
const TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);
|
|
475
|
-
//// Statements
|
|
476
|
-
var StmtModifier;
|
|
477
|
-
(function (StmtModifier) {
|
|
478
|
-
StmtModifier[StmtModifier["None"] = 0] = "None";
|
|
479
|
-
StmtModifier[StmtModifier["Final"] = 1] = "Final";
|
|
480
|
-
StmtModifier[StmtModifier["Private"] = 2] = "Private";
|
|
481
|
-
StmtModifier[StmtModifier["Exported"] = 4] = "Exported";
|
|
482
|
-
StmtModifier[StmtModifier["Static"] = 8] = "Static";
|
|
483
|
-
})(StmtModifier || (StmtModifier = {}));
|
|
484
|
-
class Statement {
|
|
485
|
-
modifiers;
|
|
486
|
-
sourceSpan;
|
|
487
|
-
leadingComments;
|
|
488
|
-
constructor(modifiers = StmtModifier.None, sourceSpan = null, leadingComments) {
|
|
489
|
-
this.modifiers = modifiers;
|
|
490
|
-
this.sourceSpan = sourceSpan;
|
|
491
|
-
this.leadingComments = leadingComments;
|
|
492
|
-
}
|
|
493
|
-
hasModifier(modifier) {
|
|
494
|
-
return (this.modifiers & modifier) !== 0;
|
|
495
|
-
}
|
|
496
|
-
addLeadingComment(leadingComment) {
|
|
497
|
-
this.leadingComments = this.leadingComments ?? [];
|
|
498
|
-
this.leadingComments.push(leadingComment);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
class ExpressionStatement extends Statement {
|
|
502
|
-
expr;
|
|
503
|
-
constructor(expr, sourceSpan, leadingComments) {
|
|
504
|
-
super(StmtModifier.None, sourceSpan, leadingComments);
|
|
505
|
-
this.expr = expr;
|
|
506
|
-
}
|
|
507
|
-
isEquivalent(stmt) {
|
|
508
|
-
return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr);
|
|
509
|
-
}
|
|
510
|
-
visitStatement(visitor, context) {
|
|
511
|
-
return visitor.visitExpressionStmt(this, context);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
80
|
/**
|
|
516
81
|
* Detects `spyOn(dirInstance, 'myInput')` calls that likely modify
|
|
517
82
|
* the input signal. There is no way to change the value inside the input signal,
|
|
@@ -1914,7 +1479,6 @@ function migrateTypeScriptTypeReferences(host, references, importManager, info)
|
|
|
1914
1479
|
|
|
1915
1480
|
exports.GroupedTsAstVisitor = GroupedTsAstVisitor;
|
|
1916
1481
|
exports.InheritanceGraph = InheritanceGraph;
|
|
1917
|
-
exports.NULL_EXPR = NULL_EXPR;
|
|
1918
1482
|
exports.checkIncompatiblePatterns = checkIncompatiblePatterns;
|
|
1919
1483
|
exports.checkInheritanceOfKnownFields = checkInheritanceOfKnownFields;
|
|
1920
1484
|
exports.cutStringToLineLimit = cutStringToLineLimit;
|