@angular/compiler-cli 13.1.0-next.2 → 13.1.2
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/bundles/{chunk-2DL256T3.js → chunk-5TY44ZS3.js} +426 -434
- package/bundles/chunk-5TY44ZS3.js.map +6 -0
- package/bundles/{chunk-EP5JHXG2.js → chunk-676MI6WZ.js} +33 -54
- package/bundles/chunk-676MI6WZ.js.map +6 -0
- package/bundles/{chunk-WOC6KEUY.js → chunk-6VRWTEQB.js} +28 -30
- package/bundles/chunk-6VRWTEQB.js.map +6 -0
- package/bundles/{chunk-S3QIIFH7.js → chunk-7PY7XEFH.js} +9 -6
- package/bundles/chunk-7PY7XEFH.js.map +6 -0
- package/bundles/{chunk-PBA67OV4.js → chunk-A5PL3TE6.js} +30 -6
- package/bundles/chunk-A5PL3TE6.js.map +6 -0
- package/bundles/{chunk-QL6ZC3U3.js → chunk-ADHVDA4A.js} +6 -6
- package/bundles/{chunk-QL6ZC3U3.js.map → chunk-ADHVDA4A.js.map} +1 -1
- package/bundles/{chunk-MIQ5UCHZ.js → chunk-FUZ3CSDO.js} +306 -389
- package/bundles/chunk-FUZ3CSDO.js.map +6 -0
- package/bundles/{chunk-BUHTODFL.js → chunk-JOLPJ2E4.js} +21 -19
- package/bundles/chunk-JOLPJ2E4.js.map +6 -0
- package/bundles/{chunk-UMUIU7TE.js → chunk-O4XVCXRT.js} +2 -2
- package/bundles/{chunk-UMUIU7TE.js.map → chunk-O4XVCXRT.js.map} +0 -0
- package/bundles/{chunk-WYO7JO2T.js → chunk-QBU7RUKB.js} +259 -85
- package/bundles/chunk-QBU7RUKB.js.map +6 -0
- package/bundles/{chunk-VKIZ4TCJ.js → chunk-TUNE6DP3.js} +6370 -10786
- package/bundles/chunk-TUNE6DP3.js.map +6 -0
- package/bundles/{chunk-JNWO3JB2.js → chunk-UESD6FVI.js} +13 -15
- package/bundles/chunk-UESD6FVI.js.map +6 -0
- package/bundles/{chunk-XA5IZLLC.js → chunk-WQ3TNYTD.js} +6 -6
- package/bundles/{chunk-XA5IZLLC.js.map → chunk-WQ3TNYTD.js.map} +0 -0
- package/bundles/index.js +9 -73
- package/bundles/index.js.map +2 -2
- package/bundles/linker/babel/index.js +77 -77
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +9 -10
- package/bundles/ngcc/index.js.map +1 -1
- package/bundles/ngcc/main-ngcc.js +10 -11
- package/bundles/ngcc/main-ngcc.js.map +1 -1
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +9 -10
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +2 -2
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +3 -4
- package/bundles/src/bin/ng_xi18n.js +7 -8
- package/bundles/src/bin/ng_xi18n.js.map +1 -1
- package/bundles/src/bin/ngc.js +9 -10
- package/bundles/src/bin/ngc.js.map +1 -1
- package/bundles_metadata.json +1 -1
- package/index.d.ts +2 -3
- package/ngcc/src/host/delegating_host.d.ts +1 -2
- package/ngcc/src/host/esm2015_host.d.ts +1 -8
- package/ngcc/src/host/ngcc_host.d.ts +0 -13
- package/ngcc/src/host/umd_host.d.ts +3 -0
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/ngcc/src/packages/transformer.d.ts +0 -2
- package/ngcc/src/rendering/esm_rendering_formatter.d.ts +1 -5
- package/ngcc/src/rendering/renderer.d.ts +2 -3
- package/ngcc/src/rendering/rendering_formatter.d.ts +0 -2
- package/ngcc/src/utils.d.ts +0 -7
- package/package.json +3 -3
- package/src/main.d.ts +3 -3
- package/src/ngtsc/annotations/src/util.d.ts +1 -1
- package/src/ngtsc/core/api/src/options.d.ts +3 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +38 -0
- package/src/ngtsc/core/src/host.d.ts +2 -1
- package/src/ngtsc/diagnostics/index.d.ts +2 -1
- package/src/ngtsc/diagnostics/src/error.d.ts +1 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +7 -0
- package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +1 -1
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +21 -0
- package/src/ngtsc/file_system/src/compiler_host.d.ts +1 -0
- package/src/ngtsc/imports/index.d.ts +1 -1
- package/src/ngtsc/imports/src/emitter.d.ts +40 -8
- package/src/ngtsc/partial_evaluator/src/builtin.d.ts +5 -0
- package/src/ngtsc/program.d.ts +3 -6
- package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +2 -1
- package/src/ngtsc/reflection/src/host.d.ts +1 -1
- package/src/ngtsc/translator/src/translator.d.ts +0 -5
- package/src/ngtsc/translator/src/type_translator.d.ts +0 -2
- package/src/ngtsc/typecheck/extended/api/api.d.ts +30 -10
- package/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.d.ts +3 -14
- package/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.d.ts +3 -15
- package/src/ngtsc/typecheck/extended/index.d.ts +3 -0
- package/src/ngtsc/typecheck/extended/src/extended_template_checker.d.ts +5 -4
- package/src/ngtsc/typecheck/src/environment.d.ts +3 -1
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +10 -2
- package/src/ngtsc/typecheck/src/type_constructor.d.ts +3 -2
- package/src/ngtsc/typecheck/src/type_emitter.d.ts +7 -21
- package/src/ngtsc/typecheck/src/type_parameter_emitter.d.ts +2 -2
- package/src/ngtsc/util/src/typescript.d.ts +5 -0
- package/src/perform_compile.d.ts +5 -10
- package/src/perform_watch.d.ts +4 -4
- package/src/transformers/api.d.ts +3 -30
- package/src/transformers/compiler_host.d.ts +1 -97
- package/src/transformers/program.d.ts +0 -19
- package/src/transformers/util.d.ts +1 -20
- package/src/{diagnostics/typescript_version.d.ts → version_helpers.d.ts} +1 -1
- package/bundles/chunk-2DL256T3.js.map +0 -6
- package/bundles/chunk-ACINBTQB.js +0 -43
- package/bundles/chunk-ACINBTQB.js.map +0 -6
- package/bundles/chunk-BUHTODFL.js.map +0 -6
- package/bundles/chunk-EP5JHXG2.js.map +0 -6
- package/bundles/chunk-JNWO3JB2.js.map +0 -6
- package/bundles/chunk-MIQ5UCHZ.js.map +0 -6
- package/bundles/chunk-PBA67OV4.js.map +0 -6
- package/bundles/chunk-S3QIIFH7.js.map +0 -6
- package/bundles/chunk-VKIZ4TCJ.js.map +0 -6
- package/bundles/chunk-WOC6KEUY.js.map +0 -6
- package/bundles/chunk-WYO7JO2T.js.map +0 -6
- package/ngcc/src/analysis/switch_marker_analyzer.d.ts +0 -35
- package/src/diagnostics/translate_diagnostics.d.ts +0 -18
- package/src/language_services.d.ts +0 -11
- package/src/metadata/bundle_index_host.d.ts +0 -16
- package/src/metadata/bundler.d.ts +0 -66
- package/src/metadata/collector.d.ts +0 -44
- package/src/metadata/evaluator.d.ts +0 -58
- package/src/metadata/index.d.ts +0 -11
- package/src/metadata/index_writer.d.ts +0 -10
- package/src/metadata/schema.d.ts +0 -182
- package/src/metadata/symbols.d.ts +0 -22
- package/src/ngtsc/switch/index.d.ts +0 -9
- package/src/ngtsc/switch/src/switch.d.ts +0 -10
- package/src/transformers/inline_resources.d.ts +0 -26
- package/src/transformers/lower_expressions.d.ts +0 -30
- package/src/transformers/metadata_cache.d.ts +0 -27
- package/src/transformers/metadata_reader.d.ts +0 -19
- package/src/transformers/node_emitter.d.ts +0 -105
- package/src/transformers/node_emitter_transform.d.ts +0 -19
- package/src/transformers/r3_metadata_transform.d.ts +0 -16
- package/src/transformers/r3_transform.d.ts +0 -16
|
@@ -13,26 +13,32 @@ import {
|
|
|
13
13
|
reflectObjectLiteral,
|
|
14
14
|
reflectTypeEntityToDeclaration,
|
|
15
15
|
typeNodeToValueExpr
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7PY7XEFH.js";
|
|
17
17
|
import {
|
|
18
|
+
ErrorCode,
|
|
19
|
+
FatalDiagnosticError,
|
|
18
20
|
ImportFlags,
|
|
19
21
|
ImportManager,
|
|
20
22
|
Reference,
|
|
23
|
+
assertSuccessfulReferenceEmit,
|
|
21
24
|
attachDefaultImportDeclaration,
|
|
25
|
+
createExportSpecifier,
|
|
22
26
|
getDefaultImportDeclaration,
|
|
23
27
|
getSourceFile,
|
|
24
28
|
identifierOfNode,
|
|
25
29
|
isDeclaration,
|
|
30
|
+
makeDiagnostic,
|
|
31
|
+
makeRelatedInformation,
|
|
26
32
|
nodeDebugInfo,
|
|
27
33
|
translateExpression,
|
|
28
34
|
translateStatement,
|
|
29
35
|
translateType
|
|
30
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-QBU7RUKB.js";
|
|
31
37
|
import {
|
|
32
38
|
absoluteFrom,
|
|
33
39
|
absoluteFromSourceFile,
|
|
34
40
|
relative
|
|
35
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-676MI6WZ.js";
|
|
36
42
|
import {
|
|
37
43
|
PerfEvent,
|
|
38
44
|
PerfPhase
|
|
@@ -40,7 +46,7 @@ import {
|
|
|
40
46
|
import {
|
|
41
47
|
__spreadProps,
|
|
42
48
|
__spreadValues
|
|
43
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-WQ3TNYTD.js";
|
|
44
50
|
|
|
45
51
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
46
52
|
var DynamicValue = class {
|
|
@@ -143,7 +149,7 @@ var ResolvedModule = class {
|
|
|
143
149
|
return this.evaluate(this.exports.get(name));
|
|
144
150
|
}
|
|
145
151
|
getExports() {
|
|
146
|
-
const map = new Map();
|
|
152
|
+
const map = /* @__PURE__ */ new Map();
|
|
147
153
|
this.exports.forEach((decl, name) => {
|
|
148
154
|
map.set(name, this.evaluate(decl));
|
|
149
155
|
});
|
|
@@ -193,6 +199,24 @@ var ArrayConcatBuiltinFn = class extends KnownFn {
|
|
|
193
199
|
return result;
|
|
194
200
|
}
|
|
195
201
|
};
|
|
202
|
+
var StringConcatBuiltinFn = class extends KnownFn {
|
|
203
|
+
constructor(lhs) {
|
|
204
|
+
super();
|
|
205
|
+
this.lhs = lhs;
|
|
206
|
+
}
|
|
207
|
+
evaluate(node, args) {
|
|
208
|
+
let result = this.lhs;
|
|
209
|
+
for (const arg of args) {
|
|
210
|
+
const resolved = arg instanceof EnumValue ? arg.resolved : arg;
|
|
211
|
+
if (typeof resolved === "string" || typeof resolved === "number" || typeof resolved === "boolean" || resolved == null) {
|
|
212
|
+
result = result.concat(resolved);
|
|
213
|
+
} else {
|
|
214
|
+
return DynamicValue.fromUnknown(node);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
196
220
|
var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
197
221
|
evaluate(node, args) {
|
|
198
222
|
if (args.length === 0) {
|
|
@@ -267,7 +291,7 @@ var ReadHelperFn = class extends KnownFn {
|
|
|
267
291
|
};
|
|
268
292
|
|
|
269
293
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
|
|
270
|
-
var jsGlobalObjectValue = new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
294
|
+
var jsGlobalObjectValue = /* @__PURE__ */ new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
271
295
|
var assignTsHelperFn = new AssignHelperFn();
|
|
272
296
|
var spreadTsHelperFn = new SpreadHelperFn();
|
|
273
297
|
var spreadArrayTsHelperFn = new SpreadArrayHelperFn();
|
|
@@ -297,7 +321,7 @@ function literalBinaryOp(op) {
|
|
|
297
321
|
function referenceBinaryOp(op) {
|
|
298
322
|
return { op, literal: false };
|
|
299
323
|
}
|
|
300
|
-
var BINARY_OPERATORS = new Map([
|
|
324
|
+
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
301
325
|
[ts.SyntaxKind.PlusToken, literalBinaryOp((a, b) => a + b)],
|
|
302
326
|
[ts.SyntaxKind.MinusToken, literalBinaryOp((a, b) => a - b)],
|
|
303
327
|
[ts.SyntaxKind.AsteriskToken, literalBinaryOp((a, b) => a * b)],
|
|
@@ -321,7 +345,7 @@ var BINARY_OPERATORS = new Map([
|
|
|
321
345
|
[ts.SyntaxKind.AmpersandAmpersandToken, referenceBinaryOp((a, b) => a && b)],
|
|
322
346
|
[ts.SyntaxKind.BarBarToken, referenceBinaryOp((a, b) => a || b)]
|
|
323
347
|
]);
|
|
324
|
-
var UNARY_OPERATORS = new Map([
|
|
348
|
+
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
325
349
|
[ts.SyntaxKind.TildeToken, (a) => ~a],
|
|
326
350
|
[ts.SyntaxKind.MinusToken, (a) => -a],
|
|
327
351
|
[ts.SyntaxKind.PlusToken, (a) => +a],
|
|
@@ -399,7 +423,7 @@ var StaticInterpreter = class {
|
|
|
399
423
|
return array;
|
|
400
424
|
}
|
|
401
425
|
visitObjectLiteralExpression(node, context) {
|
|
402
|
-
const map = new Map();
|
|
426
|
+
const map = /* @__PURE__ */ new Map();
|
|
403
427
|
for (let i = 0; i < node.properties.length; i++) {
|
|
404
428
|
const property = node.properties[i];
|
|
405
429
|
if (ts.isPropertyAssignment(property)) {
|
|
@@ -512,7 +536,7 @@ var StaticInterpreter = class {
|
|
|
512
536
|
}
|
|
513
537
|
visitEnumDeclaration(node, context) {
|
|
514
538
|
const enumRef = this.getReference(node, context);
|
|
515
|
-
const map = new Map();
|
|
539
|
+
const map = /* @__PURE__ */ new Map();
|
|
516
540
|
node.members.forEach((member) => {
|
|
517
541
|
const name = this.stringNameFromPropertyName(member.name, context);
|
|
518
542
|
if (name !== void 0) {
|
|
@@ -582,6 +606,8 @@ var StaticInterpreter = class {
|
|
|
582
606
|
return DynamicValue.fromInvalidExpressionType(node, rhs);
|
|
583
607
|
}
|
|
584
608
|
return lhs[rhs];
|
|
609
|
+
} else if (typeof lhs === "string" && rhs === "concat") {
|
|
610
|
+
return new StringConcatBuiltinFn(lhs);
|
|
585
611
|
} else if (lhs instanceof Reference) {
|
|
586
612
|
const ref = lhs.node;
|
|
587
613
|
if (this.host.isClass(ref)) {
|
|
@@ -667,7 +693,7 @@ var StaticInterpreter = class {
|
|
|
667
693
|
}
|
|
668
694
|
const ret = fn.body[0];
|
|
669
695
|
const args = this.evaluateFunctionArguments(node, context);
|
|
670
|
-
const newScope = new Map();
|
|
696
|
+
const newScope = /* @__PURE__ */ new Map();
|
|
671
697
|
const calleeContext = __spreadProps(__spreadValues({}, context), { scope: newScope });
|
|
672
698
|
fn.parameters.forEach((param, index) => {
|
|
673
699
|
let arg = args[index];
|
|
@@ -795,7 +821,7 @@ var StaticInterpreter = class {
|
|
|
795
821
|
}
|
|
796
822
|
getResolvedEnum(node, enumMembers, context) {
|
|
797
823
|
const enumRef = this.getReference(node, context);
|
|
798
|
-
const map = new Map();
|
|
824
|
+
const map = /* @__PURE__ */ new Map();
|
|
799
825
|
enumMembers.forEach((member) => {
|
|
800
826
|
const name = this.stringNameFromPropertyName(member.name, context);
|
|
801
827
|
if (name !== void 0) {
|
|
@@ -889,133 +915,14 @@ var PartialEvaluator = class {
|
|
|
889
915
|
originatingFile: sourceFile,
|
|
890
916
|
absoluteModuleName: null,
|
|
891
917
|
resolutionContext: sourceFile.fileName,
|
|
892
|
-
scope: new Map(),
|
|
918
|
+
scope: /* @__PURE__ */ new Map(),
|
|
893
919
|
foreignFunctionResolver
|
|
894
920
|
});
|
|
895
921
|
}
|
|
896
922
|
};
|
|
897
923
|
|
|
898
924
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
899
|
-
import ts3 from "typescript";
|
|
900
|
-
|
|
901
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
902
|
-
var ErrorCode;
|
|
903
|
-
(function(ErrorCode2) {
|
|
904
|
-
ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
|
|
905
|
-
ErrorCode2[ErrorCode2["DECORATOR_ARITY_WRONG"] = 1002] = "DECORATOR_ARITY_WRONG";
|
|
906
|
-
ErrorCode2[ErrorCode2["DECORATOR_NOT_CALLED"] = 1003] = "DECORATOR_NOT_CALLED";
|
|
907
|
-
ErrorCode2[ErrorCode2["DECORATOR_ON_ANONYMOUS_CLASS"] = 1004] = "DECORATOR_ON_ANONYMOUS_CLASS";
|
|
908
|
-
ErrorCode2[ErrorCode2["DECORATOR_UNEXPECTED"] = 1005] = "DECORATOR_UNEXPECTED";
|
|
909
|
-
ErrorCode2[ErrorCode2["DECORATOR_COLLISION"] = 1006] = "DECORATOR_COLLISION";
|
|
910
|
-
ErrorCode2[ErrorCode2["VALUE_HAS_WRONG_TYPE"] = 1010] = "VALUE_HAS_WRONG_TYPE";
|
|
911
|
-
ErrorCode2[ErrorCode2["VALUE_NOT_LITERAL"] = 1011] = "VALUE_NOT_LITERAL";
|
|
912
|
-
ErrorCode2[ErrorCode2["COMPONENT_MISSING_TEMPLATE"] = 2001] = "COMPONENT_MISSING_TEMPLATE";
|
|
913
|
-
ErrorCode2[ErrorCode2["PIPE_MISSING_NAME"] = 2002] = "PIPE_MISSING_NAME";
|
|
914
|
-
ErrorCode2[ErrorCode2["PARAM_MISSING_TOKEN"] = 2003] = "PARAM_MISSING_TOKEN";
|
|
915
|
-
ErrorCode2[ErrorCode2["DIRECTIVE_MISSING_SELECTOR"] = 2004] = "DIRECTIVE_MISSING_SELECTOR";
|
|
916
|
-
ErrorCode2[ErrorCode2["UNDECORATED_PROVIDER"] = 2005] = "UNDECORATED_PROVIDER";
|
|
917
|
-
ErrorCode2[ErrorCode2["DIRECTIVE_INHERITS_UNDECORATED_CTOR"] = 2006] = "DIRECTIVE_INHERITS_UNDECORATED_CTOR";
|
|
918
|
-
ErrorCode2[ErrorCode2["UNDECORATED_CLASS_USING_ANGULAR_FEATURES"] = 2007] = "UNDECORATED_CLASS_USING_ANGULAR_FEATURES";
|
|
919
|
-
ErrorCode2[ErrorCode2["COMPONENT_RESOURCE_NOT_FOUND"] = 2008] = "COMPONENT_RESOURCE_NOT_FOUND";
|
|
920
|
-
ErrorCode2[ErrorCode2["COMPONENT_INVALID_SHADOW_DOM_SELECTOR"] = 2009] = "COMPONENT_INVALID_SHADOW_DOM_SELECTOR";
|
|
921
|
-
ErrorCode2[ErrorCode2["SYMBOL_NOT_EXPORTED"] = 3001] = "SYMBOL_NOT_EXPORTED";
|
|
922
|
-
ErrorCode2[ErrorCode2["SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME"] = 3002] = "SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME";
|
|
923
|
-
ErrorCode2[ErrorCode2["IMPORT_CYCLE_DETECTED"] = 3003] = "IMPORT_CYCLE_DETECTED";
|
|
924
|
-
ErrorCode2[ErrorCode2["CONFIG_FLAT_MODULE_NO_INDEX"] = 4001] = "CONFIG_FLAT_MODULE_NO_INDEX";
|
|
925
|
-
ErrorCode2[ErrorCode2["CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK"] = 4002] = "CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK";
|
|
926
|
-
ErrorCode2[ErrorCode2["HOST_BINDING_PARSE_ERROR"] = 5001] = "HOST_BINDING_PARSE_ERROR";
|
|
927
|
-
ErrorCode2[ErrorCode2["TEMPLATE_PARSE_ERROR"] = 5002] = "TEMPLATE_PARSE_ERROR";
|
|
928
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_DECLARATION"] = 6001] = "NGMODULE_INVALID_DECLARATION";
|
|
929
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_IMPORT"] = 6002] = "NGMODULE_INVALID_IMPORT";
|
|
930
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_EXPORT"] = 6003] = "NGMODULE_INVALID_EXPORT";
|
|
931
|
-
ErrorCode2[ErrorCode2["NGMODULE_INVALID_REEXPORT"] = 6004] = "NGMODULE_INVALID_REEXPORT";
|
|
932
|
-
ErrorCode2[ErrorCode2["NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC"] = 6005] = "NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC";
|
|
933
|
-
ErrorCode2[ErrorCode2["NGMODULE_REEXPORT_NAME_COLLISION"] = 6006] = "NGMODULE_REEXPORT_NAME_COLLISION";
|
|
934
|
-
ErrorCode2[ErrorCode2["NGMODULE_DECLARATION_NOT_UNIQUE"] = 6007] = "NGMODULE_DECLARATION_NOT_UNIQUE";
|
|
935
|
-
ErrorCode2[ErrorCode2["NGMODULE_VE_DEPENDENCY_ON_IVY_LIB"] = 6999] = "NGMODULE_VE_DEPENDENCY_ON_IVY_LIB";
|
|
936
|
-
ErrorCode2[ErrorCode2["SCHEMA_INVALID_ELEMENT"] = 8001] = "SCHEMA_INVALID_ELEMENT";
|
|
937
|
-
ErrorCode2[ErrorCode2["SCHEMA_INVALID_ATTRIBUTE"] = 8002] = "SCHEMA_INVALID_ATTRIBUTE";
|
|
938
|
-
ErrorCode2[ErrorCode2["MISSING_REFERENCE_TARGET"] = 8003] = "MISSING_REFERENCE_TARGET";
|
|
939
|
-
ErrorCode2[ErrorCode2["MISSING_PIPE"] = 8004] = "MISSING_PIPE";
|
|
940
|
-
ErrorCode2[ErrorCode2["WRITE_TO_READ_ONLY_VARIABLE"] = 8005] = "WRITE_TO_READ_ONLY_VARIABLE";
|
|
941
|
-
ErrorCode2[ErrorCode2["DUPLICATE_VARIABLE_DECLARATION"] = 8006] = "DUPLICATE_VARIABLE_DECLARATION";
|
|
942
|
-
ErrorCode2[ErrorCode2["SPLIT_TWO_WAY_BINDING"] = 8007] = "SPLIT_TWO_WAY_BINDING";
|
|
943
|
-
ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
|
|
944
|
-
ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
|
|
945
|
-
ErrorCode2[ErrorCode2["INLINE_TCB_REQUIRED"] = 8900] = "INLINE_TCB_REQUIRED";
|
|
946
|
-
ErrorCode2[ErrorCode2["INLINE_TYPE_CTOR_REQUIRED"] = 8901] = "INLINE_TYPE_CTOR_REQUIRED";
|
|
947
|
-
ErrorCode2[ErrorCode2["INJECTABLE_DUPLICATE_PROV"] = 9001] = "INJECTABLE_DUPLICATE_PROV";
|
|
948
|
-
ErrorCode2[ErrorCode2["SUGGEST_STRICT_TEMPLATES"] = 10001] = "SUGGEST_STRICT_TEMPLATES";
|
|
949
|
-
ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
|
|
950
|
-
})(ErrorCode || (ErrorCode = {}));
|
|
951
|
-
|
|
952
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
953
|
-
var COMPILER_ERRORS_WITH_GUIDES = new Set([
|
|
954
|
-
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
955
|
-
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
956
|
-
ErrorCode.PARAM_MISSING_TOKEN,
|
|
957
|
-
ErrorCode.SCHEMA_INVALID_ELEMENT,
|
|
958
|
-
ErrorCode.SCHEMA_INVALID_ATTRIBUTE,
|
|
959
|
-
ErrorCode.MISSING_REFERENCE_TARGET,
|
|
960
|
-
ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR
|
|
961
|
-
]);
|
|
962
|
-
|
|
963
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
964
925
|
import ts2 from "typescript";
|
|
965
|
-
|
|
966
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
967
|
-
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
968
|
-
function replaceTsWithNgInErrors(errors) {
|
|
969
|
-
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
970
|
-
}
|
|
971
|
-
function ngErrorCode(code) {
|
|
972
|
-
return parseInt("-99" + code);
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
976
|
-
var FatalDiagnosticError = class {
|
|
977
|
-
constructor(code, node, message, relatedInformation) {
|
|
978
|
-
this.code = code;
|
|
979
|
-
this.node = node;
|
|
980
|
-
this.message = message;
|
|
981
|
-
this.relatedInformation = relatedInformation;
|
|
982
|
-
this._isFatalDiagnosticError = true;
|
|
983
|
-
}
|
|
984
|
-
toDiagnostic() {
|
|
985
|
-
return makeDiagnostic(this.code, this.node, this.message, this.relatedInformation);
|
|
986
|
-
}
|
|
987
|
-
};
|
|
988
|
-
function makeDiagnostic(code, node, messageText, relatedInformation) {
|
|
989
|
-
node = ts2.getOriginalNode(node);
|
|
990
|
-
return {
|
|
991
|
-
category: ts2.DiagnosticCategory.Error,
|
|
992
|
-
code: ngErrorCode(code),
|
|
993
|
-
file: ts2.getOriginalNode(node).getSourceFile(),
|
|
994
|
-
start: node.getStart(void 0, false),
|
|
995
|
-
length: node.getWidth(),
|
|
996
|
-
messageText,
|
|
997
|
-
relatedInformation
|
|
998
|
-
};
|
|
999
|
-
}
|
|
1000
|
-
function makeRelatedInformation(node, messageText) {
|
|
1001
|
-
node = ts2.getOriginalNode(node);
|
|
1002
|
-
return {
|
|
1003
|
-
category: ts2.DiagnosticCategory.Message,
|
|
1004
|
-
code: 0,
|
|
1005
|
-
file: node.getSourceFile(),
|
|
1006
|
-
start: node.getStart(),
|
|
1007
|
-
length: node.getWidth(),
|
|
1008
|
-
messageText
|
|
1009
|
-
};
|
|
1010
|
-
}
|
|
1011
|
-
function isFatalDiagnosticError(err) {
|
|
1012
|
-
return err._isFatalDiagnosticError === true;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
|
|
1016
|
-
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
|
|
1017
|
-
|
|
1018
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
1019
926
|
function describeResolvedType(value, maxDepth = 1) {
|
|
1020
927
|
var _a, _b;
|
|
1021
928
|
if (value === null) {
|
|
@@ -1119,21 +1026,21 @@ function getContainerNode(node) {
|
|
|
1119
1026
|
let currentNode = node;
|
|
1120
1027
|
while (currentNode !== void 0) {
|
|
1121
1028
|
switch (currentNode.kind) {
|
|
1122
|
-
case
|
|
1123
|
-
case
|
|
1124
|
-
case
|
|
1125
|
-
case
|
|
1126
|
-
case
|
|
1127
|
-
case
|
|
1128
|
-
case
|
|
1129
|
-
case
|
|
1130
|
-
case
|
|
1131
|
-
case
|
|
1132
|
-
case
|
|
1133
|
-
case
|
|
1134
|
-
case
|
|
1135
|
-
case
|
|
1136
|
-
case
|
|
1029
|
+
case ts2.SyntaxKind.ExpressionStatement:
|
|
1030
|
+
case ts2.SyntaxKind.VariableStatement:
|
|
1031
|
+
case ts2.SyntaxKind.ReturnStatement:
|
|
1032
|
+
case ts2.SyntaxKind.IfStatement:
|
|
1033
|
+
case ts2.SyntaxKind.SwitchStatement:
|
|
1034
|
+
case ts2.SyntaxKind.DoStatement:
|
|
1035
|
+
case ts2.SyntaxKind.WhileStatement:
|
|
1036
|
+
case ts2.SyntaxKind.ForStatement:
|
|
1037
|
+
case ts2.SyntaxKind.ForInStatement:
|
|
1038
|
+
case ts2.SyntaxKind.ForOfStatement:
|
|
1039
|
+
case ts2.SyntaxKind.ContinueStatement:
|
|
1040
|
+
case ts2.SyntaxKind.BreakStatement:
|
|
1041
|
+
case ts2.SyntaxKind.ThrowStatement:
|
|
1042
|
+
case ts2.SyntaxKind.ObjectBindingPattern:
|
|
1043
|
+
case ts2.SyntaxKind.ArrayBindingPattern:
|
|
1137
1044
|
return currentNode;
|
|
1138
1045
|
}
|
|
1139
1046
|
currentNode = currentNode.parent;
|
|
@@ -1143,7 +1050,7 @@ function getContainerNode(node) {
|
|
|
1143
1050
|
|
|
1144
1051
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/util.mjs
|
|
1145
1052
|
import { ExternalExpr, LiteralExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr } from "@angular/compiler";
|
|
1146
|
-
import
|
|
1053
|
+
import ts3 from "typescript";
|
|
1147
1054
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
1148
1055
|
const deps = [];
|
|
1149
1056
|
const errors = [];
|
|
@@ -1180,10 +1087,10 @@ function getConstructorDependencies(clazz, reflector, isCore) {
|
|
|
1180
1087
|
}
|
|
1181
1088
|
const attributeName = dec.args[0];
|
|
1182
1089
|
token = new WrappedNodeExpr(attributeName);
|
|
1183
|
-
if (
|
|
1090
|
+
if (ts3.isStringLiteralLike(attributeName)) {
|
|
1184
1091
|
attributeNameType = new LiteralExpr(attributeName.text);
|
|
1185
1092
|
} else {
|
|
1186
|
-
attributeNameType = new WrappedNodeExpr(
|
|
1093
|
+
attributeNameType = new WrappedNodeExpr(ts3.createKeywordTypeNode(ts3.SyntaxKind.UnknownKeyword));
|
|
1187
1094
|
}
|
|
1188
1095
|
} else {
|
|
1189
1096
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_UNEXPECTED, Decorator.nodeForError(dec), `Unexpected decorator ${name} on parameter.`);
|
|
@@ -1273,7 +1180,7 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1273
1180
|
chainMessage = "Consider changing the type-only import to a regular import, or use the @Inject decorator to specify an injection token.";
|
|
1274
1181
|
hints = [
|
|
1275
1182
|
makeRelatedInformation(reason.typeNode, "This type is imported using a type-only import, which prevents it from being usable as an injection token."),
|
|
1276
|
-
makeRelatedInformation(reason.
|
|
1183
|
+
makeRelatedInformation(reason.node, "The type-only import occurs here.")
|
|
1277
1184
|
];
|
|
1278
1185
|
break;
|
|
1279
1186
|
case 4:
|
|
@@ -1293,20 +1200,24 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1293
1200
|
}
|
|
1294
1201
|
const chain = {
|
|
1295
1202
|
messageText: `No suitable injection token for parameter '${param.name || index}' of class '${clazz.name.text}'.`,
|
|
1296
|
-
category:
|
|
1203
|
+
category: ts3.DiagnosticCategory.Error,
|
|
1297
1204
|
code: 0,
|
|
1298
1205
|
next: [{
|
|
1299
1206
|
messageText: chainMessage,
|
|
1300
|
-
category:
|
|
1207
|
+
category: ts3.DiagnosticCategory.Message,
|
|
1301
1208
|
code: 0
|
|
1302
1209
|
}]
|
|
1303
1210
|
};
|
|
1304
1211
|
return new FatalDiagnosticError(ErrorCode.PARAM_MISSING_TOKEN, param.nameNode, chain, hints);
|
|
1305
1212
|
}
|
|
1306
|
-
function toR3Reference(valueRef, typeRef, valueContext, typeContext, refEmitter) {
|
|
1213
|
+
function toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, refEmitter) {
|
|
1214
|
+
const emittedValueRef = refEmitter.emit(valueRef, valueContext);
|
|
1215
|
+
assertSuccessfulReferenceEmit(emittedValueRef, origin, "class");
|
|
1216
|
+
const emittedTypeRef = refEmitter.emit(typeRef, typeContext, ImportFlags.ForceNewImport | ImportFlags.AllowTypeImports);
|
|
1217
|
+
assertSuccessfulReferenceEmit(emittedTypeRef, origin, "class");
|
|
1307
1218
|
return {
|
|
1308
|
-
value:
|
|
1309
|
-
type:
|
|
1219
|
+
value: emittedValueRef.expression,
|
|
1220
|
+
type: emittedTypeRef.expression
|
|
1310
1221
|
};
|
|
1311
1222
|
}
|
|
1312
1223
|
function isAngularCore(decorator) {
|
|
@@ -1327,23 +1238,23 @@ function isAngularDecorator(decorator, name, isCore) {
|
|
|
1327
1238
|
return false;
|
|
1328
1239
|
}
|
|
1329
1240
|
function unwrapExpression(node) {
|
|
1330
|
-
while (
|
|
1241
|
+
while (ts3.isAsExpression(node) || ts3.isParenthesizedExpression(node)) {
|
|
1331
1242
|
node = node.expression;
|
|
1332
1243
|
}
|
|
1333
1244
|
return node;
|
|
1334
1245
|
}
|
|
1335
1246
|
function expandForwardRef(arg) {
|
|
1336
1247
|
arg = unwrapExpression(arg);
|
|
1337
|
-
if (!
|
|
1248
|
+
if (!ts3.isArrowFunction(arg) && !ts3.isFunctionExpression(arg)) {
|
|
1338
1249
|
return null;
|
|
1339
1250
|
}
|
|
1340
1251
|
const body = arg.body;
|
|
1341
|
-
if (
|
|
1252
|
+
if (ts3.isBlock(body)) {
|
|
1342
1253
|
if (body.statements.length !== 1) {
|
|
1343
1254
|
return null;
|
|
1344
1255
|
}
|
|
1345
1256
|
const stmt = body.statements[0];
|
|
1346
|
-
if (!
|
|
1257
|
+
if (!ts3.isReturnStatement(stmt) || stmt.expression === void 0) {
|
|
1347
1258
|
return null;
|
|
1348
1259
|
}
|
|
1349
1260
|
return stmt.expression;
|
|
@@ -1353,11 +1264,11 @@ function expandForwardRef(arg) {
|
|
|
1353
1264
|
}
|
|
1354
1265
|
function tryUnwrapForwardRef(node, reflector) {
|
|
1355
1266
|
node = unwrapExpression(node);
|
|
1356
|
-
if (!
|
|
1267
|
+
if (!ts3.isCallExpression(node) || node.arguments.length !== 1) {
|
|
1357
1268
|
return null;
|
|
1358
1269
|
}
|
|
1359
|
-
const fn =
|
|
1360
|
-
if (!
|
|
1270
|
+
const fn = ts3.isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression;
|
|
1271
|
+
if (!ts3.isIdentifier(fn)) {
|
|
1361
1272
|
return null;
|
|
1362
1273
|
}
|
|
1363
1274
|
const expr = expandForwardRef(node.arguments[0]);
|
|
@@ -1389,7 +1300,7 @@ function combineResolvers(resolvers) {
|
|
|
1389
1300
|
}
|
|
1390
1301
|
function isExpressionForwardReference(expr, context, contextSource) {
|
|
1391
1302
|
if (isWrappedTsNodeExpr(expr)) {
|
|
1392
|
-
const node =
|
|
1303
|
+
const node = ts3.getOriginalNode(expr.node);
|
|
1393
1304
|
return node.getSourceFile() === contextSource && context.pos < node.pos;
|
|
1394
1305
|
} else {
|
|
1395
1306
|
return false;
|
|
@@ -1412,16 +1323,16 @@ function readBaseClass(node, reflector, evaluator) {
|
|
|
1412
1323
|
}
|
|
1413
1324
|
var parensWrapperTransformerFactory = (context) => {
|
|
1414
1325
|
const visitor = (node) => {
|
|
1415
|
-
const visited =
|
|
1416
|
-
if (
|
|
1417
|
-
return
|
|
1326
|
+
const visited = ts3.visitEachChild(node, visitor, context);
|
|
1327
|
+
if (ts3.isArrowFunction(visited) || ts3.isFunctionExpression(visited)) {
|
|
1328
|
+
return ts3.createParen(visited);
|
|
1418
1329
|
}
|
|
1419
1330
|
return visited;
|
|
1420
1331
|
};
|
|
1421
|
-
return (node) =>
|
|
1332
|
+
return (node) => ts3.visitEachChild(node, visitor, context);
|
|
1422
1333
|
};
|
|
1423
1334
|
function wrapFunctionExpressionsInParens(expression) {
|
|
1424
|
-
return
|
|
1335
|
+
return ts3.transform(expression, [parensWrapperTransformerFactory]).transformed[0];
|
|
1425
1336
|
}
|
|
1426
1337
|
function makeDuplicateDeclarationError(node, data, kind) {
|
|
1427
1338
|
const context = [];
|
|
@@ -1435,7 +1346,7 @@ function makeDuplicateDeclarationError(node, data, kind) {
|
|
|
1435
1346
|
return makeDiagnostic(ErrorCode.NGMODULE_DECLARATION_NOT_UNIQUE, node.name, `The ${kind} '${node.name.text}' is declared by more than one NgModule.`, context);
|
|
1436
1347
|
}
|
|
1437
1348
|
function resolveProvidersRequiringFactory(rawProviders, reflector, evaluator) {
|
|
1438
|
-
const providers = new Set();
|
|
1349
|
+
const providers = /* @__PURE__ */ new Set();
|
|
1439
1350
|
const resolvedProviders = evaluator.evaluate(rawProviders);
|
|
1440
1351
|
if (!Array.isArray(resolvedProviders)) {
|
|
1441
1352
|
return providers;
|
|
@@ -1503,10 +1414,10 @@ function toFactoryMetadata(meta, target) {
|
|
|
1503
1414
|
|
|
1504
1415
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
1505
1416
|
import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DomElementSchemaRegistry, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget3, InterpolationConfig, makeBindingParser as makeBindingParser2, ParseSourceFile as ParseSourceFile2, parseTemplate, R3TargetBinder, SelectorMatcher, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
1506
|
-
import
|
|
1417
|
+
import ts18 from "typescript";
|
|
1507
1418
|
|
|
1508
1419
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
1509
|
-
import
|
|
1420
|
+
import ts4 from "typescript";
|
|
1510
1421
|
var SemanticSymbol = class {
|
|
1511
1422
|
constructor(decl) {
|
|
1512
1423
|
this.decl = decl;
|
|
@@ -1515,7 +1426,7 @@ var SemanticSymbol = class {
|
|
|
1515
1426
|
}
|
|
1516
1427
|
};
|
|
1517
1428
|
function getSymbolIdentifier(decl) {
|
|
1518
|
-
if (!
|
|
1429
|
+
if (!ts4.isSourceFile(decl.parent)) {
|
|
1519
1430
|
return null;
|
|
1520
1431
|
}
|
|
1521
1432
|
return decl.name.text;
|
|
@@ -1533,14 +1444,14 @@ var OpaqueSymbol = class extends SemanticSymbol {
|
|
|
1533
1444
|
};
|
|
1534
1445
|
var SemanticDepGraph = class {
|
|
1535
1446
|
constructor() {
|
|
1536
|
-
this.files = new Map();
|
|
1537
|
-
this.symbolByDecl = new Map();
|
|
1447
|
+
this.files = /* @__PURE__ */ new Map();
|
|
1448
|
+
this.symbolByDecl = /* @__PURE__ */ new Map();
|
|
1538
1449
|
}
|
|
1539
1450
|
registerSymbol(symbol) {
|
|
1540
1451
|
this.symbolByDecl.set(symbol.decl, symbol);
|
|
1541
1452
|
if (symbol.identifier !== null) {
|
|
1542
1453
|
if (!this.files.has(symbol.path)) {
|
|
1543
|
-
this.files.set(symbol.path, new Map());
|
|
1454
|
+
this.files.set(symbol.path, /* @__PURE__ */ new Map());
|
|
1544
1455
|
}
|
|
1545
1456
|
this.files.get(symbol.path).set(symbol.identifier, symbol);
|
|
1546
1457
|
}
|
|
@@ -1573,7 +1484,7 @@ var SemanticDepGraphUpdater = class {
|
|
|
1573
1484
|
constructor(priorGraph) {
|
|
1574
1485
|
this.priorGraph = priorGraph;
|
|
1575
1486
|
this.newGraph = new SemanticDepGraph();
|
|
1576
|
-
this.opaqueSymbols = new Map();
|
|
1487
|
+
this.opaqueSymbols = /* @__PURE__ */ new Map();
|
|
1577
1488
|
}
|
|
1578
1489
|
registerSymbol(symbol) {
|
|
1579
1490
|
this.newGraph.registerSymbol(symbol);
|
|
@@ -1581,8 +1492,8 @@ var SemanticDepGraphUpdater = class {
|
|
|
1581
1492
|
finalize() {
|
|
1582
1493
|
if (this.priorGraph === null) {
|
|
1583
1494
|
return {
|
|
1584
|
-
needsEmit: new Set(),
|
|
1585
|
-
needsTypeCheckEmit: new Set(),
|
|
1495
|
+
needsEmit: /* @__PURE__ */ new Set(),
|
|
1496
|
+
needsTypeCheckEmit: /* @__PURE__ */ new Set(),
|
|
1586
1497
|
newGraph: this.newGraph
|
|
1587
1498
|
};
|
|
1588
1499
|
}
|
|
@@ -1595,14 +1506,14 @@ var SemanticDepGraphUpdater = class {
|
|
|
1595
1506
|
};
|
|
1596
1507
|
}
|
|
1597
1508
|
determineInvalidatedFiles(priorGraph) {
|
|
1598
|
-
const isPublicApiAffected = new Set();
|
|
1509
|
+
const isPublicApiAffected = /* @__PURE__ */ new Set();
|
|
1599
1510
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1600
1511
|
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1601
1512
|
if (previousSymbol === null || symbol.isPublicApiAffected(previousSymbol)) {
|
|
1602
1513
|
isPublicApiAffected.add(symbol);
|
|
1603
1514
|
}
|
|
1604
1515
|
}
|
|
1605
|
-
const needsEmit = new Set();
|
|
1516
|
+
const needsEmit = /* @__PURE__ */ new Set();
|
|
1606
1517
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1607
1518
|
if (symbol.isEmitAffected === void 0) {
|
|
1608
1519
|
continue;
|
|
@@ -1615,14 +1526,14 @@ var SemanticDepGraphUpdater = class {
|
|
|
1615
1526
|
return needsEmit;
|
|
1616
1527
|
}
|
|
1617
1528
|
determineInvalidatedTypeCheckFiles(priorGraph) {
|
|
1618
|
-
const isTypeCheckApiAffected = new Set();
|
|
1529
|
+
const isTypeCheckApiAffected = /* @__PURE__ */ new Set();
|
|
1619
1530
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1620
1531
|
const previousSymbol = priorGraph.getEquivalentSymbol(symbol);
|
|
1621
1532
|
if (previousSymbol === null || symbol.isTypeCheckApiAffected(previousSymbol)) {
|
|
1622
1533
|
isTypeCheckApiAffected.add(symbol);
|
|
1623
1534
|
}
|
|
1624
1535
|
}
|
|
1625
|
-
const needsTypeCheckEmit = new Set();
|
|
1536
|
+
const needsTypeCheckEmit = /* @__PURE__ */ new Set();
|
|
1626
1537
|
for (const symbol of this.newGraph.symbolByDecl.values()) {
|
|
1627
1538
|
if (symbol.isTypeCheckBlockAffected === void 0) {
|
|
1628
1539
|
continue;
|
|
@@ -1665,7 +1576,7 @@ function getImportPath(expr) {
|
|
|
1665
1576
|
}
|
|
1666
1577
|
|
|
1667
1578
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1668
|
-
import
|
|
1579
|
+
import ts5 from "typescript";
|
|
1669
1580
|
|
|
1670
1581
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
1671
1582
|
function isSymbolEqual(a, b) {
|
|
@@ -1719,7 +1630,7 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
1719
1630
|
|
|
1720
1631
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1721
1632
|
function extractSemanticTypeParameters(node) {
|
|
1722
|
-
if (!
|
|
1633
|
+
if (!ts5.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
1723
1634
|
return null;
|
|
1724
1635
|
}
|
|
1725
1636
|
return node.typeParameters.map((typeParam) => ({ hasGenericTypeBound: typeParam.constraint !== void 0 }));
|
|
@@ -1745,7 +1656,7 @@ var MetaType;
|
|
|
1745
1656
|
})(MetaType || (MetaType = {}));
|
|
1746
1657
|
|
|
1747
1658
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1748
|
-
import
|
|
1659
|
+
import ts7 from "typescript";
|
|
1749
1660
|
|
|
1750
1661
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1751
1662
|
var ClassPropertyMapping = class {
|
|
@@ -1754,10 +1665,10 @@ var ClassPropertyMapping = class {
|
|
|
1754
1665
|
this.reverseMap = reverseMapFromForwardMap(forwardMap);
|
|
1755
1666
|
}
|
|
1756
1667
|
static empty() {
|
|
1757
|
-
return new ClassPropertyMapping(new Map());
|
|
1668
|
+
return new ClassPropertyMapping(/* @__PURE__ */ new Map());
|
|
1758
1669
|
}
|
|
1759
1670
|
static fromMappedObject(obj) {
|
|
1760
|
-
const forwardMap = new Map();
|
|
1671
|
+
const forwardMap = /* @__PURE__ */ new Map();
|
|
1761
1672
|
for (const classPropertyName of Object.keys(obj)) {
|
|
1762
1673
|
const value = obj[classPropertyName];
|
|
1763
1674
|
const bindingPropertyName = Array.isArray(value) ? value[0] : value;
|
|
@@ -1813,7 +1724,7 @@ var ClassPropertyMapping = class {
|
|
|
1813
1724
|
}
|
|
1814
1725
|
};
|
|
1815
1726
|
function reverseMapFromForwardMap(forwardMap) {
|
|
1816
|
-
const reverseMap = new Map();
|
|
1727
|
+
const reverseMap = /* @__PURE__ */ new Map();
|
|
1817
1728
|
for (const [_, inputOrOutput] of forwardMap) {
|
|
1818
1729
|
if (!reverseMap.has(inputOrOutput.bindingPropertyName)) {
|
|
1819
1730
|
reverseMap.set(inputOrOutput.bindingPropertyName, []);
|
|
@@ -1824,13 +1735,13 @@ function reverseMapFromForwardMap(forwardMap) {
|
|
|
1824
1735
|
}
|
|
1825
1736
|
|
|
1826
1737
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
1827
|
-
import
|
|
1738
|
+
import ts6 from "typescript";
|
|
1828
1739
|
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
1829
|
-
if (!
|
|
1740
|
+
if (!ts6.isTupleTypeNode(def)) {
|
|
1830
1741
|
return [];
|
|
1831
1742
|
}
|
|
1832
1743
|
return def.elements.map((element) => {
|
|
1833
|
-
if (!
|
|
1744
|
+
if (!ts6.isTypeQueryNode(element)) {
|
|
1834
1745
|
throw new Error(`Expected TypeQueryNode: ${nodeDebugInfo(element)}`);
|
|
1835
1746
|
}
|
|
1836
1747
|
const type = element.exprName;
|
|
@@ -1846,18 +1757,18 @@ function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
|
1846
1757
|
});
|
|
1847
1758
|
}
|
|
1848
1759
|
function readStringType(type) {
|
|
1849
|
-
if (!
|
|
1760
|
+
if (!ts6.isLiteralTypeNode(type) || !ts6.isStringLiteral(type.literal)) {
|
|
1850
1761
|
return null;
|
|
1851
1762
|
}
|
|
1852
1763
|
return type.literal.text;
|
|
1853
1764
|
}
|
|
1854
1765
|
function readStringMapType(type) {
|
|
1855
|
-
if (!
|
|
1766
|
+
if (!ts6.isTypeLiteralNode(type)) {
|
|
1856
1767
|
return {};
|
|
1857
1768
|
}
|
|
1858
1769
|
const obj = {};
|
|
1859
1770
|
type.members.forEach((member) => {
|
|
1860
|
-
if (!
|
|
1771
|
+
if (!ts6.isPropertySignature(member) || member.type === void 0 || member.name === void 0 || !ts6.isStringLiteral(member.name)) {
|
|
1861
1772
|
return;
|
|
1862
1773
|
}
|
|
1863
1774
|
const value = readStringType(member.type);
|
|
@@ -1869,12 +1780,12 @@ function readStringMapType(type) {
|
|
|
1869
1780
|
return obj;
|
|
1870
1781
|
}
|
|
1871
1782
|
function readStringArrayType(type) {
|
|
1872
|
-
if (!
|
|
1783
|
+
if (!ts6.isTupleTypeNode(type)) {
|
|
1873
1784
|
return [];
|
|
1874
1785
|
}
|
|
1875
1786
|
const res = [];
|
|
1876
1787
|
type.elements.forEach((el) => {
|
|
1877
|
-
if (!
|
|
1788
|
+
if (!ts6.isLiteralTypeNode(el) || !ts6.isStringLiteral(el.literal)) {
|
|
1878
1789
|
return;
|
|
1879
1790
|
}
|
|
1880
1791
|
res.push(el.literal.text);
|
|
@@ -1887,9 +1798,9 @@ function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
|
1887
1798
|
const ngTemplateGuards = staticMembers.map(extractTemplateGuard).filter((guard) => guard !== null);
|
|
1888
1799
|
const hasNgTemplateContextGuard = staticMembers.some((member) => member.kind === ClassMemberKind.Method && member.name === "ngTemplateContextGuard");
|
|
1889
1800
|
const coercedInputFields = new Set(staticMembers.map(extractCoercedInput).filter((inputName) => inputName !== null));
|
|
1890
|
-
const restrictedInputFields = new Set();
|
|
1891
|
-
const stringLiteralInputFields = new Set();
|
|
1892
|
-
const undeclaredInputFields = new Set();
|
|
1801
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
1802
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
1803
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
1893
1804
|
for (const classPropertyName of inputs.classPropertyNames) {
|
|
1894
1805
|
const field = members.find((member) => member.name === classPropertyName);
|
|
1895
1806
|
if (field === void 0 || field.node === null) {
|
|
@@ -1899,7 +1810,7 @@ function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
|
1899
1810
|
if (isRestricted(field.node)) {
|
|
1900
1811
|
restrictedInputFields.add(classPropertyName);
|
|
1901
1812
|
}
|
|
1902
|
-
if (field.nameNode !== null &&
|
|
1813
|
+
if (field.nameNode !== null && ts6.isStringLiteral(field.nameNode)) {
|
|
1903
1814
|
stringLiteralInputFields.add(classPropertyName);
|
|
1904
1815
|
}
|
|
1905
1816
|
}
|
|
@@ -1918,7 +1829,7 @@ function isRestricted(node) {
|
|
|
1918
1829
|
if (node.modifiers === void 0) {
|
|
1919
1830
|
return false;
|
|
1920
1831
|
}
|
|
1921
|
-
return node.modifiers.some((modifier) => modifier.kind ===
|
|
1832
|
+
return node.modifiers.some((modifier) => modifier.kind === ts6.SyntaxKind.PrivateKeyword || modifier.kind === ts6.SyntaxKind.ProtectedKeyword || modifier.kind === ts6.SyntaxKind.ReadonlyKeyword);
|
|
1922
1833
|
}
|
|
1923
1834
|
function extractTemplateGuard(member) {
|
|
1924
1835
|
if (!member.name.startsWith("ngTemplateGuard_")) {
|
|
@@ -1927,7 +1838,7 @@ function extractTemplateGuard(member) {
|
|
|
1927
1838
|
const inputName = afterUnderscore(member.name);
|
|
1928
1839
|
if (member.kind === ClassMemberKind.Property) {
|
|
1929
1840
|
let type = null;
|
|
1930
|
-
if (member.type !== null &&
|
|
1841
|
+
if (member.type !== null && ts6.isLiteralTypeNode(member.type) && ts6.isStringLiteral(member.type.literal)) {
|
|
1931
1842
|
type = member.type.literal.text;
|
|
1932
1843
|
}
|
|
1933
1844
|
if (type !== "binding") {
|
|
@@ -2001,7 +1912,7 @@ var DtsMetadataReader = class {
|
|
|
2001
1912
|
const ngModuleDef = this.reflector.getMembersOfClass(clazz).find((member) => member.name === "\u0275mod" && member.isStatic);
|
|
2002
1913
|
if (ngModuleDef === void 0) {
|
|
2003
1914
|
return null;
|
|
2004
|
-
} else if (ngModuleDef.type === null || !
|
|
1915
|
+
} else if (ngModuleDef.type === null || !ts7.isTypeReferenceNode(ngModuleDef.type) || ngModuleDef.type.typeArguments === void 0 || ngModuleDef.type.typeArguments.length !== 4) {
|
|
2005
1916
|
return null;
|
|
2006
1917
|
}
|
|
2007
1918
|
const [_, declarationMetadata, importMetadata, exportMetadata] = ngModuleDef.type.typeArguments;
|
|
@@ -2019,7 +1930,7 @@ var DtsMetadataReader = class {
|
|
|
2019
1930
|
const def = this.reflector.getMembersOfClass(clazz).find((field) => field.isStatic && (field.name === "\u0275cmp" || field.name === "\u0275dir"));
|
|
2020
1931
|
if (def === void 0) {
|
|
2021
1932
|
return null;
|
|
2022
|
-
} else if (def.type === null || !
|
|
1933
|
+
} else if (def.type === null || !ts7.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2023
1934
|
return null;
|
|
2024
1935
|
}
|
|
2025
1936
|
const isComponent = def.name === "\u0275cmp";
|
|
@@ -2049,11 +1960,11 @@ var DtsMetadataReader = class {
|
|
|
2049
1960
|
const def = this.reflector.getMembersOfClass(ref.node).find((field) => field.isStatic && field.name === "\u0275pipe");
|
|
2050
1961
|
if (def === void 0) {
|
|
2051
1962
|
return null;
|
|
2052
|
-
} else if (def.type === null || !
|
|
1963
|
+
} else if (def.type === null || !ts7.isTypeReferenceNode(def.type) || def.type.typeArguments === void 0 || def.type.typeArguments.length < 2) {
|
|
2053
1964
|
return null;
|
|
2054
1965
|
}
|
|
2055
1966
|
const type = def.type.typeArguments[1];
|
|
2056
|
-
if (!
|
|
1967
|
+
if (!ts7.isLiteralTypeNode(type) || !ts7.isStringLiteral(type.literal)) {
|
|
2057
1968
|
return null;
|
|
2058
1969
|
}
|
|
2059
1970
|
const name = type.literal.text;
|
|
@@ -2071,12 +1982,12 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2071
1982
|
}
|
|
2072
1983
|
if (clazz.heritageClauses !== void 0) {
|
|
2073
1984
|
for (const clause of clazz.heritageClauses) {
|
|
2074
|
-
if (clause.token ===
|
|
1985
|
+
if (clause.token === ts7.SyntaxKind.ExtendsKeyword) {
|
|
2075
1986
|
const baseExpr = clause.types[0].expression;
|
|
2076
1987
|
let symbol = checker.getSymbolAtLocation(baseExpr);
|
|
2077
1988
|
if (symbol === void 0) {
|
|
2078
1989
|
return "dynamic";
|
|
2079
|
-
} else if (symbol.flags &
|
|
1990
|
+
} else if (symbol.flags & ts7.SymbolFlags.Alias) {
|
|
2080
1991
|
symbol = checker.getAliasedSymbol(symbol);
|
|
2081
1992
|
}
|
|
2082
1993
|
if (symbol.valueDeclaration !== void 0 && isNamedClassDeclaration(symbol.valueDeclaration)) {
|
|
@@ -2099,10 +2010,10 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2099
2010
|
if (topMeta.baseClass === null) {
|
|
2100
2011
|
return topMeta;
|
|
2101
2012
|
}
|
|
2102
|
-
const coercedInputFields = new Set();
|
|
2103
|
-
const undeclaredInputFields = new Set();
|
|
2104
|
-
const restrictedInputFields = new Set();
|
|
2105
|
-
const stringLiteralInputFields = new Set();
|
|
2013
|
+
const coercedInputFields = /* @__PURE__ */ new Set();
|
|
2014
|
+
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
2015
|
+
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
2016
|
+
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
2106
2017
|
let isDynamic = false;
|
|
2107
2018
|
let inputs = ClassPropertyMapping.empty();
|
|
2108
2019
|
let outputs = ClassPropertyMapping.empty();
|
|
@@ -2150,9 +2061,9 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2150
2061
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2151
2062
|
var LocalMetadataRegistry = class {
|
|
2152
2063
|
constructor() {
|
|
2153
|
-
this.directives = new Map();
|
|
2154
|
-
this.ngModules = new Map();
|
|
2155
|
-
this.pipes = new Map();
|
|
2064
|
+
this.directives = /* @__PURE__ */ new Map();
|
|
2065
|
+
this.ngModules = /* @__PURE__ */ new Map();
|
|
2066
|
+
this.pipes = /* @__PURE__ */ new Map();
|
|
2156
2067
|
}
|
|
2157
2068
|
getDirectiveMetadata(ref) {
|
|
2158
2069
|
return this.directives.has(ref.node) ? this.directives.get(ref.node) : null;
|
|
@@ -2196,7 +2107,7 @@ var CompoundMetadataRegistry = class {
|
|
|
2196
2107
|
var InjectableClassRegistry = class {
|
|
2197
2108
|
constructor(host) {
|
|
2198
2109
|
this.host = host;
|
|
2199
|
-
this.classes = new Set();
|
|
2110
|
+
this.classes = /* @__PURE__ */ new Set();
|
|
2200
2111
|
}
|
|
2201
2112
|
registerInjectable(declaration) {
|
|
2202
2113
|
this.classes.add(declaration);
|
|
@@ -2209,14 +2120,14 @@ var InjectableClassRegistry = class {
|
|
|
2209
2120
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2210
2121
|
var ResourceRegistry = class {
|
|
2211
2122
|
constructor() {
|
|
2212
|
-
this.externalTemplateToComponentsMap = new Map();
|
|
2213
|
-
this.componentToTemplateMap = new Map();
|
|
2214
|
-
this.componentToStylesMap = new Map();
|
|
2215
|
-
this.externalStyleToComponentsMap = new Map();
|
|
2123
|
+
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
2124
|
+
this.componentToTemplateMap = /* @__PURE__ */ new Map();
|
|
2125
|
+
this.componentToStylesMap = /* @__PURE__ */ new Map();
|
|
2126
|
+
this.externalStyleToComponentsMap = /* @__PURE__ */ new Map();
|
|
2216
2127
|
}
|
|
2217
2128
|
getComponentsWithTemplate(template) {
|
|
2218
2129
|
if (!this.externalTemplateToComponentsMap.has(template)) {
|
|
2219
|
-
return new Set();
|
|
2130
|
+
return /* @__PURE__ */ new Set();
|
|
2220
2131
|
}
|
|
2221
2132
|
return this.externalTemplateToComponentsMap.get(template);
|
|
2222
2133
|
}
|
|
@@ -2232,7 +2143,7 @@ var ResourceRegistry = class {
|
|
|
2232
2143
|
const { path } = templateResource;
|
|
2233
2144
|
if (path !== null) {
|
|
2234
2145
|
if (!this.externalTemplateToComponentsMap.has(path)) {
|
|
2235
|
-
this.externalTemplateToComponentsMap.set(path, new Set());
|
|
2146
|
+
this.externalTemplateToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2236
2147
|
}
|
|
2237
2148
|
this.externalTemplateToComponentsMap.get(path).add(component);
|
|
2238
2149
|
}
|
|
@@ -2247,11 +2158,11 @@ var ResourceRegistry = class {
|
|
|
2247
2158
|
registerStyle(styleResource, component) {
|
|
2248
2159
|
const { path } = styleResource;
|
|
2249
2160
|
if (!this.componentToStylesMap.has(component)) {
|
|
2250
|
-
this.componentToStylesMap.set(component, new Set());
|
|
2161
|
+
this.componentToStylesMap.set(component, /* @__PURE__ */ new Set());
|
|
2251
2162
|
}
|
|
2252
2163
|
if (path !== null) {
|
|
2253
2164
|
if (!this.externalStyleToComponentsMap.has(path)) {
|
|
2254
|
-
this.externalStyleToComponentsMap.set(path, new Set());
|
|
2165
|
+
this.externalStyleToComponentsMap.set(path, /* @__PURE__ */ new Set());
|
|
2255
2166
|
}
|
|
2256
2167
|
this.externalStyleToComponentsMap.get(path).add(component);
|
|
2257
2168
|
}
|
|
@@ -2259,13 +2170,13 @@ var ResourceRegistry = class {
|
|
|
2259
2170
|
}
|
|
2260
2171
|
getStyles(component) {
|
|
2261
2172
|
if (!this.componentToStylesMap.has(component)) {
|
|
2262
|
-
return new Set();
|
|
2173
|
+
return /* @__PURE__ */ new Set();
|
|
2263
2174
|
}
|
|
2264
2175
|
return this.componentToStylesMap.get(component);
|
|
2265
2176
|
}
|
|
2266
2177
|
getComponentsWithStyle(styleUrl) {
|
|
2267
2178
|
if (!this.externalStyleToComponentsMap.has(styleUrl)) {
|
|
2268
|
-
return new Set();
|
|
2179
|
+
return /* @__PURE__ */ new Set();
|
|
2269
2180
|
}
|
|
2270
2181
|
return this.externalStyleToComponentsMap.get(styleUrl);
|
|
2271
2182
|
}
|
|
@@ -2290,25 +2201,25 @@ var HandlerFlags;
|
|
|
2290
2201
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
2291
2202
|
|
|
2292
2203
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
2293
|
-
import
|
|
2204
|
+
import ts8 from "typescript";
|
|
2294
2205
|
function aliasTransformFactory(exportStatements) {
|
|
2295
2206
|
return (context) => {
|
|
2296
2207
|
return (file) => {
|
|
2297
|
-
if (
|
|
2208
|
+
if (ts8.isBundle(file) || !exportStatements.has(file.fileName)) {
|
|
2298
2209
|
return file;
|
|
2299
2210
|
}
|
|
2300
2211
|
const statements = [...file.statements];
|
|
2301
2212
|
exportStatements.get(file.fileName).forEach(([moduleName, symbolName], aliasName) => {
|
|
2302
|
-
const stmt =
|
|
2213
|
+
const stmt = ts8.createExportDeclaration(void 0, void 0, ts8.createNamedExports([createExportSpecifier(symbolName, aliasName)]), ts8.createStringLiteral(moduleName));
|
|
2303
2214
|
statements.push(stmt);
|
|
2304
2215
|
});
|
|
2305
|
-
return
|
|
2216
|
+
return ts8.updateSourceFileNode(file, statements);
|
|
2306
2217
|
};
|
|
2307
2218
|
};
|
|
2308
2219
|
}
|
|
2309
2220
|
|
|
2310
2221
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
2311
|
-
import
|
|
2222
|
+
import ts9 from "typescript";
|
|
2312
2223
|
|
|
2313
2224
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
2314
2225
|
var TraitState;
|
|
@@ -2376,11 +2287,11 @@ var TraitCompiler = class {
|
|
|
2376
2287
|
this.compilationMode = compilationMode;
|
|
2377
2288
|
this.dtsTransforms = dtsTransforms;
|
|
2378
2289
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
2379
|
-
this.classes = new Map();
|
|
2380
|
-
this.fileToClasses = new Map();
|
|
2381
|
-
this.filesWithoutTraits = new Set();
|
|
2382
|
-
this.reexportMap = new Map();
|
|
2383
|
-
this.handlersByName = new Map();
|
|
2290
|
+
this.classes = /* @__PURE__ */ new Map();
|
|
2291
|
+
this.fileToClasses = /* @__PURE__ */ new Map();
|
|
2292
|
+
this.filesWithoutTraits = /* @__PURE__ */ new Set();
|
|
2293
|
+
this.reexportMap = /* @__PURE__ */ new Map();
|
|
2294
|
+
this.handlersByName = /* @__PURE__ */ new Map();
|
|
2384
2295
|
for (const handler of handlers) {
|
|
2385
2296
|
this.handlersByName.set(handler.name, handler);
|
|
2386
2297
|
}
|
|
@@ -2413,7 +2324,7 @@ var TraitCompiler = class {
|
|
|
2413
2324
|
if (this.reflector.isClass(node)) {
|
|
2414
2325
|
this.analyzeClass(node, preanalyze ? promises : null);
|
|
2415
2326
|
}
|
|
2416
|
-
|
|
2327
|
+
ts9.forEachChild(node, visit2);
|
|
2417
2328
|
};
|
|
2418
2329
|
visit2(sf);
|
|
2419
2330
|
if (preanalyze && promises.length > 0) {
|
|
@@ -2440,7 +2351,7 @@ var TraitCompiler = class {
|
|
|
2440
2351
|
return records;
|
|
2441
2352
|
}
|
|
2442
2353
|
getAnalyzedRecords() {
|
|
2443
|
-
const result = new Map();
|
|
2354
|
+
const result = /* @__PURE__ */ new Map();
|
|
2444
2355
|
for (const [sf, classes] of this.fileToClasses) {
|
|
2445
2356
|
const records = [];
|
|
2446
2357
|
for (const clazz of classes) {
|
|
@@ -2478,7 +2389,7 @@ var TraitCompiler = class {
|
|
|
2478
2389
|
this.classes.set(record.node, record);
|
|
2479
2390
|
const sf = record.node.getSourceFile();
|
|
2480
2391
|
if (!this.fileToClasses.has(sf)) {
|
|
2481
|
-
this.fileToClasses.set(sf, new Set());
|
|
2392
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2482
2393
|
}
|
|
2483
2394
|
this.fileToClasses.get(sf).add(record.node);
|
|
2484
2395
|
}
|
|
@@ -2512,7 +2423,7 @@ var TraitCompiler = class {
|
|
|
2512
2423
|
this.classes.set(clazz, record);
|
|
2513
2424
|
const sf = clazz.getSourceFile();
|
|
2514
2425
|
if (!this.fileToClasses.has(sf)) {
|
|
2515
|
-
this.fileToClasses.set(sf, new Set());
|
|
2426
|
+
this.fileToClasses.set(sf, /* @__PURE__ */ new Set());
|
|
2516
2427
|
}
|
|
2517
2428
|
this.fileToClasses.get(sf).add(clazz);
|
|
2518
2429
|
} else {
|
|
@@ -2524,7 +2435,7 @@ var TraitCompiler = class {
|
|
|
2524
2435
|
}
|
|
2525
2436
|
if (isPrimaryHandler && record.hasPrimaryHandler) {
|
|
2526
2437
|
record.metaDiagnostics = [{
|
|
2527
|
-
category:
|
|
2438
|
+
category: ts9.DiagnosticCategory.Error,
|
|
2528
2439
|
code: Number("-99" + ErrorCode.DECORATOR_COLLISION),
|
|
2529
2440
|
file: getSourceFile(clazz),
|
|
2530
2441
|
start: clazz.getStart(void 0, false),
|
|
@@ -2641,7 +2552,7 @@ var TraitCompiler = class {
|
|
|
2641
2552
|
if (result.reexports !== void 0) {
|
|
2642
2553
|
const fileName = clazz.getSourceFile().fileName;
|
|
2643
2554
|
if (!this.reexportMap.has(fileName)) {
|
|
2644
|
-
this.reexportMap.set(fileName, new Map());
|
|
2555
|
+
this.reexportMap.set(fileName, /* @__PURE__ */ new Map());
|
|
2645
2556
|
}
|
|
2646
2557
|
const fileReexports = this.reexportMap.get(fileName);
|
|
2647
2558
|
for (const reexport of result.reexports) {
|
|
@@ -2732,7 +2643,7 @@ var TraitCompiler = class {
|
|
|
2732
2643
|
}
|
|
2733
2644
|
}
|
|
2734
2645
|
compile(clazz, constantPool) {
|
|
2735
|
-
const original =
|
|
2646
|
+
const original = ts9.getOriginalNode(clazz);
|
|
2736
2647
|
if (!this.reflector.isClass(clazz) || !this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2737
2648
|
return null;
|
|
2738
2649
|
}
|
|
@@ -2763,7 +2674,7 @@ var TraitCompiler = class {
|
|
|
2763
2674
|
return res.length > 0 ? res : null;
|
|
2764
2675
|
}
|
|
2765
2676
|
decoratorsFor(node) {
|
|
2766
|
-
const original =
|
|
2677
|
+
const original = ts9.getOriginalNode(node);
|
|
2767
2678
|
if (!this.reflector.isClass(original) || !this.classes.has(original)) {
|
|
2768
2679
|
return [];
|
|
2769
2680
|
}
|
|
@@ -2773,7 +2684,7 @@ var TraitCompiler = class {
|
|
|
2773
2684
|
if (trait.state !== TraitState.Resolved) {
|
|
2774
2685
|
continue;
|
|
2775
2686
|
}
|
|
2776
|
-
if (trait.detected.trigger !== null &&
|
|
2687
|
+
if (trait.detected.trigger !== null && ts9.isDecorator(trait.detected.trigger)) {
|
|
2777
2688
|
decorators.push(trait.detected.trigger);
|
|
2778
2689
|
}
|
|
2779
2690
|
}
|
|
@@ -2803,23 +2714,23 @@ var TraitCompiler = class {
|
|
|
2803
2714
|
};
|
|
2804
2715
|
|
|
2805
2716
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2806
|
-
import
|
|
2717
|
+
import ts11 from "typescript";
|
|
2807
2718
|
|
|
2808
2719
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
2809
|
-
import
|
|
2720
|
+
import ts10 from "typescript";
|
|
2810
2721
|
function addImports(importManager, sf, extraStatements = []) {
|
|
2811
2722
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
2812
|
-
const qualifier =
|
|
2813
|
-
const importClause =
|
|
2814
|
-
const decl =
|
|
2815
|
-
|
|
2723
|
+
const qualifier = ts10.createIdentifier(i.qualifier.text);
|
|
2724
|
+
const importClause = ts10.createImportClause(void 0, ts10.createNamespaceImport(qualifier));
|
|
2725
|
+
const decl = ts10.createImportDeclaration(void 0, void 0, importClause, ts10.createLiteral(i.specifier));
|
|
2726
|
+
ts10.setOriginalNode(i.qualifier, decl);
|
|
2816
2727
|
return decl;
|
|
2817
2728
|
});
|
|
2818
2729
|
const existingImports = sf.statements.filter((stmt) => isImportStatement(stmt));
|
|
2819
2730
|
const body = sf.statements.filter((stmt) => !isImportStatement(stmt));
|
|
2820
2731
|
if (addedImports.length > 0) {
|
|
2821
|
-
const fileoverviewAnchorStmt =
|
|
2822
|
-
return
|
|
2732
|
+
const fileoverviewAnchorStmt = ts10.createNotEmittedStatement(sf);
|
|
2733
|
+
return ts10.updateSourceFileNode(sf, ts10.createNodeArray([
|
|
2823
2734
|
fileoverviewAnchorStmt,
|
|
2824
2735
|
...existingImports,
|
|
2825
2736
|
...addedImports,
|
|
@@ -2830,13 +2741,13 @@ function addImports(importManager, sf, extraStatements = []) {
|
|
|
2830
2741
|
return sf;
|
|
2831
2742
|
}
|
|
2832
2743
|
function isImportStatement(stmt) {
|
|
2833
|
-
return
|
|
2744
|
+
return ts10.isImportDeclaration(stmt) || ts10.isImportEqualsDeclaration(stmt) || ts10.isNamespaceImport(stmt);
|
|
2834
2745
|
}
|
|
2835
2746
|
|
|
2836
2747
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
2837
2748
|
var DtsTransformRegistry = class {
|
|
2838
2749
|
constructor() {
|
|
2839
|
-
this.ivyDeclarationTransforms = new Map();
|
|
2750
|
+
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
2840
2751
|
}
|
|
2841
2752
|
getIvyDeclarationTransform(sf) {
|
|
2842
2753
|
if (!this.ivyDeclarationTransforms.has(sf)) {
|
|
@@ -2848,7 +2759,7 @@ var DtsTransformRegistry = class {
|
|
|
2848
2759
|
if (!sf.isDeclarationFile) {
|
|
2849
2760
|
return null;
|
|
2850
2761
|
}
|
|
2851
|
-
const originalSf =
|
|
2762
|
+
const originalSf = ts11.getOriginalNode(sf);
|
|
2852
2763
|
let transforms = null;
|
|
2853
2764
|
if (this.ivyDeclarationTransforms.has(originalSf)) {
|
|
2854
2765
|
transforms = [];
|
|
@@ -2861,7 +2772,7 @@ function declarationTransformFactory(transformRegistry, importRewriter, importPr
|
|
|
2861
2772
|
return (context) => {
|
|
2862
2773
|
const transformer = new DtsTransformer(context, importRewriter, importPrefix);
|
|
2863
2774
|
return (fileOrBundle) => {
|
|
2864
|
-
if (
|
|
2775
|
+
if (ts11.isBundle(fileOrBundle)) {
|
|
2865
2776
|
return fileOrBundle;
|
|
2866
2777
|
}
|
|
2867
2778
|
const transforms = transformRegistry.getAllTransforms(fileOrBundle);
|
|
@@ -2881,15 +2792,15 @@ var DtsTransformer = class {
|
|
|
2881
2792
|
transform(sf, transforms) {
|
|
2882
2793
|
const imports = new ImportManager(this.importRewriter, this.importPrefix);
|
|
2883
2794
|
const visitor = (node) => {
|
|
2884
|
-
if (
|
|
2795
|
+
if (ts11.isClassDeclaration(node)) {
|
|
2885
2796
|
return this.transformClassDeclaration(node, transforms, imports);
|
|
2886
|
-
} else if (
|
|
2797
|
+
} else if (ts11.isFunctionDeclaration(node)) {
|
|
2887
2798
|
return this.transformFunctionDeclaration(node, transforms, imports);
|
|
2888
2799
|
} else {
|
|
2889
|
-
return
|
|
2800
|
+
return ts11.visitEachChild(node, visitor, this.ctx);
|
|
2890
2801
|
}
|
|
2891
2802
|
};
|
|
2892
|
-
sf =
|
|
2803
|
+
sf = ts11.visitNode(sf, visitor);
|
|
2893
2804
|
return addImports(imports, sf);
|
|
2894
2805
|
}
|
|
2895
2806
|
transformClassDeclaration(clazz, transforms, imports) {
|
|
@@ -2917,7 +2828,7 @@ var DtsTransformer = class {
|
|
|
2917
2828
|
}
|
|
2918
2829
|
}
|
|
2919
2830
|
if (elementsChanged && clazz === newClazz) {
|
|
2920
|
-
newClazz =
|
|
2831
|
+
newClazz = ts11.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, elements);
|
|
2921
2832
|
}
|
|
2922
2833
|
return newClazz;
|
|
2923
2834
|
}
|
|
@@ -2933,44 +2844,44 @@ var DtsTransformer = class {
|
|
|
2933
2844
|
};
|
|
2934
2845
|
var IvyDeclarationDtsTransform = class {
|
|
2935
2846
|
constructor() {
|
|
2936
|
-
this.declarationFields = new Map();
|
|
2847
|
+
this.declarationFields = /* @__PURE__ */ new Map();
|
|
2937
2848
|
}
|
|
2938
2849
|
addFields(decl, fields) {
|
|
2939
2850
|
this.declarationFields.set(decl, fields);
|
|
2940
2851
|
}
|
|
2941
2852
|
transformClass(clazz, members, imports) {
|
|
2942
|
-
const original =
|
|
2853
|
+
const original = ts11.getOriginalNode(clazz);
|
|
2943
2854
|
if (!this.declarationFields.has(original)) {
|
|
2944
2855
|
return clazz;
|
|
2945
2856
|
}
|
|
2946
2857
|
const fields = this.declarationFields.get(original);
|
|
2947
2858
|
const newMembers = fields.map((decl) => {
|
|
2948
|
-
const modifiers = [
|
|
2859
|
+
const modifiers = [ts11.createModifier(ts11.SyntaxKind.StaticKeyword)];
|
|
2949
2860
|
const typeRef = translateType(decl.type, imports);
|
|
2950
2861
|
markForEmitAsSingleLine(typeRef);
|
|
2951
|
-
return
|
|
2862
|
+
return ts11.createProperty(void 0, modifiers, decl.name, void 0, typeRef, void 0);
|
|
2952
2863
|
});
|
|
2953
|
-
return
|
|
2864
|
+
return ts11.updateClassDeclaration(clazz, clazz.decorators, clazz.modifiers, clazz.name, clazz.typeParameters, clazz.heritageClauses, [...members, ...newMembers]);
|
|
2954
2865
|
}
|
|
2955
2866
|
};
|
|
2956
2867
|
function markForEmitAsSingleLine(node) {
|
|
2957
|
-
|
|
2958
|
-
|
|
2868
|
+
ts11.setEmitFlags(node, ts11.EmitFlags.SingleLine);
|
|
2869
|
+
ts11.forEachChild(node, markForEmitAsSingleLine);
|
|
2959
2870
|
}
|
|
2960
2871
|
|
|
2961
2872
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
2962
2873
|
import { ConstantPool } from "@angular/compiler";
|
|
2963
|
-
import
|
|
2874
|
+
import ts13 from "typescript";
|
|
2964
2875
|
|
|
2965
2876
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
2966
|
-
import
|
|
2877
|
+
import ts12 from "typescript";
|
|
2967
2878
|
function visit(node, visitor, context) {
|
|
2968
2879
|
return visitor._visit(node, context);
|
|
2969
2880
|
}
|
|
2970
2881
|
var Visitor = class {
|
|
2971
2882
|
constructor() {
|
|
2972
|
-
this._before = new Map();
|
|
2973
|
-
this._after = new Map();
|
|
2883
|
+
this._before = /* @__PURE__ */ new Map();
|
|
2884
|
+
this._after = /* @__PURE__ */ new Map();
|
|
2974
2885
|
}
|
|
2975
2886
|
_visitListEntryNode(node, visitor) {
|
|
2976
2887
|
const result = visitor(node);
|
|
@@ -2987,8 +2898,8 @@ var Visitor = class {
|
|
|
2987
2898
|
}
|
|
2988
2899
|
_visit(node, context) {
|
|
2989
2900
|
let visitedNode = null;
|
|
2990
|
-
node =
|
|
2991
|
-
if (
|
|
2901
|
+
node = ts12.visitEachChild(node, (child) => this._visit(child, context), context);
|
|
2902
|
+
if (ts12.isClassDeclaration(node)) {
|
|
2992
2903
|
visitedNode = this._visitListEntryNode(node, (node2) => this.visitClassDeclaration(node2));
|
|
2993
2904
|
} else {
|
|
2994
2905
|
visitedNode = this.visitOtherNode(node);
|
|
@@ -3002,7 +2913,7 @@ var Visitor = class {
|
|
|
3002
2913
|
if (node.statements.every((stmt) => !this._before.has(stmt) && !this._after.has(stmt))) {
|
|
3003
2914
|
return node;
|
|
3004
2915
|
}
|
|
3005
|
-
const clone =
|
|
2916
|
+
const clone = ts12.getMutableClone(node);
|
|
3006
2917
|
const newStatements = [];
|
|
3007
2918
|
clone.statements.forEach((stmt) => {
|
|
3008
2919
|
if (this._before.has(stmt)) {
|
|
@@ -3015,7 +2926,7 @@ var Visitor = class {
|
|
|
3015
2926
|
this._after.delete(stmt);
|
|
3016
2927
|
}
|
|
3017
2928
|
});
|
|
3018
|
-
clone.statements =
|
|
2929
|
+
clone.statements = ts12.createNodeArray(newStatements, node.statements.hasTrailingComma);
|
|
3019
2930
|
return clone;
|
|
3020
2931
|
}
|
|
3021
2932
|
};
|
|
@@ -3025,7 +2936,7 @@ function hasStatements(node) {
|
|
|
3025
2936
|
}
|
|
3026
2937
|
|
|
3027
2938
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3028
|
-
var NO_DECORATORS = new Set();
|
|
2939
|
+
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3029
2940
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3030
2941
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
3031
2942
|
const recordWrappedNode = createRecorderFn(defaultImportTracker);
|
|
@@ -3040,7 +2951,7 @@ var IvyCompilationVisitor = class extends Visitor {
|
|
|
3040
2951
|
super();
|
|
3041
2952
|
this.compilation = compilation;
|
|
3042
2953
|
this.constantPool = constantPool;
|
|
3043
|
-
this.classCompilationMap = new Map();
|
|
2954
|
+
this.classCompilationMap = /* @__PURE__ */ new Map();
|
|
3044
2955
|
}
|
|
3045
2956
|
visitClassDeclaration(node) {
|
|
3046
2957
|
const result = this.compilation.compile(node, this.constantPool);
|
|
@@ -3073,14 +2984,14 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3073
2984
|
const members = [...node.members];
|
|
3074
2985
|
for (const field of this.classCompilationMap.get(node)) {
|
|
3075
2986
|
const exprNode = translateExpression(field.initializer, this.importManager, translateOptions);
|
|
3076
|
-
const property =
|
|
2987
|
+
const property = ts13.createProperty(void 0, [ts13.createToken(ts13.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
|
|
3077
2988
|
if (this.isClosureCompilerEnabled) {
|
|
3078
|
-
|
|
2989
|
+
ts13.addSyntheticLeadingComment(property, ts13.SyntaxKind.MultiLineCommentTrivia, "* @nocollapse ", false);
|
|
3079
2990
|
}
|
|
3080
2991
|
field.statements.map((stmt) => translateStatement(stmt, this.importManager, translateOptions)).forEach((stmt) => statements.push(stmt));
|
|
3081
2992
|
members.push(property);
|
|
3082
2993
|
}
|
|
3083
|
-
node =
|
|
2994
|
+
node = ts13.updateClassDeclaration(node, maybeFilterDecorator(node.decorators, this.compilation.decoratorsFor(node)), node.modifiers, node.name, node.typeParameters, node.heritageClauses || [], members.map((member) => this._stripAngularDecorators(member)));
|
|
3084
2995
|
return { node, after: statements };
|
|
3085
2996
|
}
|
|
3086
2997
|
_angularCoreDecorators(decl) {
|
|
@@ -3109,25 +3020,25 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
3109
3020
|
if (filtered.length === 0) {
|
|
3110
3021
|
return void 0;
|
|
3111
3022
|
}
|
|
3112
|
-
const array =
|
|
3023
|
+
const array = ts13.createNodeArray(filtered);
|
|
3113
3024
|
array.pos = node.decorators.pos;
|
|
3114
3025
|
array.end = node.decorators.end;
|
|
3115
3026
|
return array;
|
|
3116
3027
|
}
|
|
3117
3028
|
_stripAngularDecorators(node) {
|
|
3118
|
-
if (
|
|
3119
|
-
node =
|
|
3120
|
-
} else if (
|
|
3121
|
-
node =
|
|
3122
|
-
} else if (
|
|
3123
|
-
node =
|
|
3124
|
-
} else if (
|
|
3125
|
-
node =
|
|
3126
|
-
} else if (
|
|
3127
|
-
node =
|
|
3128
|
-
} else if (
|
|
3029
|
+
if (ts13.isParameter(node)) {
|
|
3030
|
+
node = ts13.updateParameter(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer);
|
|
3031
|
+
} else if (ts13.isMethodDeclaration(node) && node.decorators !== void 0) {
|
|
3032
|
+
node = ts13.updateMethod(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
3033
|
+
} else if (ts13.isPropertyDeclaration(node) && node.decorators !== void 0) {
|
|
3034
|
+
node = ts13.updateProperty(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
3035
|
+
} else if (ts13.isGetAccessor(node)) {
|
|
3036
|
+
node = ts13.updateGetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.type, node.body);
|
|
3037
|
+
} else if (ts13.isSetAccessor(node)) {
|
|
3038
|
+
node = ts13.updateSetAccessor(node, this._nonCoreDecoratorsOnly(node), node.modifiers, node.name, node.parameters, node.body);
|
|
3039
|
+
} else if (ts13.isConstructorDeclaration(node)) {
|
|
3129
3040
|
const parameters = node.parameters.map((param) => this._stripAngularDecorators(param));
|
|
3130
|
-
node =
|
|
3041
|
+
node = ts13.updateConstructor(node, node.decorators, node.modifiers, parameters, node.body);
|
|
3131
3042
|
}
|
|
3132
3043
|
return node;
|
|
3133
3044
|
}
|
|
@@ -3139,7 +3050,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3139
3050
|
visit(file, compilationVisitor, context);
|
|
3140
3051
|
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore);
|
|
3141
3052
|
let sf = visit(file, transformationVisitor, context);
|
|
3142
|
-
const downlevelTranslatedCode = getLocalizeCompileTarget(context) <
|
|
3053
|
+
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts13.ScriptTarget.ES2015;
|
|
3143
3054
|
const constants = constantPool.statements.map((stmt) => translateStatement(stmt, importManager, {
|
|
3144
3055
|
recordWrappedNode,
|
|
3145
3056
|
downlevelTaggedTemplates: downlevelTranslatedCode,
|
|
@@ -3154,17 +3065,17 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
3154
3065
|
return sf;
|
|
3155
3066
|
}
|
|
3156
3067
|
function getLocalizeCompileTarget(context) {
|
|
3157
|
-
const target = context.getCompilerOptions().target ||
|
|
3158
|
-
return target !==
|
|
3068
|
+
const target = context.getCompilerOptions().target || ts13.ScriptTarget.ES2015;
|
|
3069
|
+
return target !== ts13.ScriptTarget.JSON ? target : ts13.ScriptTarget.ES2015;
|
|
3159
3070
|
}
|
|
3160
3071
|
function getFileOverviewComment(statements) {
|
|
3161
3072
|
if (statements.length > 0) {
|
|
3162
3073
|
const host = statements[0];
|
|
3163
3074
|
let trailing = false;
|
|
3164
|
-
let comments =
|
|
3075
|
+
let comments = ts13.getSyntheticLeadingComments(host);
|
|
3165
3076
|
if (!comments || comments.length === 0) {
|
|
3166
3077
|
trailing = true;
|
|
3167
|
-
comments =
|
|
3078
|
+
comments = ts13.getSyntheticTrailingComments(host);
|
|
3168
3079
|
}
|
|
3169
3080
|
if (comments && comments.length > 0 && CLOSURE_FILE_OVERVIEW_REGEXP.test(comments[0].text)) {
|
|
3170
3081
|
return { comments, host, trailing };
|
|
@@ -3176,22 +3087,22 @@ function setFileOverviewComment(sf, fileoverview) {
|
|
|
3176
3087
|
const { comments, host, trailing } = fileoverview;
|
|
3177
3088
|
if (sf.statements.length > 0 && host !== sf.statements[0]) {
|
|
3178
3089
|
if (trailing) {
|
|
3179
|
-
|
|
3090
|
+
ts13.setSyntheticTrailingComments(host, void 0);
|
|
3180
3091
|
} else {
|
|
3181
|
-
|
|
3092
|
+
ts13.setSyntheticLeadingComments(host, void 0);
|
|
3182
3093
|
}
|
|
3183
|
-
|
|
3094
|
+
ts13.setSyntheticLeadingComments(sf.statements[0], comments);
|
|
3184
3095
|
}
|
|
3185
3096
|
}
|
|
3186
3097
|
function maybeFilterDecorator(decorators, toRemove) {
|
|
3187
3098
|
if (decorators === void 0) {
|
|
3188
3099
|
return void 0;
|
|
3189
3100
|
}
|
|
3190
|
-
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) =>
|
|
3101
|
+
const filtered = decorators.filter((dec) => toRemove.find((decToRemove) => ts13.getOriginalNode(dec) === decToRemove) === void 0);
|
|
3191
3102
|
if (filtered.length === 0) {
|
|
3192
3103
|
return void 0;
|
|
3193
3104
|
}
|
|
3194
|
-
return
|
|
3105
|
+
return ts13.createNodeArray(filtered);
|
|
3195
3106
|
}
|
|
3196
3107
|
function isFromAngularCore(decorator) {
|
|
3197
3108
|
return decorator.import !== null && decorator.import.from === "@angular/core";
|
|
@@ -3206,7 +3117,7 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
3206
3117
|
}
|
|
3207
3118
|
|
|
3208
3119
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
|
|
3209
|
-
import
|
|
3120
|
+
import ts14 from "typescript";
|
|
3210
3121
|
function createValueHasWrongTypeError(node, value, messageText) {
|
|
3211
3122
|
var _a;
|
|
3212
3123
|
let chainedMessage;
|
|
@@ -3224,11 +3135,11 @@ function createValueHasWrongTypeError(node, value, messageText) {
|
|
|
3224
3135
|
}
|
|
3225
3136
|
const chain = {
|
|
3226
3137
|
messageText,
|
|
3227
|
-
category:
|
|
3138
|
+
category: ts14.DiagnosticCategory.Error,
|
|
3228
3139
|
code: 0,
|
|
3229
3140
|
next: [{
|
|
3230
3141
|
messageText: chainedMessage,
|
|
3231
|
-
category:
|
|
3142
|
+
category: ts14.DiagnosticCategory.Message,
|
|
3232
3143
|
code: 0
|
|
3233
3144
|
}]
|
|
3234
3145
|
};
|
|
@@ -3304,7 +3215,7 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
3304
3215
|
|
|
3305
3216
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
3306
3217
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr3, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
3307
|
-
import
|
|
3218
|
+
import ts16 from "typescript";
|
|
3308
3219
|
|
|
3309
3220
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
|
|
3310
3221
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
@@ -3319,7 +3230,7 @@ function compileDeclareFactory(metadata) {
|
|
|
3319
3230
|
|
|
3320
3231
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/metadata.mjs
|
|
3321
3232
|
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
3322
|
-
import
|
|
3233
|
+
import ts15 from "typescript";
|
|
3323
3234
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
3324
3235
|
if (!reflection.isClass(clazz)) {
|
|
3325
3236
|
return null;
|
|
@@ -3333,7 +3244,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3333
3244
|
if (ngClassDecorators.length === 0) {
|
|
3334
3245
|
return null;
|
|
3335
3246
|
}
|
|
3336
|
-
const metaDecorators = new WrappedNodeExpr2(
|
|
3247
|
+
const metaDecorators = new WrappedNodeExpr2(ts15.createArrayLiteral(ngClassDecorators));
|
|
3337
3248
|
let metaCtorParameters = null;
|
|
3338
3249
|
const classCtorParameters = reflection.getConstructorParameters(clazz);
|
|
3339
3250
|
if (classCtorParameters !== null) {
|
|
@@ -3353,7 +3264,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
3353
3264
|
return classMemberToMetadata((_a = member.nameNode) != null ? _a : member.name, member.decorators, isCore);
|
|
3354
3265
|
});
|
|
3355
3266
|
if (decoratedMembers.length > 0) {
|
|
3356
|
-
metaPropDecorators = new WrappedNodeExpr2(
|
|
3267
|
+
metaPropDecorators = new WrappedNodeExpr2(ts15.createObjectLiteral(decoratedMembers));
|
|
3357
3268
|
}
|
|
3358
3269
|
return {
|
|
3359
3270
|
type: new WrappedNodeExpr2(id),
|
|
@@ -3369,38 +3280,38 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
3369
3280
|
];
|
|
3370
3281
|
if (param.decorators !== null) {
|
|
3371
3282
|
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3372
|
-
const value = new WrappedNodeExpr2(
|
|
3283
|
+
const value = new WrappedNodeExpr2(ts15.createArrayLiteral(ngDecorators));
|
|
3373
3284
|
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
3374
3285
|
}
|
|
3375
3286
|
return literalMap(mapEntries);
|
|
3376
3287
|
}
|
|
3377
3288
|
function classMemberToMetadata(name, decorators, isCore) {
|
|
3378
3289
|
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
3379
|
-
const decoratorMeta =
|
|
3380
|
-
return
|
|
3290
|
+
const decoratorMeta = ts15.createArrayLiteral(ngDecorators);
|
|
3291
|
+
return ts15.createPropertyAssignment(name, decoratorMeta);
|
|
3381
3292
|
}
|
|
3382
3293
|
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
3383
3294
|
if (decorator.identifier === null) {
|
|
3384
3295
|
throw new Error("Illegal state: synthesized decorator cannot be emitted in class metadata.");
|
|
3385
3296
|
}
|
|
3386
3297
|
const properties = [
|
|
3387
|
-
|
|
3298
|
+
ts15.createPropertyAssignment("type", ts15.getMutableClone(decorator.identifier))
|
|
3388
3299
|
];
|
|
3389
3300
|
if (decorator.args !== null && decorator.args.length > 0) {
|
|
3390
3301
|
const args = decorator.args.map((arg) => {
|
|
3391
|
-
const expr =
|
|
3302
|
+
const expr = ts15.getMutableClone(arg);
|
|
3392
3303
|
return wrapFunctionsInParens ? wrapFunctionExpressionsInParens(expr) : expr;
|
|
3393
3304
|
});
|
|
3394
|
-
properties.push(
|
|
3305
|
+
properties.push(ts15.createPropertyAssignment("args", ts15.createArrayLiteral(args)));
|
|
3395
3306
|
}
|
|
3396
|
-
return
|
|
3307
|
+
return ts15.createObjectLiteral(properties, true);
|
|
3397
3308
|
}
|
|
3398
3309
|
function isAngularDecorator2(decorator, isCore) {
|
|
3399
3310
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
3400
3311
|
}
|
|
3401
3312
|
function removeIdentifierReferences(node, name) {
|
|
3402
|
-
const result =
|
|
3403
|
-
return
|
|
3313
|
+
const result = ts15.transform(node, [(context) => (root) => ts15.visitNode(root, function walk(current) {
|
|
3314
|
+
return ts15.isIdentifier(current) && current.text === name ? ts15.createIdentifier(current.text) : ts15.visitEachChild(current, walk, context);
|
|
3404
3315
|
})]);
|
|
3405
3316
|
return result.transformed[0];
|
|
3406
3317
|
}
|
|
@@ -3417,7 +3328,7 @@ var FIELD_DECORATORS = [
|
|
|
3417
3328
|
"HostBinding",
|
|
3418
3329
|
"HostListener"
|
|
3419
3330
|
];
|
|
3420
|
-
var LIFECYCLE_HOOKS = new Set([
|
|
3331
|
+
var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
3421
3332
|
"ngOnChanges",
|
|
3422
3333
|
"ngOnInit",
|
|
3423
3334
|
"ngOnDestroy",
|
|
@@ -3620,12 +3531,12 @@ var DirectiveDecoratorHandler = class {
|
|
|
3620
3531
|
function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, isCore, flags, annotateForClosureCompiler, defaultSelector = null) {
|
|
3621
3532
|
let directive;
|
|
3622
3533
|
if (decorator === null || decorator.args === null || decorator.args.length === 0) {
|
|
3623
|
-
directive = new Map();
|
|
3534
|
+
directive = /* @__PURE__ */ new Map();
|
|
3624
3535
|
} else if (decorator.args.length !== 1) {
|
|
3625
3536
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
3626
3537
|
} else {
|
|
3627
3538
|
const meta = unwrapExpression(decorator.args[0]);
|
|
3628
|
-
if (!
|
|
3539
|
+
if (!ts16.isObjectLiteralExpression(meta)) {
|
|
3629
3540
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
3630
3541
|
}
|
|
3631
3542
|
directive = reflectObjectLiteral(meta);
|
|
@@ -3736,7 +3647,7 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3736
3647
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
3737
3648
|
if (args.length === 2) {
|
|
3738
3649
|
const optionsExpr = unwrapExpression(args[1]);
|
|
3739
|
-
if (!
|
|
3650
|
+
if (!ts16.isObjectLiteralExpression(optionsExpr)) {
|
|
3740
3651
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
3741
3652
|
}
|
|
3742
3653
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -3781,16 +3692,16 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
3781
3692
|
}
|
|
3782
3693
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
3783
3694
|
const content = [], view = [];
|
|
3784
|
-
if (!
|
|
3695
|
+
if (!ts16.isObjectLiteralExpression(queryData)) {
|
|
3785
3696
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
3786
3697
|
}
|
|
3787
3698
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
3788
3699
|
queryExpr = unwrapExpression(queryExpr);
|
|
3789
|
-
if (!
|
|
3700
|
+
if (!ts16.isNewExpression(queryExpr)) {
|
|
3790
3701
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3791
3702
|
}
|
|
3792
|
-
const queryType =
|
|
3793
|
-
if (!
|
|
3703
|
+
const queryType = ts16.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
3704
|
+
if (!ts16.isIdentifier(queryType)) {
|
|
3794
3705
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
3795
3706
|
}
|
|
3796
3707
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -3960,7 +3871,7 @@ function extractHostBindings(members, evaluator, coreModule, metadata) {
|
|
|
3960
3871
|
});
|
|
3961
3872
|
return bindings;
|
|
3962
3873
|
}
|
|
3963
|
-
var QUERY_TYPES = new Set([
|
|
3874
|
+
var QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
3964
3875
|
"ContentChild",
|
|
3965
3876
|
"ContentChildren",
|
|
3966
3877
|
"ViewChild",
|
|
@@ -3969,7 +3880,7 @@ var QUERY_TYPES = new Set([
|
|
|
3969
3880
|
|
|
3970
3881
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
|
|
3971
3882
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, ExternalExpr as ExternalExpr4, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, NO_ERRORS_SCHEMA, R3Identifiers, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
3972
|
-
import
|
|
3883
|
+
import ts17 from "typescript";
|
|
3973
3884
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
3974
3885
|
constructor() {
|
|
3975
3886
|
super(...arguments);
|
|
@@ -4052,8 +3963,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
4052
3963
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
4053
3964
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @NgModule decorator`);
|
|
4054
3965
|
}
|
|
4055
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
4056
|
-
if (!
|
|
3966
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts17.createObjectLiteral([]);
|
|
3967
|
+
if (!ts17.isObjectLiteralExpression(meta)) {
|
|
4057
3968
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
4058
3969
|
}
|
|
4059
3970
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -4134,10 +4045,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4134
4045
|
if (typeNode !== null) {
|
|
4135
4046
|
typeContext = typeNode.getSourceFile();
|
|
4136
4047
|
}
|
|
4137
|
-
const bootstrap = bootstrapRefs.map((bootstrap2) => this._toR3Reference(bootstrap2, valueContext, typeContext));
|
|
4138
|
-
const declarations = declarationRefs.map((decl) => this._toR3Reference(decl, valueContext, typeContext));
|
|
4139
|
-
const imports = importRefs.map((imp) => this._toR3Reference(imp, valueContext, typeContext));
|
|
4140
|
-
const exports = exportRefs.map((exp) => this._toR3Reference(exp, valueContext, typeContext));
|
|
4048
|
+
const bootstrap = bootstrapRefs.map((bootstrap2) => this._toR3Reference(bootstrap2.getOriginForDiagnostics(meta, node.name), bootstrap2, valueContext, typeContext));
|
|
4049
|
+
const declarations = declarationRefs.map((decl) => this._toR3Reference(decl.getOriginForDiagnostics(meta, node.name), decl, valueContext, typeContext));
|
|
4050
|
+
const imports = importRefs.map((imp) => this._toR3Reference(imp.getOriginForDiagnostics(meta, node.name), imp, valueContext, typeContext));
|
|
4051
|
+
const exports = exportRefs.map((exp) => this._toR3Reference(exp.getOriginForDiagnostics(meta, node.name), exp, valueContext, typeContext));
|
|
4141
4052
|
const isForwardReference = (ref) => isExpressionForwardReference(ref.value, node.name, valueContext);
|
|
4142
4053
|
const containsForwardDecls = bootstrap.some(isForwardReference) || declarations.some(isForwardReference) || imports.some(isForwardReference) || exports.some(isForwardReference);
|
|
4143
4054
|
const type = wrapTypeReference(this.reflector, node);
|
|
@@ -4233,7 +4144,9 @@ var NgModuleDecoratorHandler = class {
|
|
|
4233
4144
|
const context = getSourceFile(node);
|
|
4234
4145
|
for (const exportRef of analysis.exports) {
|
|
4235
4146
|
if (isNgModule(exportRef.node, scope.compilation)) {
|
|
4236
|
-
|
|
4147
|
+
const type = this.refEmitter.emit(exportRef, context);
|
|
4148
|
+
assertSuccessfulReferenceEmit(type, node, "NgModule");
|
|
4149
|
+
data.injectorImports.push(type.expression);
|
|
4237
4150
|
}
|
|
4238
4151
|
}
|
|
4239
4152
|
for (const decl of analysis.declarations) {
|
|
@@ -4286,11 +4199,21 @@ var NgModuleDecoratorHandler = class {
|
|
|
4286
4199
|
for (const decl of declarations) {
|
|
4287
4200
|
const remoteScope = this.scopeRegistry.getRemoteScope(decl.node);
|
|
4288
4201
|
if (remoteScope !== null) {
|
|
4289
|
-
const directives = remoteScope.directives.map((directive) =>
|
|
4290
|
-
|
|
4202
|
+
const directives = remoteScope.directives.map((directive) => {
|
|
4203
|
+
const type = this.refEmitter.emit(directive, context);
|
|
4204
|
+
assertSuccessfulReferenceEmit(type, node, "directive");
|
|
4205
|
+
return type.expression;
|
|
4206
|
+
});
|
|
4207
|
+
const pipes = remoteScope.pipes.map((pipe) => {
|
|
4208
|
+
const type = this.refEmitter.emit(pipe, context);
|
|
4209
|
+
assertSuccessfulReferenceEmit(type, node, "pipe");
|
|
4210
|
+
return type.expression;
|
|
4211
|
+
});
|
|
4291
4212
|
const directiveArray = new LiteralArrayExpr2(directives);
|
|
4292
4213
|
const pipesArray = new LiteralArrayExpr2(pipes);
|
|
4293
|
-
const
|
|
4214
|
+
const componentType = this.refEmitter.emit(decl, context);
|
|
4215
|
+
assertSuccessfulReferenceEmit(componentType, node, "component");
|
|
4216
|
+
const declExpr = componentType.expression;
|
|
4294
4217
|
const setComponentScope = new ExternalExpr4(R3Identifiers.setComponentScope);
|
|
4295
4218
|
const callExpr = new InvokeFunctionExpr(setComponentScope, [declExpr, directiveArray, pipesArray]);
|
|
4296
4219
|
ngModuleStatements.push(callExpr.toStmt());
|
|
@@ -4315,16 +4238,16 @@ var NgModuleDecoratorHandler = class {
|
|
|
4315
4238
|
];
|
|
4316
4239
|
return res;
|
|
4317
4240
|
}
|
|
4318
|
-
_toR3Reference(valueRef, valueContext, typeContext) {
|
|
4241
|
+
_toR3Reference(origin, valueRef, valueContext, typeContext) {
|
|
4319
4242
|
if (valueRef.hasOwningModuleGuess) {
|
|
4320
|
-
return toR3Reference(valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4243
|
+
return toR3Reference(origin, valueRef, valueRef, valueContext, valueContext, this.refEmitter);
|
|
4321
4244
|
} else {
|
|
4322
4245
|
let typeRef = valueRef;
|
|
4323
4246
|
let typeNode = this.reflector.getDtsDeclaration(typeRef.node);
|
|
4324
4247
|
if (typeNode !== null && isNamedClassDeclaration(typeNode)) {
|
|
4325
4248
|
typeRef = new Reference(typeNode);
|
|
4326
4249
|
}
|
|
4327
|
-
return toR3Reference(valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4250
|
+
return toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4328
4251
|
}
|
|
4329
4252
|
}
|
|
4330
4253
|
_extractModuleFromModuleWithProvidersFn(node) {
|
|
@@ -4332,10 +4255,10 @@ var NgModuleDecoratorHandler = class {
|
|
|
4332
4255
|
return type && (this._reflectModuleFromTypeParam(type, node) || this._reflectModuleFromLiteralType(type));
|
|
4333
4256
|
}
|
|
4334
4257
|
_reflectModuleFromTypeParam(type, node) {
|
|
4335
|
-
if (!
|
|
4258
|
+
if (!ts17.isTypeReferenceNode(type)) {
|
|
4336
4259
|
return null;
|
|
4337
4260
|
}
|
|
4338
|
-
const typeName = type && (
|
|
4261
|
+
const typeName = type && (ts17.isIdentifier(type.typeName) && type.typeName || ts17.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
4339
4262
|
if (typeName === null) {
|
|
4340
4263
|
return null;
|
|
4341
4264
|
}
|
|
@@ -4347,7 +4270,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4347
4270
|
return null;
|
|
4348
4271
|
}
|
|
4349
4272
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
4350
|
-
const parent =
|
|
4273
|
+
const parent = ts17.isMethodDeclaration(node) && ts17.isClassDeclaration(node.parent) ? node.parent : null;
|
|
4351
4274
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
4352
4275
|
throw new FatalDiagnosticError(ErrorCode.NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC, type, `${symbolName} returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.`);
|
|
4353
4276
|
}
|
|
@@ -4355,13 +4278,13 @@ var NgModuleDecoratorHandler = class {
|
|
|
4355
4278
|
return typeNodeToValueExpr(arg);
|
|
4356
4279
|
}
|
|
4357
4280
|
_reflectModuleFromLiteralType(type) {
|
|
4358
|
-
if (!
|
|
4281
|
+
if (!ts17.isIntersectionTypeNode(type)) {
|
|
4359
4282
|
return null;
|
|
4360
4283
|
}
|
|
4361
4284
|
for (const t of type.types) {
|
|
4362
|
-
if (
|
|
4285
|
+
if (ts17.isTypeLiteralNode(t)) {
|
|
4363
4286
|
for (const m of t.members) {
|
|
4364
|
-
const ngModuleType =
|
|
4287
|
+
const ngModuleType = ts17.isPropertySignature(m) && ts17.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
4365
4288
|
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
4366
4289
|
if (ngModuleExpression) {
|
|
4367
4290
|
return ngModuleExpression;
|
|
@@ -4402,7 +4325,7 @@ function isNgModule(node, compilation) {
|
|
|
4402
4325
|
}
|
|
4403
4326
|
|
|
4404
4327
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
4405
|
-
var EMPTY_MAP = new Map();
|
|
4328
|
+
var EMPTY_MAP = /* @__PURE__ */ new Map();
|
|
4406
4329
|
var EMPTY_ARRAY = [];
|
|
4407
4330
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
4408
4331
|
constructor() {
|
|
@@ -4464,10 +4387,10 @@ var ComponentDecoratorHandler = class {
|
|
|
4464
4387
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
4465
4388
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
4466
4389
|
this.perf = perf;
|
|
4467
|
-
this.literalCache = new Map();
|
|
4390
|
+
this.literalCache = /* @__PURE__ */ new Map();
|
|
4468
4391
|
this.elementSchemaRegistry = new DomElementSchemaRegistry();
|
|
4469
|
-
this.preanalyzeTemplateCache = new Map();
|
|
4470
|
-
this.preanalyzeStylesCache = new Map();
|
|
4392
|
+
this.preanalyzeTemplateCache = /* @__PURE__ */ new Map();
|
|
4393
|
+
this.preanalyzeStylesCache = /* @__PURE__ */ new Map();
|
|
4471
4394
|
this.precedence = HandlerPrecedence.PRIMARY;
|
|
4472
4395
|
this.name = ComponentDecoratorHandler.name;
|
|
4473
4396
|
}
|
|
@@ -4722,7 +4645,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4722
4645
|
});
|
|
4723
4646
|
}
|
|
4724
4647
|
typeCheck(ctx, node, meta) {
|
|
4725
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
4648
|
+
if (this.typeCheckScopeRegistry === null || !ts18.isClassDeclaration(node)) {
|
|
4726
4649
|
return;
|
|
4727
4650
|
}
|
|
4728
4651
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -4760,7 +4683,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4760
4683
|
matcher.addSelectables(CssSelector.parse(dir.selector), dir);
|
|
4761
4684
|
}
|
|
4762
4685
|
}
|
|
4763
|
-
const pipes = new Map();
|
|
4686
|
+
const pipes = /* @__PURE__ */ new Map();
|
|
4764
4687
|
for (const pipe of scope.compilation.pipes) {
|
|
4765
4688
|
pipes.set(pipe.name, pipe.ref);
|
|
4766
4689
|
}
|
|
@@ -4768,6 +4691,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4768
4691
|
const bound = binder.bind({ template: metadata.template.nodes });
|
|
4769
4692
|
const usedDirectives = bound.getUsedDirectives().map((directive) => {
|
|
4770
4693
|
const type = this.refEmitter.emit(directive.ref, context);
|
|
4694
|
+
assertSuccessfulReferenceEmit(type, node.name, directive.isComponent ? "component" : "directive");
|
|
4771
4695
|
return {
|
|
4772
4696
|
ref: directive.ref,
|
|
4773
4697
|
type: type.expression,
|
|
@@ -4786,6 +4710,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4786
4710
|
}
|
|
4787
4711
|
const pipe = pipes.get(pipeName);
|
|
4788
4712
|
const type = this.refEmitter.emit(pipe, context);
|
|
4713
|
+
assertSuccessfulReferenceEmit(type, node.name, "pipe");
|
|
4789
4714
|
usedPipes.push({
|
|
4790
4715
|
ref: pipe,
|
|
4791
4716
|
pipeName,
|
|
@@ -4797,14 +4722,14 @@ var ComponentDecoratorHandler = class {
|
|
|
4797
4722
|
symbol.usedDirectives = usedDirectives.map((dir) => this.semanticDepGraphUpdater.getSemanticReference(dir.ref.node, dir.type));
|
|
4798
4723
|
symbol.usedPipes = usedPipes.map((pipe) => this.semanticDepGraphUpdater.getSemanticReference(pipe.ref.node, pipe.expression));
|
|
4799
4724
|
}
|
|
4800
|
-
const cyclesFromDirectives = new Map();
|
|
4725
|
+
const cyclesFromDirectives = /* @__PURE__ */ new Map();
|
|
4801
4726
|
for (const usedDirective of usedDirectives) {
|
|
4802
4727
|
const cycle = this._checkForCyclicImport(usedDirective.importedFile, usedDirective.type, context);
|
|
4803
4728
|
if (cycle !== null) {
|
|
4804
4729
|
cyclesFromDirectives.set(usedDirective, cycle);
|
|
4805
4730
|
}
|
|
4806
4731
|
}
|
|
4807
|
-
const cyclesFromPipes = new Map();
|
|
4732
|
+
const cyclesFromPipes = /* @__PURE__ */ new Map();
|
|
4808
4733
|
for (const usedPipe of usedPipes) {
|
|
4809
4734
|
const cycle = this._checkForCyclicImport(usedPipe.importedFile, usedPipe.expression, context);
|
|
4810
4735
|
if (cycle !== null) {
|
|
@@ -4931,17 +4856,17 @@ var ComponentDecoratorHandler = class {
|
|
|
4931
4856
|
const metadata = new Map(component);
|
|
4932
4857
|
if (metadata.has("templateUrl")) {
|
|
4933
4858
|
metadata.delete("templateUrl");
|
|
4934
|
-
metadata.set("template",
|
|
4859
|
+
metadata.set("template", ts18.createStringLiteral(template.content));
|
|
4935
4860
|
}
|
|
4936
4861
|
if (metadata.has("styleUrls")) {
|
|
4937
4862
|
metadata.delete("styleUrls");
|
|
4938
|
-
metadata.set("styles",
|
|
4863
|
+
metadata.set("styles", ts18.createArrayLiteral(styles.map((s) => ts18.createStringLiteral(s))));
|
|
4939
4864
|
}
|
|
4940
4865
|
const newMetadataFields = [];
|
|
4941
4866
|
for (const [name, value] of metadata.entries()) {
|
|
4942
|
-
newMetadataFields.push(
|
|
4867
|
+
newMetadataFields.push(ts18.createPropertyAssignment(name, value));
|
|
4943
4868
|
}
|
|
4944
|
-
return __spreadProps(__spreadValues({}, dec), { args: [
|
|
4869
|
+
return __spreadProps(__spreadValues({}, dec), { args: [ts18.createObjectLiteral(newMetadataFields)] });
|
|
4945
4870
|
}
|
|
4946
4871
|
_resolveLiteral(decorator) {
|
|
4947
4872
|
if (this.literalCache.has(decorator)) {
|
|
@@ -4951,7 +4876,7 @@ var ComponentDecoratorHandler = class {
|
|
|
4951
4876
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @Component decorator`);
|
|
4952
4877
|
}
|
|
4953
4878
|
const meta = unwrapExpression(decorator.args[0]);
|
|
4954
|
-
if (!
|
|
4879
|
+
if (!ts18.isObjectLiteralExpression(meta)) {
|
|
4955
4880
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `Decorator argument must be literal.`);
|
|
4956
4881
|
}
|
|
4957
4882
|
this.literalCache.set(decorator, meta);
|
|
@@ -4978,9 +4903,9 @@ var ComponentDecoratorHandler = class {
|
|
|
4978
4903
|
}
|
|
4979
4904
|
_extractStyleUrlsFromExpression(styleUrlsExpr) {
|
|
4980
4905
|
const styleUrls = [];
|
|
4981
|
-
if (
|
|
4906
|
+
if (ts18.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
4982
4907
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
4983
|
-
if (
|
|
4908
|
+
if (ts18.isSpreadElement(styleUrlExpr)) {
|
|
4984
4909
|
styleUrls.push(...this._extractStyleUrlsFromExpression(styleUrlExpr.expression));
|
|
4985
4910
|
} else {
|
|
4986
4911
|
const styleUrl = this.evaluator.evaluate(styleUrlExpr);
|
|
@@ -5010,12 +4935,12 @@ var ComponentDecoratorHandler = class {
|
|
|
5010
4935
|
return styleUrls;
|
|
5011
4936
|
}
|
|
5012
4937
|
_extractStyleResources(component, containingFile) {
|
|
5013
|
-
const styles = new Set();
|
|
4938
|
+
const styles = /* @__PURE__ */ new Set();
|
|
5014
4939
|
function stringLiteralElements(array) {
|
|
5015
|
-
return array.elements.filter((e) =>
|
|
4940
|
+
return array.elements.filter((e) => ts18.isStringLiteralLike(e));
|
|
5016
4941
|
}
|
|
5017
4942
|
const styleUrlsExpr = component.get("styleUrls");
|
|
5018
|
-
if (styleUrlsExpr !== void 0 &&
|
|
4943
|
+
if (styleUrlsExpr !== void 0 && ts18.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5019
4944
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
5020
4945
|
try {
|
|
5021
4946
|
const resourceUrl = this.resourceLoader.resolve(expression.text, containingFile);
|
|
@@ -5025,7 +4950,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5025
4950
|
}
|
|
5026
4951
|
}
|
|
5027
4952
|
const stylesExpr = component.get("styles");
|
|
5028
|
-
if (stylesExpr !== void 0 &&
|
|
4953
|
+
if (stylesExpr !== void 0 && ts18.isArrayLiteralExpression(stylesExpr)) {
|
|
5029
4954
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
5030
4955
|
styles.add({ path: null, expression });
|
|
5031
4956
|
}
|
|
@@ -5070,7 +4995,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5070
4995
|
let sourceMapping;
|
|
5071
4996
|
let escapedString = false;
|
|
5072
4997
|
let sourceMapUrl;
|
|
5073
|
-
if (
|
|
4998
|
+
if (ts18.isStringLiteral(template.expression) || ts18.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
5074
4999
|
sourceParseRange = getTemplateRange(template.expression);
|
|
5075
5000
|
sourceStr = template.expression.getSourceFile().text;
|
|
5076
5001
|
templateContent = template.expression.text;
|
|
@@ -5244,7 +5169,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5244
5169
|
};
|
|
5245
5170
|
function getTemplateRange(templateExpr) {
|
|
5246
5171
|
const startPos = templateExpr.getStart() + 1;
|
|
5247
|
-
const { line, character } =
|
|
5172
|
+
const { line, character } = ts18.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
5248
5173
|
return {
|
|
5249
5174
|
startPos,
|
|
5250
5175
|
startLine: line,
|
|
@@ -5287,7 +5212,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5287
5212
|
|
|
5288
5213
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
5289
5214
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
5290
|
-
import
|
|
5215
|
+
import ts19 from "typescript";
|
|
5291
5216
|
var InjectableDecoratorHandler = class {
|
|
5292
5217
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
5293
5218
|
this.reflector = reflector;
|
|
@@ -5378,7 +5303,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5378
5303
|
};
|
|
5379
5304
|
} else if (decorator.args.length === 1) {
|
|
5380
5305
|
const metaNode = decorator.args[0];
|
|
5381
|
-
if (!
|
|
5306
|
+
if (!ts19.isObjectLiteralExpression(metaNode)) {
|
|
5382
5307
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
5383
5308
|
}
|
|
5384
5309
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -5386,7 +5311,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
5386
5311
|
let deps = void 0;
|
|
5387
5312
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
5388
5313
|
const depsExpr = meta.get("deps");
|
|
5389
|
-
if (!
|
|
5314
|
+
if (!ts19.isArrayLiteralExpression(depsExpr)) {
|
|
5390
5315
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
5391
5316
|
}
|
|
5392
5317
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -5468,12 +5393,12 @@ function getDep(dep, reflector) {
|
|
|
5468
5393
|
}
|
|
5469
5394
|
return true;
|
|
5470
5395
|
}
|
|
5471
|
-
if (
|
|
5396
|
+
if (ts19.isArrayLiteralExpression(dep)) {
|
|
5472
5397
|
dep.elements.forEach((el) => {
|
|
5473
5398
|
let isDecorator = false;
|
|
5474
|
-
if (
|
|
5399
|
+
if (ts19.isIdentifier(el)) {
|
|
5475
5400
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
5476
|
-
} else if (
|
|
5401
|
+
} else if (ts19.isNewExpression(el) && ts19.isIdentifier(el.expression)) {
|
|
5477
5402
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
5478
5403
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
5479
5404
|
}
|
|
@@ -5487,7 +5412,7 @@ function getDep(dep, reflector) {
|
|
|
5487
5412
|
|
|
5488
5413
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
5489
5414
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
5490
|
-
import
|
|
5415
|
+
import ts20 from "typescript";
|
|
5491
5416
|
var PipeSymbol = class extends SemanticSymbol {
|
|
5492
5417
|
constructor(decl, name) {
|
|
5493
5418
|
super(decl);
|
|
@@ -5542,7 +5467,7 @@ var PipeDecoratorHandler = class {
|
|
|
5542
5467
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), "@Pipe must have exactly one argument");
|
|
5543
5468
|
}
|
|
5544
5469
|
const meta = unwrapExpression(decorator.args[0]);
|
|
5545
|
-
if (!
|
|
5470
|
+
if (!ts20.isObjectLiteralExpression(meta)) {
|
|
5546
5471
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
5547
5472
|
}
|
|
5548
5473
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -5617,14 +5542,6 @@ var NoopReferencesRegistry = class {
|
|
|
5617
5542
|
};
|
|
5618
5543
|
|
|
5619
5544
|
export {
|
|
5620
|
-
ErrorCode,
|
|
5621
|
-
COMPILER_ERRORS_WITH_GUIDES,
|
|
5622
|
-
replaceTsWithNgInErrors,
|
|
5623
|
-
ngErrorCode,
|
|
5624
|
-
makeDiagnostic,
|
|
5625
|
-
makeRelatedInformation,
|
|
5626
|
-
isFatalDiagnosticError,
|
|
5627
|
-
ERROR_DETAILS_PAGE_BASE_URL,
|
|
5628
5545
|
SemanticDepGraphUpdater,
|
|
5629
5546
|
CompoundMetadataReader,
|
|
5630
5547
|
DtsMetadataReader,
|
|
@@ -5660,4 +5577,4 @@ export {
|
|
|
5660
5577
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5661
5578
|
* found in the LICENSE file at https://angular.io/license
|
|
5662
5579
|
*/
|
|
5663
|
-
//# sourceMappingURL=chunk-
|
|
5580
|
+
//# sourceMappingURL=chunk-FUZ3CSDO.js.map
|