@angular/compiler-cli 17.1.0-next.2 → 17.1.0-next.4
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-QWNQBN2Z.js → chunk-5QWOGIJL.js} +2 -2
- package/bundles/{chunk-RLZPCAR3.js → chunk-EFMKZSXJ.js} +34 -7
- package/bundles/chunk-EFMKZSXJ.js.map +6 -0
- package/bundles/{chunk-OYL5JDZA.js → chunk-HQUXRCDO.js} +138 -65
- package/bundles/chunk-HQUXRCDO.js.map +6 -0
- package/bundles/{chunk-6GUXR7F5.js → chunk-MFE4YVWE.js} +6 -5
- package/bundles/chunk-MFE4YVWE.js.map +6 -0
- package/bundles/{chunk-54K5L6NG.js → chunk-OZXTEOXW.js} +7 -5
- package/bundles/chunk-OZXTEOXW.js.map +6 -0
- package/bundles/{chunk-VOXK3NAL.js → chunk-U4EFDEE4.js} +216 -92
- package/bundles/chunk-U4EFDEE4.js.map +6 -0
- package/bundles/{chunk-TNVYLY25.js → chunk-YGXKICXB.js} +2 -2
- package/bundles/index.js +6 -7
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +8 -8
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +3 -3
- package/bundles/private/migrations.js +3 -4
- package/bundles/private/tooling.js +2 -3
- package/bundles/src/bin/ng_xi18n.js +5 -6
- package/bundles/src/bin/ng_xi18n.js.map +1 -1
- package/bundles/src/bin/ngc.js +5 -6
- package/bundles/src/bin/ngc.js.map +1 -1
- package/bundles_metadata.json +1 -1
- package/linker/babel/src/ast/babel_ast_factory.d.ts +0 -1
- package/linker/babel/src/ast/babel_ast_host.d.ts +0 -1
- package/linker/babel/src/babel_declaration_scope.d.ts +2 -5
- package/linker/babel/src/babel_plugin.d.ts +0 -1
- package/linker/babel/src/es2015_linker_plugin.d.ts +0 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/private/babel.d.ts +6 -20
- package/src/ngtsc/annotations/directive/src/input_function.d.ts +23 -0
- package/src/ngtsc/annotations/directive/src/shared.d.ts +15 -3
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
- package/src/ngtsc/imports/src/emitter.d.ts +5 -1
- package/src/ngtsc/imports/src/references.d.ts +3 -1
- package/src/ngtsc/metadata/src/api.d.ts +25 -3
- package/src/ngtsc/metadata/src/property_mapping.d.ts +3 -1
- package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +2 -1
- package/src/ngtsc/reflection/src/host.d.ts +6 -1
- package/src/ngtsc/reflection/src/typescript.d.ts +1 -0
- package/src/ngtsc/typecheck/api/api.d.ts +4 -0
- package/src/ngtsc/typecheck/extended/index.d.ts +1 -0
- package/src/ngtsc/typecheck/src/environment.d.ts +2 -27
- package/src/ngtsc/typecheck/src/oob.d.ts +3 -2
- package/src/ngtsc/typecheck/src/reference_emit_environment.d.ts +50 -0
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +7 -8
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +2 -1
- package/src/ngtsc/typecheck/src/type_constructor.d.ts +3 -3
- package/bundles/chunk-54K5L6NG.js.map +0 -6
- package/bundles/chunk-6GUXR7F5.js.map +0 -6
- package/bundles/chunk-OYL5JDZA.js.map +0 -6
- package/bundles/chunk-RLZPCAR3.js.map +0 -6
- package/bundles/chunk-UHYH6BYB.js +0 -12
- package/bundles/chunk-UHYH6BYB.js.map +0 -6
- package/bundles/chunk-VOXK3NAL.js.map +0 -6
- /package/bundles/{chunk-QWNQBN2Z.js.map → chunk-5QWOGIJL.js.map} +0 -0
- /package/bundles/{chunk-TNVYLY25.js.map → chunk-YGXKICXB.js.map} +0 -0
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
translateExpression,
|
|
8
8
|
translateStatement,
|
|
9
9
|
translateType
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MFE4YVWE.js";
|
|
11
11
|
import {
|
|
12
|
+
AmbientImport,
|
|
12
13
|
ClassMemberKind,
|
|
13
14
|
ErrorCode,
|
|
14
15
|
FatalDiagnosticError,
|
|
@@ -30,7 +31,7 @@ import {
|
|
|
30
31
|
reflectObjectLiteral,
|
|
31
32
|
reflectTypeEntityToDeclaration,
|
|
32
33
|
typeNodeToValueExpr
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EFMKZSXJ.js";
|
|
34
35
|
import {
|
|
35
36
|
PerfEvent,
|
|
36
37
|
PerfPhase
|
|
@@ -1022,7 +1023,7 @@ function isVariableDeclarationDeclared(node) {
|
|
|
1022
1023
|
}
|
|
1023
1024
|
var EMPTY = {};
|
|
1024
1025
|
function joinModuleContext(existing, node, decl) {
|
|
1025
|
-
if (decl.viaModule
|
|
1026
|
+
if (typeof decl.viaModule === "string" && decl.viaModule !== existing.absoluteModuleName) {
|
|
1026
1027
|
return {
|
|
1027
1028
|
absoluteModuleName: decl.viaModule,
|
|
1028
1029
|
resolutionContext: node.getSourceFile().fileName
|
|
@@ -1374,9 +1375,11 @@ var ClassPropertyMapping = class {
|
|
|
1374
1375
|
const value = obj[classPropertyName];
|
|
1375
1376
|
let inputOrOutput;
|
|
1376
1377
|
if (typeof value === "string") {
|
|
1377
|
-
inputOrOutput = {
|
|
1378
|
-
|
|
1379
|
-
|
|
1378
|
+
inputOrOutput = {
|
|
1379
|
+
classPropertyName,
|
|
1380
|
+
bindingPropertyName: value,
|
|
1381
|
+
isSignal: false
|
|
1382
|
+
};
|
|
1380
1383
|
} else {
|
|
1381
1384
|
inputOrOutput = value;
|
|
1382
1385
|
}
|
|
@@ -1514,7 +1517,13 @@ function extractDirectiveTypeCheckMeta(node, inputs, reflector) {
|
|
|
1514
1517
|
const staticMembers = members.filter((member) => member.isStatic);
|
|
1515
1518
|
const ngTemplateGuards = staticMembers.map(extractTemplateGuard).filter((guard) => guard !== null);
|
|
1516
1519
|
const hasNgTemplateContextGuard = staticMembers.some((member) => member.kind === ClassMemberKind.Method && member.name === "ngTemplateContextGuard");
|
|
1517
|
-
const coercedInputFields = new Set(staticMembers.map(extractCoercedInput).filter((inputName) =>
|
|
1520
|
+
const coercedInputFields = new Set(staticMembers.map(extractCoercedInput).filter((inputName) => {
|
|
1521
|
+
var _a;
|
|
1522
|
+
if (inputName === null || ((_a = inputs.getByClassPropertyName(inputName)) == null ? void 0 : _a.isSignal)) {
|
|
1523
|
+
return false;
|
|
1524
|
+
}
|
|
1525
|
+
return true;
|
|
1526
|
+
}));
|
|
1518
1527
|
const restrictedInputFields = /* @__PURE__ */ new Set();
|
|
1519
1528
|
const stringLiteralInputFields = /* @__PURE__ */ new Set();
|
|
1520
1529
|
const undeclaredInputFields = /* @__PURE__ */ new Set();
|
|
@@ -1735,6 +1744,7 @@ function readInputsType(type) {
|
|
|
1735
1744
|
bindingPropertyName: stringValue,
|
|
1736
1745
|
classPropertyName,
|
|
1737
1746
|
required: false,
|
|
1747
|
+
isSignal: false,
|
|
1738
1748
|
transform: null
|
|
1739
1749
|
};
|
|
1740
1750
|
} else {
|
|
@@ -1746,6 +1756,7 @@ function readInputsType(type) {
|
|
|
1746
1756
|
classPropertyName,
|
|
1747
1757
|
bindingPropertyName: config.alias,
|
|
1748
1758
|
required: config.required,
|
|
1759
|
+
isSignal: !!config.isSignal,
|
|
1749
1760
|
transform: null
|
|
1750
1761
|
};
|
|
1751
1762
|
}
|
|
@@ -2084,7 +2095,8 @@ function resolveInput(bindingName, binding) {
|
|
|
2084
2095
|
bindingPropertyName: bindingName,
|
|
2085
2096
|
classPropertyName: binding.classPropertyName,
|
|
2086
2097
|
required: binding.required,
|
|
2087
|
-
transform: binding.transform
|
|
2098
|
+
transform: binding.transform,
|
|
2099
|
+
isSignal: binding.isSignal
|
|
2088
2100
|
};
|
|
2089
2101
|
}
|
|
2090
2102
|
function resolveOutput(bindingName) {
|
|
@@ -2555,7 +2567,7 @@ function compileInputTransformFields(inputs) {
|
|
|
2555
2567
|
|
|
2556
2568
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
2557
2569
|
import { compileClassDebugInfo, compileClassMetadata as compileClassMetadata3, compileComponentClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector as CssSelector2, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher2, ViewEncapsulation as ViewEncapsulation2, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
2558
|
-
import
|
|
2570
|
+
import ts25 from "typescript";
|
|
2559
2571
|
|
|
2560
2572
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
2561
2573
|
import ts10 from "typescript";
|
|
@@ -4357,7 +4369,61 @@ import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirect
|
|
|
4357
4369
|
|
|
4358
4370
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
4359
4371
|
import { createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr4, getSafePropertyAccessString, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
4372
|
+
import ts21 from "typescript";
|
|
4373
|
+
|
|
4374
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_function.mjs
|
|
4360
4375
|
import ts20 from "typescript";
|
|
4376
|
+
function tryParseInputInitializerAndOptions(member, reflector, coreModule) {
|
|
4377
|
+
if (member.value === null || !ts20.isCallExpression(member.value)) {
|
|
4378
|
+
return null;
|
|
4379
|
+
}
|
|
4380
|
+
const call = member.value;
|
|
4381
|
+
let target = extractPropertyTarget(call.expression);
|
|
4382
|
+
if (target === null) {
|
|
4383
|
+
return null;
|
|
4384
|
+
}
|
|
4385
|
+
if (target.text === "input" || target.text === "\u0275input") {
|
|
4386
|
+
if (!isReferenceToInputFunction(target, coreModule, reflector)) {
|
|
4387
|
+
return null;
|
|
4388
|
+
}
|
|
4389
|
+
const optionsNode2 = call.arguments[1];
|
|
4390
|
+
return { inputCall: call, optionsNode: optionsNode2, isRequired: false };
|
|
4391
|
+
}
|
|
4392
|
+
if (target.text !== "required" || !ts20.isPropertyAccessExpression(call.expression)) {
|
|
4393
|
+
return null;
|
|
4394
|
+
}
|
|
4395
|
+
const inputCall = call.expression;
|
|
4396
|
+
target = extractPropertyTarget(inputCall.expression);
|
|
4397
|
+
if (target === null || !isReferenceToInputFunction(target, coreModule, reflector)) {
|
|
4398
|
+
return null;
|
|
4399
|
+
}
|
|
4400
|
+
const optionsNode = call.arguments[0];
|
|
4401
|
+
return {
|
|
4402
|
+
inputCall: call,
|
|
4403
|
+
optionsNode,
|
|
4404
|
+
isRequired: true
|
|
4405
|
+
};
|
|
4406
|
+
}
|
|
4407
|
+
function extractPropertyTarget(node) {
|
|
4408
|
+
if (ts20.isPropertyAccessExpression(node) && ts20.isIdentifier(node.name)) {
|
|
4409
|
+
return node.name;
|
|
4410
|
+
} else if (ts20.isIdentifier(node)) {
|
|
4411
|
+
return node;
|
|
4412
|
+
}
|
|
4413
|
+
return null;
|
|
4414
|
+
}
|
|
4415
|
+
function isReferenceToInputFunction(target, coreModule, reflector) {
|
|
4416
|
+
const decl = reflector.getDeclarationOfIdentifier(target);
|
|
4417
|
+
if (decl === null || !ts20.isVariableDeclaration(decl.node) || decl.node.name === void 0 || !ts20.isIdentifier(decl.node.name)) {
|
|
4418
|
+
return false;
|
|
4419
|
+
}
|
|
4420
|
+
if (coreModule !== void 0 && decl.viaModule !== coreModule) {
|
|
4421
|
+
return false;
|
|
4422
|
+
}
|
|
4423
|
+
return decl.node.name.text === "input" || decl.node.name.text === "\u0275input";
|
|
4424
|
+
}
|
|
4425
|
+
|
|
4426
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
4361
4427
|
var EMPTY_OBJECT = {};
|
|
4362
4428
|
var QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
4363
4429
|
"ContentChild",
|
|
@@ -4373,7 +4439,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, refEmi
|
|
|
4373
4439
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `Incorrect number of arguments to @${decorator.name} decorator`);
|
|
4374
4440
|
} else {
|
|
4375
4441
|
const meta = unwrapExpression(decorator.args[0]);
|
|
4376
|
-
if (!
|
|
4442
|
+
if (!ts21.isObjectLiteralExpression(meta)) {
|
|
4377
4443
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, `@${decorator.name} argument must be an object literal`);
|
|
4378
4444
|
}
|
|
4379
4445
|
directive = reflectObjectLiteral(meta);
|
|
@@ -4385,7 +4451,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, refEmi
|
|
|
4385
4451
|
const decoratedElements = members.filter((member) => !member.isStatic && member.decorators !== null);
|
|
4386
4452
|
const coreModule = isCore ? void 0 : "@angular/core";
|
|
4387
4453
|
const inputsFromMeta = parseInputsArray(clazz, directive, evaluator, reflector, refEmitter);
|
|
4388
|
-
const inputsFromFields = parseInputFields(clazz,
|
|
4454
|
+
const inputsFromFields = parseInputFields(clazz, members, evaluator, reflector, refEmitter, coreModule);
|
|
4389
4455
|
const inputs = ClassPropertyMapping.fromMappedObject({ ...inputsFromMeta, ...inputsFromFields });
|
|
4390
4456
|
const outputsFromMeta = parseOutputsArray(directive, evaluator);
|
|
4391
4457
|
const outputsFromFields = parseOutputFields(filterToMembersWithDecorator(decoratedElements, "Output", coreModule), evaluator);
|
|
@@ -4511,7 +4577,7 @@ function extractQueryMetadata(exprNode, name, args, propertyName, reflector, eva
|
|
|
4511
4577
|
let emitDistinctChangesOnly = emitDistinctChangesOnlyDefaultValue;
|
|
4512
4578
|
if (args.length === 2) {
|
|
4513
4579
|
const optionsExpr = unwrapExpression(args[1]);
|
|
4514
|
-
if (!
|
|
4580
|
+
if (!ts21.isObjectLiteralExpression(optionsExpr)) {
|
|
4515
4581
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, optionsExpr, `@${name} options must be an object literal`);
|
|
4516
4582
|
}
|
|
4517
4583
|
const options = reflectObjectLiteral(optionsExpr);
|
|
@@ -4606,16 +4672,16 @@ function extractHostBindings(members, evaluator, coreModule, metadata) {
|
|
|
4606
4672
|
}
|
|
4607
4673
|
function extractQueriesFromDecorator(queryData, reflector, evaluator, isCore) {
|
|
4608
4674
|
const content = [], view = [];
|
|
4609
|
-
if (!
|
|
4675
|
+
if (!ts21.isObjectLiteralExpression(queryData)) {
|
|
4610
4676
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator queries metadata must be an object literal");
|
|
4611
4677
|
}
|
|
4612
4678
|
reflectObjectLiteral(queryData).forEach((queryExpr, propertyName) => {
|
|
4613
4679
|
queryExpr = unwrapExpression(queryExpr);
|
|
4614
|
-
if (!
|
|
4680
|
+
if (!ts21.isNewExpression(queryExpr)) {
|
|
4615
4681
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
4616
4682
|
}
|
|
4617
|
-
const queryType =
|
|
4618
|
-
if (!
|
|
4683
|
+
const queryType = ts21.isPropertyAccessExpression(queryExpr.expression) ? queryExpr.expression.name : queryExpr.expression;
|
|
4684
|
+
if (!ts21.isIdentifier(queryType)) {
|
|
4619
4685
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, queryData, "Decorator query metadata must be an instance of a query type");
|
|
4620
4686
|
}
|
|
4621
4687
|
const type = reflector.getImportOfIdentifier(queryType);
|
|
@@ -4644,7 +4710,7 @@ function parseDirectiveStyles(directive, evaluator, compilationMode) {
|
|
|
4644
4710
|
const relatedInformation = traceDynamicValue(expression, entry);
|
|
4645
4711
|
const chain = {
|
|
4646
4712
|
messageText: `Unknown identifier used as styles string: ${entry.node.getText()} (did you import this string from another file? This is not allowed in local compilation mode. Please either inline it or move it to a separate file and include it using 'styleUrl')`,
|
|
4647
|
-
category:
|
|
4713
|
+
category: ts21.DiagnosticCategory.Error,
|
|
4648
4714
|
code: 0
|
|
4649
4715
|
};
|
|
4650
4716
|
throw new FatalDiagnosticError(ErrorCode.LOCAL_COMPILATION_IMPORTED_STYLES_STRING, expression, chain, relatedInformation);
|
|
@@ -4740,7 +4806,8 @@ function parseInputsArray(clazz, decoratorMetadata, evaluator, reflector, refEmi
|
|
|
4740
4806
|
bindingPropertyName,
|
|
4741
4807
|
classPropertyName,
|
|
4742
4808
|
required: false,
|
|
4743
|
-
transform: null
|
|
4809
|
+
transform: null,
|
|
4810
|
+
isSignal: false
|
|
4744
4811
|
};
|
|
4745
4812
|
} else if (value instanceof Map) {
|
|
4746
4813
|
const name = value.get("name");
|
|
@@ -4755,12 +4822,13 @@ function parseInputsArray(clazz, decoratorMetadata, evaluator, reflector, refEmi
|
|
|
4755
4822
|
if (!(transformValue instanceof DynamicValue) && !(transformValue instanceof Reference)) {
|
|
4756
4823
|
throw createValueHasWrongTypeError(inputsField, transformValue, `Transform of value at position ${i} of @Directive.inputs array must be a function`);
|
|
4757
4824
|
}
|
|
4758
|
-
transform =
|
|
4825
|
+
transform = parseDecoratorInputTransformFunction(clazz, name, transformValue, reflector, refEmitter);
|
|
4759
4826
|
}
|
|
4760
4827
|
inputs[name] = {
|
|
4761
4828
|
classPropertyName: name,
|
|
4762
4829
|
bindingPropertyName: typeof alias === "string" ? alias : name,
|
|
4763
4830
|
required: required === true,
|
|
4831
|
+
isSignal: false,
|
|
4764
4832
|
transform
|
|
4765
4833
|
};
|
|
4766
4834
|
} else {
|
|
@@ -4769,35 +4837,90 @@ function parseInputsArray(clazz, decoratorMetadata, evaluator, reflector, refEmi
|
|
|
4769
4837
|
}
|
|
4770
4838
|
return inputs;
|
|
4771
4839
|
}
|
|
4772
|
-
function
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4840
|
+
function tryGetDecoratorOnMember(member, decoratorName, coreModule) {
|
|
4841
|
+
if (member.decorators === null) {
|
|
4842
|
+
return null;
|
|
4843
|
+
}
|
|
4844
|
+
for (const decorator of member.decorators) {
|
|
4845
|
+
if (decorator.import === null || decorator.import.name !== decoratorName) {
|
|
4846
|
+
continue;
|
|
4847
|
+
}
|
|
4848
|
+
if (coreModule !== void 0 && decorator.import.from !== coreModule) {
|
|
4849
|
+
continue;
|
|
4850
|
+
}
|
|
4851
|
+
return decorator;
|
|
4852
|
+
}
|
|
4853
|
+
return null;
|
|
4854
|
+
}
|
|
4855
|
+
function tryParseInputFieldMapping(clazz, member, evaluator, reflector, coreModule, refEmitter) {
|
|
4856
|
+
const classPropertyName = member.name;
|
|
4857
|
+
const decorator = tryGetDecoratorOnMember(member, "Input", coreModule);
|
|
4858
|
+
if (decorator !== null) {
|
|
4859
|
+
if (decorator.args !== null && decorator.args.length > 1) {
|
|
4860
|
+
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `@${decorator.name} can have at most one argument, got ${decorator.args.length} argument(s)`);
|
|
4861
|
+
}
|
|
4862
|
+
const optionsNode = decorator.args !== null && decorator.args.length === 1 ? decorator.args[0] : void 0;
|
|
4863
|
+
const options = optionsNode !== void 0 ? evaluator.evaluate(optionsNode) : null;
|
|
4864
|
+
const required = options instanceof Map ? options.get("required") === true : false;
|
|
4865
|
+
if (options !== null && typeof options !== "string" && !(options instanceof Map)) {
|
|
4866
|
+
throw createValueHasWrongTypeError(decorator.node, options, `@${decorator.name} decorator argument must resolve to a string or an object literal`);
|
|
4867
|
+
}
|
|
4868
|
+
let alias = null;
|
|
4869
|
+
if (typeof options === "string") {
|
|
4870
|
+
alias = options;
|
|
4871
|
+
} else if (options instanceof Map && typeof options.get("alias") === "string") {
|
|
4872
|
+
alias = options.get("alias");
|
|
4873
|
+
}
|
|
4874
|
+
const publicInputName = alias != null ? alias : classPropertyName;
|
|
4777
4875
|
let transform = null;
|
|
4778
|
-
if (options
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
} else if (options instanceof Map) {
|
|
4783
|
-
const aliasInConfig = options.get("alias");
|
|
4784
|
-
bindingPropertyName = typeof aliasInConfig === "string" ? aliasInConfig : classPropertyName;
|
|
4785
|
-
required = options.get("required") === true;
|
|
4786
|
-
if (options.has("transform")) {
|
|
4787
|
-
const transformValue = options.get("transform");
|
|
4788
|
-
if (!(transformValue instanceof DynamicValue) && !(transformValue instanceof Reference)) {
|
|
4789
|
-
throw createValueHasWrongTypeError(decorator.node, transformValue, `Input transform must be a function`);
|
|
4790
|
-
}
|
|
4791
|
-
transform = parseInputTransformFunction(clazz, classPropertyName, transformValue, reflector, refEmitter);
|
|
4876
|
+
if (options instanceof Map && options.has("transform")) {
|
|
4877
|
+
const transformValue = options.get("transform");
|
|
4878
|
+
if (!(transformValue instanceof DynamicValue) && !(transformValue instanceof Reference)) {
|
|
4879
|
+
throw createValueHasWrongTypeError(optionsNode, transformValue, `Input transform must be a function`);
|
|
4792
4880
|
}
|
|
4793
|
-
|
|
4794
|
-
throw createValueHasWrongTypeError(decorator.node, options, `@${decorator.name} decorator argument must resolve to a string or an object literal`);
|
|
4881
|
+
transform = parseDecoratorInputTransformFunction(clazz, classPropertyName, transformValue, reflector, refEmitter);
|
|
4795
4882
|
}
|
|
4796
|
-
|
|
4797
|
-
|
|
4883
|
+
return {
|
|
4884
|
+
isSignal: false,
|
|
4885
|
+
classPropertyName,
|
|
4886
|
+
bindingPropertyName: publicInputName,
|
|
4887
|
+
transform,
|
|
4888
|
+
required
|
|
4889
|
+
};
|
|
4890
|
+
}
|
|
4891
|
+
const signalInput = tryParseInputInitializerAndOptions(member, reflector, coreModule);
|
|
4892
|
+
if (signalInput !== null) {
|
|
4893
|
+
const optionsNode = signalInput.optionsNode;
|
|
4894
|
+
const options = optionsNode !== void 0 ? evaluator.evaluate(optionsNode) : null;
|
|
4895
|
+
let bindingPropertyName = classPropertyName;
|
|
4896
|
+
if (options instanceof Map && typeof options.get("alias") === "string") {
|
|
4897
|
+
bindingPropertyName = options.get("alias");
|
|
4898
|
+
}
|
|
4899
|
+
return {
|
|
4900
|
+
isSignal: true,
|
|
4901
|
+
classPropertyName,
|
|
4902
|
+
bindingPropertyName,
|
|
4903
|
+
required: signalInput.isRequired,
|
|
4904
|
+
transform: null
|
|
4905
|
+
};
|
|
4906
|
+
}
|
|
4907
|
+
return null;
|
|
4908
|
+
}
|
|
4909
|
+
function parseInputFields(clazz, members, evaluator, reflector, refEmitter, coreModule) {
|
|
4910
|
+
const inputs = {};
|
|
4911
|
+
for (const member of members) {
|
|
4912
|
+
if (member.isStatic) {
|
|
4913
|
+
continue;
|
|
4914
|
+
}
|
|
4915
|
+
const classPropertyName = member.name;
|
|
4916
|
+
const inputMapping = tryParseInputFieldMapping(clazz, member, evaluator, reflector, coreModule, refEmitter);
|
|
4917
|
+
if (inputMapping !== null) {
|
|
4918
|
+
inputs[classPropertyName] = inputMapping;
|
|
4919
|
+
}
|
|
4920
|
+
}
|
|
4798
4921
|
return inputs;
|
|
4799
4922
|
}
|
|
4800
|
-
function
|
|
4923
|
+
function parseDecoratorInputTransformFunction(clazz, classPropertyName, value, reflector, refEmitter) {
|
|
4801
4924
|
var _a;
|
|
4802
4925
|
const definition = reflector.getDefinitionOfFunction(value.node);
|
|
4803
4926
|
if (definition === null) {
|
|
@@ -4824,7 +4947,7 @@ function parseInputTransformFunction(clazz, classPropertyName, value, reflector,
|
|
|
4824
4947
|
if (!firstParam) {
|
|
4825
4948
|
return {
|
|
4826
4949
|
node,
|
|
4827
|
-
type: new Reference(
|
|
4950
|
+
type: new Reference(ts21.factory.createKeywordTypeNode(ts21.SyntaxKind.UnknownKeyword))
|
|
4828
4951
|
};
|
|
4829
4952
|
}
|
|
4830
4953
|
if (!firstParam.type) {
|
|
@@ -4839,11 +4962,11 @@ function parseInputTransformFunction(clazz, classPropertyName, value, reflector,
|
|
|
4839
4962
|
}
|
|
4840
4963
|
function assertEmittableInputType(type, contextFile, reflector, refEmitter) {
|
|
4841
4964
|
(function walk(node) {
|
|
4842
|
-
if (
|
|
4965
|
+
if (ts21.isTypeReferenceNode(node) && ts21.isIdentifier(node.typeName)) {
|
|
4843
4966
|
const declaration = reflector.getDeclarationOfIdentifier(node.typeName);
|
|
4844
4967
|
if (declaration !== null) {
|
|
4845
4968
|
if (declaration.node.getSourceFile() !== contextFile) {
|
|
4846
|
-
const emittedType = refEmitter.emit(new Reference(declaration.node), contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowRelativeDtsImports);
|
|
4969
|
+
const emittedType = refEmitter.emit(new Reference(declaration.node, declaration.viaModule === AmbientImport ? AmbientImport : null), contextFile, ImportFlags.NoAliasing | ImportFlags.AllowTypeImports | ImportFlags.AllowRelativeDtsImports | ImportFlags.AllowAmbientReferences);
|
|
4847
4970
|
assertSuccessfulReferenceEmit(emittedType, node, "type");
|
|
4848
4971
|
} else if (!reflector.isStaticallyExported(declaration.node)) {
|
|
4849
4972
|
throw new FatalDiagnosticError(ErrorCode.SYMBOL_NOT_EXPORTED, type, `Symbol must be exported in order to be used as the type of an Input transform function`, [makeRelatedInformation(declaration.node, `The symbol is declared here.`)]);
|
|
@@ -4944,7 +5067,8 @@ function toR3InputMetadata(mapping) {
|
|
|
4944
5067
|
classPropertyName: mapping.classPropertyName,
|
|
4945
5068
|
bindingPropertyName: mapping.bindingPropertyName,
|
|
4946
5069
|
required: mapping.required,
|
|
4947
|
-
transformFunction: mapping.transform !== null ? new WrappedNodeExpr5(mapping.transform.node) : null
|
|
5070
|
+
transformFunction: mapping.transform !== null ? new WrappedNodeExpr5(mapping.transform.node) : null,
|
|
5071
|
+
isSignal: mapping.isSignal
|
|
4948
5072
|
};
|
|
4949
5073
|
}
|
|
4950
5074
|
|
|
@@ -4992,7 +5116,7 @@ function isInputMappingEqual(current, previous) {
|
|
|
4992
5116
|
return isInputOrOutputEqual(current, previous) && current.required === previous.required;
|
|
4993
5117
|
}
|
|
4994
5118
|
function isInputOrOutputEqual(current, previous) {
|
|
4995
|
-
return current.classPropertyName === previous.classPropertyName && current.bindingPropertyName === previous.bindingPropertyName;
|
|
5119
|
+
return current.classPropertyName === previous.classPropertyName && current.bindingPropertyName === previous.bindingPropertyName && current.isSignal === previous.isSignal;
|
|
4996
5120
|
}
|
|
4997
5121
|
function isTypeCheckMetaEqual(current, previous) {
|
|
4998
5122
|
if (current.hasNgTemplateContextGuard !== previous.hasNgTemplateContextGuard) {
|
|
@@ -5204,16 +5328,16 @@ var DirectiveDecoratorHandler = class {
|
|
|
5204
5328
|
|
|
5205
5329
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
5206
5330
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget2, FunctionExpr, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
5207
|
-
import
|
|
5331
|
+
import ts23 from "typescript";
|
|
5208
5332
|
|
|
5209
5333
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.mjs
|
|
5210
|
-
import
|
|
5334
|
+
import ts22 from "typescript";
|
|
5211
5335
|
function createModuleWithProvidersResolver(reflector, isCore) {
|
|
5212
5336
|
function _reflectModuleFromTypeParam(type, node) {
|
|
5213
|
-
if (!
|
|
5337
|
+
if (!ts22.isTypeReferenceNode(type)) {
|
|
5214
5338
|
return null;
|
|
5215
5339
|
}
|
|
5216
|
-
const typeName = type && (
|
|
5340
|
+
const typeName = type && (ts22.isIdentifier(type.typeName) && type.typeName || ts22.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
5217
5341
|
if (typeName === null) {
|
|
5218
5342
|
return null;
|
|
5219
5343
|
}
|
|
@@ -5225,7 +5349,7 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
5225
5349
|
return null;
|
|
5226
5350
|
}
|
|
5227
5351
|
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
5228
|
-
const parent =
|
|
5352
|
+
const parent = ts22.isMethodDeclaration(node) && ts22.isClassDeclaration(node.parent) ? node.parent : null;
|
|
5229
5353
|
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
5230
5354
|
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.`);
|
|
5231
5355
|
}
|
|
@@ -5233,13 +5357,13 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
5233
5357
|
return typeNodeToValueExpr(arg);
|
|
5234
5358
|
}
|
|
5235
5359
|
function _reflectModuleFromLiteralType(type) {
|
|
5236
|
-
if (!
|
|
5360
|
+
if (!ts22.isIntersectionTypeNode(type)) {
|
|
5237
5361
|
return null;
|
|
5238
5362
|
}
|
|
5239
5363
|
for (const t of type.types) {
|
|
5240
|
-
if (
|
|
5364
|
+
if (ts22.isTypeLiteralNode(t)) {
|
|
5241
5365
|
for (const m of t.members) {
|
|
5242
|
-
const ngModuleType =
|
|
5366
|
+
const ngModuleType = ts22.isPropertySignature(m) && ts22.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
5243
5367
|
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
5244
5368
|
if (ngModuleExpression) {
|
|
5245
5369
|
return ngModuleExpression;
|
|
@@ -5383,8 +5507,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
5383
5507
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
5384
5508
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, `Incorrect number of arguments to @NgModule decorator`);
|
|
5385
5509
|
}
|
|
5386
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
5387
|
-
if (!
|
|
5510
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts23.factory.createObjectLiteralExpression([]);
|
|
5511
|
+
if (!ts23.isObjectLiteralExpression(meta)) {
|
|
5388
5512
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
5389
5513
|
}
|
|
5390
5514
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -5444,7 +5568,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
5444
5568
|
id = new WrappedNodeExpr7(idExpr);
|
|
5445
5569
|
} else {
|
|
5446
5570
|
const diag = makeDiagnostic(ErrorCode.WARN_NGMODULE_ID_UNNECESSARY, idExpr, `Using 'module.id' for NgModule.id is a common anti-pattern that is ignored by the Angular compiler.`);
|
|
5447
|
-
diag.category =
|
|
5571
|
+
diag.category = ts23.DiagnosticCategory.Warning;
|
|
5448
5572
|
diagnostics.push(diag);
|
|
5449
5573
|
}
|
|
5450
5574
|
}
|
|
@@ -5496,16 +5620,16 @@ var NgModuleDecoratorHandler = class {
|
|
|
5496
5620
|
}
|
|
5497
5621
|
const rawProviders = ngModule.has("providers") ? ngModule.get("providers") : null;
|
|
5498
5622
|
let wrappedProviders = null;
|
|
5499
|
-
if (rawProviders !== null && (!
|
|
5623
|
+
if (rawProviders !== null && (!ts23.isArrayLiteralExpression(rawProviders) || rawProviders.elements.length > 0)) {
|
|
5500
5624
|
wrappedProviders = new WrappedNodeExpr7(this.annotateForClosureCompiler ? wrapFunctionExpressionsInParens(rawProviders) : rawProviders);
|
|
5501
5625
|
}
|
|
5502
5626
|
const topLevelImports = [];
|
|
5503
5627
|
if (this.compilationMode !== CompilationMode.LOCAL && ngModule.has("imports")) {
|
|
5504
5628
|
const rawImports2 = unwrapExpression(ngModule.get("imports"));
|
|
5505
5629
|
let topLevelExpressions = [];
|
|
5506
|
-
if (
|
|
5630
|
+
if (ts23.isArrayLiteralExpression(rawImports2)) {
|
|
5507
5631
|
for (const element of rawImports2.elements) {
|
|
5508
|
-
if (
|
|
5632
|
+
if (ts23.isSpreadElement(element)) {
|
|
5509
5633
|
topLevelExpressions.push(element.expression);
|
|
5510
5634
|
continue;
|
|
5511
5635
|
}
|
|
@@ -5537,7 +5661,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
5537
5661
|
if (exp === null) {
|
|
5538
5662
|
continue;
|
|
5539
5663
|
}
|
|
5540
|
-
if (
|
|
5664
|
+
if (ts23.isArrayLiteralExpression(exp)) {
|
|
5541
5665
|
if (exp.elements) {
|
|
5542
5666
|
injectorMetadata.imports.push(...exp.elements.map((n) => new WrappedNodeExpr7(n)));
|
|
5543
5667
|
}
|
|
@@ -5830,7 +5954,7 @@ function isNgModule(node, compilation) {
|
|
|
5830
5954
|
return !compilation.dependencies.some((dep) => dep.ref.node === node);
|
|
5831
5955
|
}
|
|
5832
5956
|
function isModuleIdExpression(expr) {
|
|
5833
|
-
return
|
|
5957
|
+
return ts23.isPropertyAccessExpression(expr) && ts23.isIdentifier(expr.expression) && expr.expression.text === "module" && expr.name.text === "id";
|
|
5834
5958
|
}
|
|
5835
5959
|
function makeStandaloneBootstrapDiagnostic(ngModuleClass, bootstrappedClassRef, rawBootstrapExpr) {
|
|
5836
5960
|
const componentClassName = bootstrappedClassRef.node.name.text;
|
|
@@ -5867,7 +5991,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5867
5991
|
|
|
5868
5992
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/resources.mjs
|
|
5869
5993
|
import { DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, ParseSourceFile as ParseSourceFile2, parseTemplate } from "@angular/compiler";
|
|
5870
|
-
import
|
|
5994
|
+
import ts24 from "typescript";
|
|
5871
5995
|
function getTemplateDeclarationNodeForError(declaration) {
|
|
5872
5996
|
return declaration.isInline ? declaration.expression : declaration.templateUrlExpression;
|
|
5873
5997
|
}
|
|
@@ -5879,7 +6003,7 @@ function extractTemplate(node, template, evaluator, depTracker, resourceLoader,
|
|
|
5879
6003
|
let sourceMapping;
|
|
5880
6004
|
let escapedString = false;
|
|
5881
6005
|
let sourceMapUrl;
|
|
5882
|
-
if (
|
|
6006
|
+
if (ts24.isStringLiteral(template.expression) || ts24.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
5883
6007
|
sourceParseRange = getTemplateRange(template.expression);
|
|
5884
6008
|
sourceStr = template.expression.getSourceFile().text;
|
|
5885
6009
|
templateContent = template.expression.text;
|
|
@@ -5895,7 +6019,7 @@ function extractTemplate(node, template, evaluator, depTracker, resourceLoader,
|
|
|
5895
6019
|
const relatedInformation = traceDynamicValue(template.expression, resolvedTemplate);
|
|
5896
6020
|
const chain = {
|
|
5897
6021
|
messageText: `Unknown identifier used as template string: ${template.expression.getText()} (did you import this string from another file? This is not allowed in local compilation mode. Please either inline it or move it to a separate file and include it using 'templateUrl')`,
|
|
5898
|
-
category:
|
|
6022
|
+
category: ts24.DiagnosticCategory.Error,
|
|
5899
6023
|
code: 0
|
|
5900
6024
|
};
|
|
5901
6025
|
throw new FatalDiagnosticError(ErrorCode.LOCAL_COMPILATION_IMPORTED_TEMPLATE_STRING, template.expression, chain, relatedInformation);
|
|
@@ -6064,7 +6188,7 @@ function preloadAndParseTemplate(evaluator, resourceLoader, depTracker, preanaly
|
|
|
6064
6188
|
}
|
|
6065
6189
|
function getTemplateRange(templateExpr) {
|
|
6066
6190
|
const startPos = templateExpr.getStart() + 1;
|
|
6067
|
-
const { line, character } =
|
|
6191
|
+
const { line, character } = ts24.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
6068
6192
|
return {
|
|
6069
6193
|
startPos,
|
|
6070
6194
|
startLine: line,
|
|
@@ -6097,7 +6221,7 @@ function transformDecoratorResources(dec, component, styles, template) {
|
|
|
6097
6221
|
const metadata = new Map(component);
|
|
6098
6222
|
if (metadata.has("templateUrl")) {
|
|
6099
6223
|
metadata.delete("templateUrl");
|
|
6100
|
-
metadata.set("template",
|
|
6224
|
+
metadata.set("template", ts24.factory.createStringLiteral(template.content));
|
|
6101
6225
|
}
|
|
6102
6226
|
if (metadata.has("styleUrls") || metadata.has("styleUrl") || metadata.has("styles")) {
|
|
6103
6227
|
metadata.delete("styles");
|
|
@@ -6106,20 +6230,20 @@ function transformDecoratorResources(dec, component, styles, template) {
|
|
|
6106
6230
|
if (styles.length > 0) {
|
|
6107
6231
|
const styleNodes = styles.reduce((result, style) => {
|
|
6108
6232
|
if (style.trim().length > 0) {
|
|
6109
|
-
result.push(
|
|
6233
|
+
result.push(ts24.factory.createStringLiteral(style));
|
|
6110
6234
|
}
|
|
6111
6235
|
return result;
|
|
6112
6236
|
}, []);
|
|
6113
6237
|
if (styleNodes.length > 0) {
|
|
6114
|
-
metadata.set("styles",
|
|
6238
|
+
metadata.set("styles", ts24.factory.createArrayLiteralExpression(styleNodes));
|
|
6115
6239
|
}
|
|
6116
6240
|
}
|
|
6117
6241
|
}
|
|
6118
6242
|
const newMetadataFields = [];
|
|
6119
6243
|
for (const [name, value] of metadata.entries()) {
|
|
6120
|
-
newMetadataFields.push(
|
|
6244
|
+
newMetadataFields.push(ts24.factory.createPropertyAssignment(name, value));
|
|
6121
6245
|
}
|
|
6122
|
-
return { ...dec, args: [
|
|
6246
|
+
return { ...dec, args: [ts24.factory.createObjectLiteralExpression(newMetadataFields)] };
|
|
6123
6247
|
}
|
|
6124
6248
|
function extractComponentStyleUrls(evaluator, component) {
|
|
6125
6249
|
const styleUrlsExpr = component.get("styleUrls");
|
|
@@ -6145,9 +6269,9 @@ function extractComponentStyleUrls(evaluator, component) {
|
|
|
6145
6269
|
}
|
|
6146
6270
|
function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
6147
6271
|
const styleUrls = [];
|
|
6148
|
-
if (
|
|
6272
|
+
if (ts24.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
6149
6273
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
6150
|
-
if (
|
|
6274
|
+
if (ts24.isSpreadElement(styleUrlExpr)) {
|
|
6151
6275
|
styleUrls.push(...extractStyleUrlsFromExpression(evaluator, styleUrlExpr.expression));
|
|
6152
6276
|
} else {
|
|
6153
6277
|
const styleUrl = evaluator.evaluate(styleUrlExpr);
|
|
@@ -6179,18 +6303,18 @@ function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
|
6179
6303
|
function extractStyleResources(resourceLoader, component, containingFile) {
|
|
6180
6304
|
const styles = /* @__PURE__ */ new Set();
|
|
6181
6305
|
function stringLiteralElements(array) {
|
|
6182
|
-
return array.elements.filter((e) =>
|
|
6306
|
+
return array.elements.filter((e) => ts24.isStringLiteralLike(e));
|
|
6183
6307
|
}
|
|
6184
6308
|
const styleUrlExpr = component.get("styleUrl");
|
|
6185
6309
|
const styleUrlsExpr = component.get("styleUrls");
|
|
6186
|
-
if (styleUrlsExpr !== void 0 &&
|
|
6310
|
+
if (styleUrlsExpr !== void 0 && ts24.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
6187
6311
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
6188
6312
|
const resource = stringLiteralUrlToResource(resourceLoader, expression, containingFile);
|
|
6189
6313
|
if (resource !== null) {
|
|
6190
6314
|
styles.add(resource);
|
|
6191
6315
|
}
|
|
6192
6316
|
}
|
|
6193
|
-
} else if (styleUrlExpr !== void 0 &&
|
|
6317
|
+
} else if (styleUrlExpr !== void 0 && ts24.isStringLiteralLike(styleUrlExpr)) {
|
|
6194
6318
|
const resource = stringLiteralUrlToResource(resourceLoader, styleUrlExpr, containingFile);
|
|
6195
6319
|
if (resource !== null) {
|
|
6196
6320
|
styles.add(resource);
|
|
@@ -6198,11 +6322,11 @@ function extractStyleResources(resourceLoader, component, containingFile) {
|
|
|
6198
6322
|
}
|
|
6199
6323
|
const stylesExpr = component.get("styles");
|
|
6200
6324
|
if (stylesExpr !== void 0) {
|
|
6201
|
-
if (
|
|
6325
|
+
if (ts24.isArrayLiteralExpression(stylesExpr)) {
|
|
6202
6326
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
6203
6327
|
styles.add({ path: null, expression });
|
|
6204
6328
|
}
|
|
6205
|
-
} else if (
|
|
6329
|
+
} else if (ts24.isStringLiteralLike(stylesExpr)) {
|
|
6206
6330
|
styles.add({ path: null, expression: stylesExpr });
|
|
6207
6331
|
}
|
|
6208
6332
|
}
|
|
@@ -6721,7 +6845,7 @@ var ComponentDecoratorHandler = class {
|
|
|
6721
6845
|
}
|
|
6722
6846
|
typeCheck(ctx, node, meta) {
|
|
6723
6847
|
var _a;
|
|
6724
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
6848
|
+
if (this.typeCheckScopeRegistry === null || !ts25.isClassDeclaration(node)) {
|
|
6725
6849
|
return;
|
|
6726
6850
|
}
|
|
6727
6851
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -7076,10 +7200,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7076
7200
|
this.resolveDeferTriggers(deferBlock, deferBlock.prefetchTriggers, componentBoundTarget, triggerElements);
|
|
7077
7201
|
resolutionData.deferBlocks.set(deferBlock, { deps, triggerElements });
|
|
7078
7202
|
}
|
|
7079
|
-
if (analysisData.meta.isStandalone && analysisData.rawImports !== null &&
|
|
7203
|
+
if (analysisData.meta.isStandalone && analysisData.rawImports !== null && ts25.isArrayLiteralExpression(analysisData.rawImports)) {
|
|
7080
7204
|
for (const element of analysisData.rawImports.elements) {
|
|
7081
7205
|
const node = tryUnwrapForwardRef(element, this.reflector) || element;
|
|
7082
|
-
if (!
|
|
7206
|
+
if (!ts25.isIdentifier(node)) {
|
|
7083
7207
|
continue;
|
|
7084
7208
|
}
|
|
7085
7209
|
const imp = this.reflector.getImportOfIdentifier(node);
|
|
@@ -7150,7 +7274,7 @@ function validateStandaloneImports(importRefs, importExpr, metaReader, scopeRead
|
|
|
7150
7274
|
|
|
7151
7275
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
7152
7276
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr9 } from "@angular/compiler";
|
|
7153
|
-
import
|
|
7277
|
+
import ts26 from "typescript";
|
|
7154
7278
|
var InjectableDecoratorHandler = class {
|
|
7155
7279
|
constructor(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, perf, includeClassMetadata, compilationMode, errorOnDuplicateProv = true) {
|
|
7156
7280
|
this.reflector = reflector;
|
|
@@ -7264,7 +7388,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
7264
7388
|
};
|
|
7265
7389
|
} else if (decorator.args.length === 1) {
|
|
7266
7390
|
const metaNode = decorator.args[0];
|
|
7267
|
-
if (!
|
|
7391
|
+
if (!ts26.isObjectLiteralExpression(metaNode)) {
|
|
7268
7392
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
7269
7393
|
}
|
|
7270
7394
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -7272,7 +7396,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
7272
7396
|
let deps = void 0;
|
|
7273
7397
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
7274
7398
|
const depsExpr = meta.get("deps");
|
|
7275
|
-
if (!
|
|
7399
|
+
if (!ts26.isArrayLiteralExpression(depsExpr)) {
|
|
7276
7400
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
7277
7401
|
}
|
|
7278
7402
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -7357,12 +7481,12 @@ function getDep(dep, reflector) {
|
|
|
7357
7481
|
}
|
|
7358
7482
|
return true;
|
|
7359
7483
|
}
|
|
7360
|
-
if (
|
|
7484
|
+
if (ts26.isArrayLiteralExpression(dep)) {
|
|
7361
7485
|
dep.elements.forEach((el) => {
|
|
7362
7486
|
let isDecorator = false;
|
|
7363
|
-
if (
|
|
7487
|
+
if (ts26.isIdentifier(el)) {
|
|
7364
7488
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
7365
|
-
} else if (
|
|
7489
|
+
} else if (ts26.isNewExpression(el) && ts26.isIdentifier(el.expression)) {
|
|
7366
7490
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
7367
7491
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
7368
7492
|
}
|
|
@@ -7376,7 +7500,7 @@ function getDep(dep, reflector) {
|
|
|
7376
7500
|
|
|
7377
7501
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
7378
7502
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5 } from "@angular/compiler";
|
|
7379
|
-
import
|
|
7503
|
+
import ts27 from "typescript";
|
|
7380
7504
|
var PipeSymbol = class extends SemanticSymbol {
|
|
7381
7505
|
constructor(decl, name) {
|
|
7382
7506
|
super(decl);
|
|
@@ -7433,7 +7557,7 @@ var PipeDecoratorHandler = class {
|
|
|
7433
7557
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, decorator.node, "@Pipe must have exactly one argument");
|
|
7434
7558
|
}
|
|
7435
7559
|
const meta = unwrapExpression(decorator.args[0]);
|
|
7436
|
-
if (!
|
|
7560
|
+
if (!ts27.isObjectLiteralExpression(meta)) {
|
|
7437
7561
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
7438
7562
|
}
|
|
7439
7563
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -7620,4 +7744,4 @@ export {
|
|
|
7620
7744
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7621
7745
|
* found in the LICENSE file at https://angular.io/license
|
|
7622
7746
|
*/
|
|
7623
|
-
//# sourceMappingURL=chunk-
|
|
7747
|
+
//# sourceMappingURL=chunk-U4EFDEE4.js.map
|