@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,12 +13,13 @@ import {
|
|
|
13
13
|
resolve,
|
|
14
14
|
stripExtension,
|
|
15
15
|
toRelativeImport
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-676MI6WZ.js";
|
|
17
17
|
|
|
18
18
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
|
|
19
19
|
import ts from "typescript";
|
|
20
20
|
var TS = /\.tsx?$/i;
|
|
21
21
|
var D_TS = /\.d\.ts$/i;
|
|
22
|
+
var PARSED_TS_VERSION = parseFloat(ts.versionMajorMinor);
|
|
22
23
|
function isSymbolWithValueDeclaration(symbol) {
|
|
23
24
|
return symbol != null && symbol.valueDeclaration !== void 0 && symbol.declarations !== void 0;
|
|
24
25
|
}
|
|
@@ -109,6 +110,9 @@ function toUnredirectedSourceFile(sf) {
|
|
|
109
110
|
}
|
|
110
111
|
return redirectInfo.unredirected;
|
|
111
112
|
}
|
|
113
|
+
function createExportSpecifier(propertyName, name, isTypeOnly = false) {
|
|
114
|
+
return PARSED_TS_VERSION > 4.4 ? ts.createExportSpecifier(isTypeOnly, propertyName, name) : ts.createExportSpecifier(propertyName, name);
|
|
115
|
+
}
|
|
112
116
|
|
|
113
117
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/references.mjs
|
|
114
118
|
var Reference = class {
|
|
@@ -180,8 +184,143 @@ import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
|
180
184
|
import { ExternalExpr, ExternalReference, WrappedNodeExpr } from "@angular/compiler";
|
|
181
185
|
import ts3 from "typescript";
|
|
182
186
|
|
|
183
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/
|
|
187
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
188
|
+
var ErrorCode;
|
|
189
|
+
(function(ErrorCode2) {
|
|
190
|
+
ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
|
|
191
|
+
ErrorCode2[ErrorCode2["DECORATOR_ARITY_WRONG"] = 1002] = "DECORATOR_ARITY_WRONG";
|
|
192
|
+
ErrorCode2[ErrorCode2["DECORATOR_NOT_CALLED"] = 1003] = "DECORATOR_NOT_CALLED";
|
|
193
|
+
ErrorCode2[ErrorCode2["DECORATOR_ON_ANONYMOUS_CLASS"] = 1004] = "DECORATOR_ON_ANONYMOUS_CLASS";
|
|
194
|
+
ErrorCode2[ErrorCode2["DECORATOR_UNEXPECTED"] = 1005] = "DECORATOR_UNEXPECTED";
|
|
195
|
+
ErrorCode2[ErrorCode2["DECORATOR_COLLISION"] = 1006] = "DECORATOR_COLLISION";
|
|
196
|
+
ErrorCode2[ErrorCode2["VALUE_HAS_WRONG_TYPE"] = 1010] = "VALUE_HAS_WRONG_TYPE";
|
|
197
|
+
ErrorCode2[ErrorCode2["VALUE_NOT_LITERAL"] = 1011] = "VALUE_NOT_LITERAL";
|
|
198
|
+
ErrorCode2[ErrorCode2["COMPONENT_MISSING_TEMPLATE"] = 2001] = "COMPONENT_MISSING_TEMPLATE";
|
|
199
|
+
ErrorCode2[ErrorCode2["PIPE_MISSING_NAME"] = 2002] = "PIPE_MISSING_NAME";
|
|
200
|
+
ErrorCode2[ErrorCode2["PARAM_MISSING_TOKEN"] = 2003] = "PARAM_MISSING_TOKEN";
|
|
201
|
+
ErrorCode2[ErrorCode2["DIRECTIVE_MISSING_SELECTOR"] = 2004] = "DIRECTIVE_MISSING_SELECTOR";
|
|
202
|
+
ErrorCode2[ErrorCode2["UNDECORATED_PROVIDER"] = 2005] = "UNDECORATED_PROVIDER";
|
|
203
|
+
ErrorCode2[ErrorCode2["DIRECTIVE_INHERITS_UNDECORATED_CTOR"] = 2006] = "DIRECTIVE_INHERITS_UNDECORATED_CTOR";
|
|
204
|
+
ErrorCode2[ErrorCode2["UNDECORATED_CLASS_USING_ANGULAR_FEATURES"] = 2007] = "UNDECORATED_CLASS_USING_ANGULAR_FEATURES";
|
|
205
|
+
ErrorCode2[ErrorCode2["COMPONENT_RESOURCE_NOT_FOUND"] = 2008] = "COMPONENT_RESOURCE_NOT_FOUND";
|
|
206
|
+
ErrorCode2[ErrorCode2["COMPONENT_INVALID_SHADOW_DOM_SELECTOR"] = 2009] = "COMPONENT_INVALID_SHADOW_DOM_SELECTOR";
|
|
207
|
+
ErrorCode2[ErrorCode2["SYMBOL_NOT_EXPORTED"] = 3001] = "SYMBOL_NOT_EXPORTED";
|
|
208
|
+
ErrorCode2[ErrorCode2["SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME"] = 3002] = "SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME";
|
|
209
|
+
ErrorCode2[ErrorCode2["IMPORT_CYCLE_DETECTED"] = 3003] = "IMPORT_CYCLE_DETECTED";
|
|
210
|
+
ErrorCode2[ErrorCode2["IMPORT_GENERATION_FAILURE"] = 3004] = "IMPORT_GENERATION_FAILURE";
|
|
211
|
+
ErrorCode2[ErrorCode2["CONFIG_FLAT_MODULE_NO_INDEX"] = 4001] = "CONFIG_FLAT_MODULE_NO_INDEX";
|
|
212
|
+
ErrorCode2[ErrorCode2["CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK"] = 4002] = "CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK";
|
|
213
|
+
ErrorCode2[ErrorCode2["CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES"] = 4003] = "CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES";
|
|
214
|
+
ErrorCode2[ErrorCode2["CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL"] = 4004] = "CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL";
|
|
215
|
+
ErrorCode2[ErrorCode2["CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK"] = 4005] = "CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK";
|
|
216
|
+
ErrorCode2[ErrorCode2["HOST_BINDING_PARSE_ERROR"] = 5001] = "HOST_BINDING_PARSE_ERROR";
|
|
217
|
+
ErrorCode2[ErrorCode2["TEMPLATE_PARSE_ERROR"] = 5002] = "TEMPLATE_PARSE_ERROR";
|
|
218
|
+
ErrorCode2[ErrorCode2["NGMODULE_INVALID_DECLARATION"] = 6001] = "NGMODULE_INVALID_DECLARATION";
|
|
219
|
+
ErrorCode2[ErrorCode2["NGMODULE_INVALID_IMPORT"] = 6002] = "NGMODULE_INVALID_IMPORT";
|
|
220
|
+
ErrorCode2[ErrorCode2["NGMODULE_INVALID_EXPORT"] = 6003] = "NGMODULE_INVALID_EXPORT";
|
|
221
|
+
ErrorCode2[ErrorCode2["NGMODULE_INVALID_REEXPORT"] = 6004] = "NGMODULE_INVALID_REEXPORT";
|
|
222
|
+
ErrorCode2[ErrorCode2["NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC"] = 6005] = "NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC";
|
|
223
|
+
ErrorCode2[ErrorCode2["NGMODULE_REEXPORT_NAME_COLLISION"] = 6006] = "NGMODULE_REEXPORT_NAME_COLLISION";
|
|
224
|
+
ErrorCode2[ErrorCode2["NGMODULE_DECLARATION_NOT_UNIQUE"] = 6007] = "NGMODULE_DECLARATION_NOT_UNIQUE";
|
|
225
|
+
ErrorCode2[ErrorCode2["NGMODULE_VE_DEPENDENCY_ON_IVY_LIB"] = 6999] = "NGMODULE_VE_DEPENDENCY_ON_IVY_LIB";
|
|
226
|
+
ErrorCode2[ErrorCode2["SCHEMA_INVALID_ELEMENT"] = 8001] = "SCHEMA_INVALID_ELEMENT";
|
|
227
|
+
ErrorCode2[ErrorCode2["SCHEMA_INVALID_ATTRIBUTE"] = 8002] = "SCHEMA_INVALID_ATTRIBUTE";
|
|
228
|
+
ErrorCode2[ErrorCode2["MISSING_REFERENCE_TARGET"] = 8003] = "MISSING_REFERENCE_TARGET";
|
|
229
|
+
ErrorCode2[ErrorCode2["MISSING_PIPE"] = 8004] = "MISSING_PIPE";
|
|
230
|
+
ErrorCode2[ErrorCode2["WRITE_TO_READ_ONLY_VARIABLE"] = 8005] = "WRITE_TO_READ_ONLY_VARIABLE";
|
|
231
|
+
ErrorCode2[ErrorCode2["DUPLICATE_VARIABLE_DECLARATION"] = 8006] = "DUPLICATE_VARIABLE_DECLARATION";
|
|
232
|
+
ErrorCode2[ErrorCode2["SPLIT_TWO_WAY_BINDING"] = 8007] = "SPLIT_TWO_WAY_BINDING";
|
|
233
|
+
ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
|
|
234
|
+
ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
|
|
235
|
+
ErrorCode2[ErrorCode2["INLINE_TCB_REQUIRED"] = 8900] = "INLINE_TCB_REQUIRED";
|
|
236
|
+
ErrorCode2[ErrorCode2["INLINE_TYPE_CTOR_REQUIRED"] = 8901] = "INLINE_TYPE_CTOR_REQUIRED";
|
|
237
|
+
ErrorCode2[ErrorCode2["INJECTABLE_DUPLICATE_PROV"] = 9001] = "INJECTABLE_DUPLICATE_PROV";
|
|
238
|
+
ErrorCode2[ErrorCode2["SUGGEST_STRICT_TEMPLATES"] = 10001] = "SUGGEST_STRICT_TEMPLATES";
|
|
239
|
+
ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
|
|
240
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
241
|
+
|
|
242
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
243
|
+
var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
244
|
+
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
245
|
+
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
246
|
+
ErrorCode.PARAM_MISSING_TOKEN,
|
|
247
|
+
ErrorCode.SCHEMA_INVALID_ELEMENT,
|
|
248
|
+
ErrorCode.SCHEMA_INVALID_ATTRIBUTE,
|
|
249
|
+
ErrorCode.MISSING_REFERENCE_TARGET,
|
|
250
|
+
ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR
|
|
251
|
+
]);
|
|
252
|
+
|
|
253
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
184
254
|
import ts2 from "typescript";
|
|
255
|
+
|
|
256
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
257
|
+
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
258
|
+
function replaceTsWithNgInErrors(errors) {
|
|
259
|
+
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
260
|
+
}
|
|
261
|
+
function ngErrorCode(code) {
|
|
262
|
+
return parseInt("-99" + code);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
266
|
+
var FatalDiagnosticError = class {
|
|
267
|
+
constructor(code, node, message, relatedInformation) {
|
|
268
|
+
this.code = code;
|
|
269
|
+
this.node = node;
|
|
270
|
+
this.message = message;
|
|
271
|
+
this.relatedInformation = relatedInformation;
|
|
272
|
+
this._isFatalDiagnosticError = true;
|
|
273
|
+
}
|
|
274
|
+
toDiagnostic() {
|
|
275
|
+
return makeDiagnostic(this.code, this.node, this.message, this.relatedInformation);
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
function makeDiagnostic(code, node, messageText, relatedInformation) {
|
|
279
|
+
node = ts2.getOriginalNode(node);
|
|
280
|
+
return {
|
|
281
|
+
category: ts2.DiagnosticCategory.Error,
|
|
282
|
+
code: ngErrorCode(code),
|
|
283
|
+
file: ts2.getOriginalNode(node).getSourceFile(),
|
|
284
|
+
start: node.getStart(void 0, false),
|
|
285
|
+
length: node.getWidth(),
|
|
286
|
+
messageText,
|
|
287
|
+
relatedInformation
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function makeDiagnosticChain(messageText, next) {
|
|
291
|
+
return {
|
|
292
|
+
category: ts2.DiagnosticCategory.Message,
|
|
293
|
+
code: 0,
|
|
294
|
+
messageText,
|
|
295
|
+
next
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function makeRelatedInformation(node, messageText) {
|
|
299
|
+
node = ts2.getOriginalNode(node);
|
|
300
|
+
return {
|
|
301
|
+
category: ts2.DiagnosticCategory.Message,
|
|
302
|
+
code: 0,
|
|
303
|
+
file: node.getSourceFile(),
|
|
304
|
+
start: node.getStart(),
|
|
305
|
+
length: node.getWidth(),
|
|
306
|
+
messageText
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function isFatalDiagnosticError(err) {
|
|
310
|
+
return err._isFatalDiagnosticError === true;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
|
|
314
|
+
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
|
|
315
|
+
|
|
316
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.mjs
|
|
317
|
+
var ExtendedTemplateDiagnosticName;
|
|
318
|
+
(function(ExtendedTemplateDiagnosticName2) {
|
|
319
|
+
ExtendedTemplateDiagnosticName2["INVALID_BANANA_IN_BOX"] = "invalidBananaInBox";
|
|
320
|
+
ExtendedTemplateDiagnosticName2["NULLISH_COALESCING_NOT_NULLABLE"] = "nullishCoalescingNotNullable";
|
|
321
|
+
})(ExtendedTemplateDiagnosticName || (ExtendedTemplateDiagnosticName = {}));
|
|
322
|
+
|
|
323
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
|
|
185
324
|
function findExportedNameOfNode(target, file, reflector) {
|
|
186
325
|
const exports = reflector.getExportsOfModule(file);
|
|
187
326
|
if (exports === null) {
|
|
@@ -198,9 +337,6 @@ function findExportedNameOfNode(target, file, reflector) {
|
|
|
198
337
|
}
|
|
199
338
|
foundExportName = exportName;
|
|
200
339
|
}
|
|
201
|
-
if (foundExportName === null) {
|
|
202
|
-
throw new Error(`Failed to find exported name of node (${target.getText()}) in '${file.fileName}'.`);
|
|
203
|
-
}
|
|
204
340
|
return foundExportName;
|
|
205
341
|
}
|
|
206
342
|
|
|
@@ -212,6 +348,13 @@ var ImportFlags;
|
|
|
212
348
|
ImportFlags2[ImportFlags2["NoAliasing"] = 2] = "NoAliasing";
|
|
213
349
|
ImportFlags2[ImportFlags2["AllowTypeImports"] = 4] = "AllowTypeImports";
|
|
214
350
|
})(ImportFlags || (ImportFlags = {}));
|
|
351
|
+
function assertSuccessfulReferenceEmit(result, origin, typeKind) {
|
|
352
|
+
if (result.kind === 0) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
const message = makeDiagnosticChain(`Unable to import ${typeKind} ${nodeNameForError(result.ref.node)}.`, [makeDiagnosticChain(result.reason)]);
|
|
356
|
+
throw new FatalDiagnosticError(ErrorCode.IMPORT_GENERATION_FAILURE, origin, message, [makeRelatedInformation(result.ref.node, `The ${typeKind} is declared here.`)]);
|
|
357
|
+
}
|
|
215
358
|
var ReferenceEmitter = class {
|
|
216
359
|
constructor(strategies) {
|
|
217
360
|
this.strategies = strategies;
|
|
@@ -223,7 +366,12 @@ var ReferenceEmitter = class {
|
|
|
223
366
|
return emitted;
|
|
224
367
|
}
|
|
225
368
|
}
|
|
226
|
-
|
|
369
|
+
return {
|
|
370
|
+
kind: 1,
|
|
371
|
+
ref,
|
|
372
|
+
context,
|
|
373
|
+
reason: `Unable to write a reference to ${nodeNameForError(ref.node)}.`
|
|
374
|
+
};
|
|
227
375
|
}
|
|
228
376
|
};
|
|
229
377
|
var LocalIdentifierStrategy = class {
|
|
@@ -234,6 +382,7 @@ var LocalIdentifierStrategy = class {
|
|
|
234
382
|
}
|
|
235
383
|
if (!isDeclaration(ref.node) && refSf === context) {
|
|
236
384
|
return {
|
|
385
|
+
kind: 0,
|
|
237
386
|
expression: new WrappedNodeExpr(ref.node),
|
|
238
387
|
importedFile: null
|
|
239
388
|
};
|
|
@@ -241,6 +390,7 @@ var LocalIdentifierStrategy = class {
|
|
|
241
390
|
const identifier = ref.getIdentityIn(context);
|
|
242
391
|
if (identifier !== null) {
|
|
243
392
|
return {
|
|
393
|
+
kind: 0,
|
|
244
394
|
expression: new WrappedNodeExpr(identifier),
|
|
245
395
|
importedFile: null
|
|
246
396
|
};
|
|
@@ -255,7 +405,7 @@ var AbsoluteModuleStrategy = class {
|
|
|
255
405
|
this.checker = checker;
|
|
256
406
|
this.moduleResolver = moduleResolver;
|
|
257
407
|
this.reflectionHost = reflectionHost;
|
|
258
|
-
this.moduleExportsCache = new Map();
|
|
408
|
+
this.moduleExportsCache = /* @__PURE__ */ new Map();
|
|
259
409
|
}
|
|
260
410
|
emit(ref, context, importFlags) {
|
|
261
411
|
if (ref.bestGuessOwningModule === null) {
|
|
@@ -267,11 +417,24 @@ var AbsoluteModuleStrategy = class {
|
|
|
267
417
|
}
|
|
268
418
|
const { specifier, resolutionContext } = ref.bestGuessOwningModule;
|
|
269
419
|
const exports = this.getExportsOfModule(specifier, resolutionContext);
|
|
270
|
-
if (exports === null
|
|
271
|
-
|
|
420
|
+
if (exports.module === null) {
|
|
421
|
+
return {
|
|
422
|
+
kind: 1,
|
|
423
|
+
ref,
|
|
424
|
+
context,
|
|
425
|
+
reason: `The module '${specifier}' could not be found.`
|
|
426
|
+
};
|
|
427
|
+
} else if (exports.exportMap === null || !exports.exportMap.has(ref.node)) {
|
|
428
|
+
return {
|
|
429
|
+
kind: 1,
|
|
430
|
+
ref,
|
|
431
|
+
context,
|
|
432
|
+
reason: `The symbol is not exported from ${exports.module.fileName} (module '${specifier}').`
|
|
433
|
+
};
|
|
272
434
|
}
|
|
273
435
|
const symbolName = exports.exportMap.get(ref.node);
|
|
274
436
|
return {
|
|
437
|
+
kind: 0,
|
|
275
438
|
expression: new ExternalExpr(new ExternalReference(specifier, symbolName)),
|
|
276
439
|
importedFile: exports.module
|
|
277
440
|
};
|
|
@@ -285,13 +448,13 @@ var AbsoluteModuleStrategy = class {
|
|
|
285
448
|
enumerateExportsOfModule(specifier, fromFile) {
|
|
286
449
|
const entryPointFile = this.moduleResolver.resolveModule(specifier, fromFile);
|
|
287
450
|
if (entryPointFile === null) {
|
|
288
|
-
return null;
|
|
451
|
+
return { module: null, exportMap: null };
|
|
289
452
|
}
|
|
290
453
|
const exports = this.reflectionHost.getExportsOfModule(entryPointFile);
|
|
291
454
|
if (exports === null) {
|
|
292
|
-
return null;
|
|
455
|
+
return { module: entryPointFile, exportMap: null };
|
|
293
456
|
}
|
|
294
|
-
const exportMap = new Map();
|
|
457
|
+
const exportMap = /* @__PURE__ */ new Map();
|
|
295
458
|
for (const [name, declaration] of exports) {
|
|
296
459
|
if (exportMap.has(declaration.node)) {
|
|
297
460
|
const existingExport = exportMap.get(declaration.node);
|
|
@@ -313,7 +476,12 @@ var LogicalProjectStrategy = class {
|
|
|
313
476
|
const destSf = getSourceFile(ref.node);
|
|
314
477
|
const destPath = this.logicalFs.logicalPathOfSf(destSf);
|
|
315
478
|
if (destPath === null) {
|
|
316
|
-
return
|
|
479
|
+
return {
|
|
480
|
+
kind: 1,
|
|
481
|
+
ref,
|
|
482
|
+
context,
|
|
483
|
+
reason: `The file ${destSf.fileName} is outside of the configured 'rootDir'.`
|
|
484
|
+
};
|
|
317
485
|
}
|
|
318
486
|
const originPath = this.logicalFs.logicalPathOfSf(context);
|
|
319
487
|
if (originPath === null) {
|
|
@@ -324,10 +492,16 @@ var LogicalProjectStrategy = class {
|
|
|
324
492
|
}
|
|
325
493
|
const name = findExportedNameOfNode(ref.node, destSf, this.reflector);
|
|
326
494
|
if (name === null) {
|
|
327
|
-
return
|
|
495
|
+
return {
|
|
496
|
+
kind: 1,
|
|
497
|
+
ref,
|
|
498
|
+
context,
|
|
499
|
+
reason: `The symbol is not exported from ${destSf.fileName}.`
|
|
500
|
+
};
|
|
328
501
|
}
|
|
329
502
|
const moduleName = LogicalProjectPath.relativePathBetween(originPath, destPath);
|
|
330
503
|
return {
|
|
504
|
+
kind: 0,
|
|
331
505
|
expression: new ExternalExpr({ moduleName, name }),
|
|
332
506
|
importedFile: destSf
|
|
333
507
|
};
|
|
@@ -342,7 +516,19 @@ var RelativePathStrategy = class {
|
|
|
342
516
|
const relativePath = relative(dirname(absoluteFromSourceFile(context)), absoluteFromSourceFile(destSf));
|
|
343
517
|
const moduleName = toRelativeImport(stripExtension(relativePath));
|
|
344
518
|
const name = findExportedNameOfNode(ref.node, destSf, this.reflector);
|
|
345
|
-
|
|
519
|
+
if (name === null) {
|
|
520
|
+
return {
|
|
521
|
+
kind: 1,
|
|
522
|
+
ref,
|
|
523
|
+
context,
|
|
524
|
+
reason: `The symbol is not exported from ${destSf.fileName}.`
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
return {
|
|
528
|
+
kind: 0,
|
|
529
|
+
expression: new ExternalExpr({ moduleName, name }),
|
|
530
|
+
importedFile: destSf
|
|
531
|
+
};
|
|
346
532
|
}
|
|
347
533
|
};
|
|
348
534
|
var UnifiedModulesStrategy = class {
|
|
@@ -358,6 +544,7 @@ var UnifiedModulesStrategy = class {
|
|
|
358
544
|
}
|
|
359
545
|
const moduleName = this.unifiedModulesHost.fileNameToModuleName(destSf.fileName, context.fileName);
|
|
360
546
|
return {
|
|
547
|
+
kind: 0,
|
|
361
548
|
expression: new ExternalExpr({ moduleName, name }),
|
|
362
549
|
importedFile: destSf
|
|
363
550
|
};
|
|
@@ -423,7 +610,11 @@ var AliasStrategy = class {
|
|
|
423
610
|
if (importMode & ImportFlags.NoAliasing || ref.alias === null) {
|
|
424
611
|
return null;
|
|
425
612
|
}
|
|
426
|
-
return {
|
|
613
|
+
return {
|
|
614
|
+
kind: 0,
|
|
615
|
+
expression: ref.alias,
|
|
616
|
+
importedFile: "unknown"
|
|
617
|
+
};
|
|
427
618
|
}
|
|
428
619
|
};
|
|
429
620
|
|
|
@@ -448,7 +639,7 @@ var NoopImportRewriter = class {
|
|
|
448
639
|
return specifier;
|
|
449
640
|
}
|
|
450
641
|
};
|
|
451
|
-
var CORE_SUPPORTED_SYMBOLS = new Map([
|
|
642
|
+
var CORE_SUPPORTED_SYMBOLS = /* @__PURE__ */ new Map([
|
|
452
643
|
["\u0275\u0275defineInjectable", "\u0275\u0275defineInjectable"],
|
|
453
644
|
["\u0275\u0275defineInjector", "\u0275\u0275defineInjector"],
|
|
454
645
|
["\u0275\u0275defineNgModule", "\u0275\u0275defineNgModule"],
|
|
@@ -506,12 +697,12 @@ function getDefaultImportDeclaration(expr) {
|
|
|
506
697
|
}
|
|
507
698
|
var DefaultImportTracker = class {
|
|
508
699
|
constructor() {
|
|
509
|
-
this.sourceFileToUsedImports = new Map();
|
|
700
|
+
this.sourceFileToUsedImports = /* @__PURE__ */ new Map();
|
|
510
701
|
}
|
|
511
702
|
recordUsedImport(importDecl) {
|
|
512
703
|
const sf = getSourceFile(importDecl);
|
|
513
704
|
if (!this.sourceFileToUsedImports.has(sf)) {
|
|
514
|
-
this.sourceFileToUsedImports.set(sf, new Set());
|
|
705
|
+
this.sourceFileToUsedImports.set(sf, /* @__PURE__ */ new Set());
|
|
515
706
|
}
|
|
516
707
|
this.sourceFileToUsedImports.get(sf).add(importDecl);
|
|
517
708
|
}
|
|
@@ -570,34 +761,29 @@ var Context = class {
|
|
|
570
761
|
};
|
|
571
762
|
|
|
572
763
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
|
|
573
|
-
import
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
UnaryOperator
|
|
578
|
-
} from "@angular/compiler";
|
|
579
|
-
var UNARY_OPERATORS = new Map([
|
|
580
|
-
[UnaryOperator.Minus, "-"],
|
|
581
|
-
[UnaryOperator.Plus, "+"]
|
|
764
|
+
import * as o from "@angular/compiler";
|
|
765
|
+
var UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
766
|
+
[o.UnaryOperator.Minus, "-"],
|
|
767
|
+
[o.UnaryOperator.Plus, "+"]
|
|
582
768
|
]);
|
|
583
|
-
var BINARY_OPERATORS = new Map([
|
|
584
|
-
[BinaryOperator.And, "&&"],
|
|
585
|
-
[BinaryOperator.Bigger, ">"],
|
|
586
|
-
[BinaryOperator.BiggerEquals, ">="],
|
|
587
|
-
[BinaryOperator.BitwiseAnd, "&"],
|
|
588
|
-
[BinaryOperator.Divide, "/"],
|
|
589
|
-
[BinaryOperator.Equals, "=="],
|
|
590
|
-
[BinaryOperator.Identical, "==="],
|
|
591
|
-
[BinaryOperator.Lower, "<"],
|
|
592
|
-
[BinaryOperator.LowerEquals, "<="],
|
|
593
|
-
[BinaryOperator.Minus, "-"],
|
|
594
|
-
[BinaryOperator.Modulo, "%"],
|
|
595
|
-
[BinaryOperator.Multiply, "*"],
|
|
596
|
-
[BinaryOperator.NotEquals, "!="],
|
|
597
|
-
[BinaryOperator.NotIdentical, "!=="],
|
|
598
|
-
[BinaryOperator.Or, "||"],
|
|
599
|
-
[BinaryOperator.Plus, "+"],
|
|
600
|
-
[BinaryOperator.NullishCoalesce, "??"]
|
|
769
|
+
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
770
|
+
[o.BinaryOperator.And, "&&"],
|
|
771
|
+
[o.BinaryOperator.Bigger, ">"],
|
|
772
|
+
[o.BinaryOperator.BiggerEquals, ">="],
|
|
773
|
+
[o.BinaryOperator.BitwiseAnd, "&"],
|
|
774
|
+
[o.BinaryOperator.Divide, "/"],
|
|
775
|
+
[o.BinaryOperator.Equals, "=="],
|
|
776
|
+
[o.BinaryOperator.Identical, "==="],
|
|
777
|
+
[o.BinaryOperator.Lower, "<"],
|
|
778
|
+
[o.BinaryOperator.LowerEquals, "<="],
|
|
779
|
+
[o.BinaryOperator.Minus, "-"],
|
|
780
|
+
[o.BinaryOperator.Modulo, "%"],
|
|
781
|
+
[o.BinaryOperator.Multiply, "*"],
|
|
782
|
+
[o.BinaryOperator.NotEquals, "!="],
|
|
783
|
+
[o.BinaryOperator.NotIdentical, "!=="],
|
|
784
|
+
[o.BinaryOperator.Or, "||"],
|
|
785
|
+
[o.BinaryOperator.Plus, "+"],
|
|
786
|
+
[o.BinaryOperator.NullishCoalesce, "??"]
|
|
601
787
|
]);
|
|
602
788
|
var ExpressionTranslatorVisitor = class {
|
|
603
789
|
constructor(factory, imports, options) {
|
|
@@ -610,7 +796,7 @@ var ExpressionTranslatorVisitor = class {
|
|
|
610
796
|
}
|
|
611
797
|
visitDeclareVarStmt(stmt, context) {
|
|
612
798
|
var _a;
|
|
613
|
-
const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(StmtModifier.Final) ? "const" : "let";
|
|
799
|
+
const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(o.StmtModifier.Final) ? "const" : "let";
|
|
614
800
|
return this.attachComments(this.factory.createVariableDeclaration(stmt.name, (_a = stmt.value) == null ? void 0 : _a.visitExpression(this, context.withExpressionMode), varType), stmt.leadingComments);
|
|
615
801
|
}
|
|
616
802
|
visitDeclareFunctionStmt(stmt, context) {
|
|
@@ -622,18 +808,9 @@ var ExpressionTranslatorVisitor = class {
|
|
|
622
808
|
visitReturnStmt(stmt, context) {
|
|
623
809
|
return this.attachComments(this.factory.createReturnStatement(stmt.value.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
|
|
624
810
|
}
|
|
625
|
-
visitDeclareClassStmt(_stmt, _context) {
|
|
626
|
-
throw new Error("Method not implemented.");
|
|
627
|
-
}
|
|
628
811
|
visitIfStmt(stmt, context) {
|
|
629
812
|
return this.attachComments(this.factory.createIfStatement(stmt.condition.visitExpression(this, context), this.factory.createBlock(this.visitStatements(stmt.trueCase, context.withStatementMode)), stmt.falseCase.length > 0 ? this.factory.createBlock(this.visitStatements(stmt.falseCase, context.withStatementMode)) : null), stmt.leadingComments);
|
|
630
813
|
}
|
|
631
|
-
visitTryCatchStmt(_stmt, _context) {
|
|
632
|
-
throw new Error("Method not implemented.");
|
|
633
|
-
}
|
|
634
|
-
visitThrowStmt(stmt, context) {
|
|
635
|
-
return this.attachComments(this.factory.createThrowStatement(stmt.error.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
|
|
636
|
-
}
|
|
637
814
|
visitReadVarExpr(ast, _context) {
|
|
638
815
|
const identifier = this.factory.createIdentifier(ast.name);
|
|
639
816
|
this.setSourceMapRange(identifier, ast.sourceSpan);
|
|
@@ -721,7 +898,7 @@ var ExpressionTranslatorVisitor = class {
|
|
|
721
898
|
}
|
|
722
899
|
visitConditionalExpr(ast, context) {
|
|
723
900
|
let cond = ast.condition.visitExpression(this, context);
|
|
724
|
-
if (ast.condition instanceof ConditionalExpr) {
|
|
901
|
+
if (ast.condition instanceof o.ConditionalExpr) {
|
|
725
902
|
cond = this.factory.createParenthesizedExpression(cond);
|
|
726
903
|
}
|
|
727
904
|
return this.factory.createConditional(cond, ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context));
|
|
@@ -729,19 +906,13 @@ var ExpressionTranslatorVisitor = class {
|
|
|
729
906
|
visitNotExpr(ast, context) {
|
|
730
907
|
return this.factory.createUnaryExpression("!", ast.condition.visitExpression(this, context));
|
|
731
908
|
}
|
|
732
|
-
visitAssertNotNullExpr(ast, context) {
|
|
733
|
-
return ast.condition.visitExpression(this, context);
|
|
734
|
-
}
|
|
735
|
-
visitCastExpr(ast, context) {
|
|
736
|
-
return ast.value.visitExpression(this, context);
|
|
737
|
-
}
|
|
738
909
|
visitFunctionExpr(ast, context) {
|
|
739
910
|
var _a;
|
|
740
911
|
return this.factory.createFunctionExpression((_a = ast.name) != null ? _a : null, ast.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(ast.statements, context)));
|
|
741
912
|
}
|
|
742
913
|
visitBinaryOperatorExpr(ast, context) {
|
|
743
914
|
if (!BINARY_OPERATORS.has(ast.operator)) {
|
|
744
|
-
throw new Error(`Unknown binary operator: ${BinaryOperator[ast.operator]}`);
|
|
915
|
+
throw new Error(`Unknown binary operator: ${o.BinaryOperator[ast.operator]}`);
|
|
745
916
|
}
|
|
746
917
|
return this.factory.createBinaryExpression(ast.lhs.visitExpression(this, context), BINARY_OPERATORS.get(ast.operator), ast.rhs.visitExpression(this, context));
|
|
747
918
|
}
|
|
@@ -776,7 +947,7 @@ var ExpressionTranslatorVisitor = class {
|
|
|
776
947
|
}
|
|
777
948
|
visitUnaryOperatorExpr(ast, context) {
|
|
778
949
|
if (!UNARY_OPERATORS.has(ast.operator)) {
|
|
779
|
-
throw new Error(`Unknown unary operator: ${UnaryOperator[ast.operator]}`);
|
|
950
|
+
throw new Error(`Unknown unary operator: ${o.UnaryOperator[ast.operator]}`);
|
|
780
951
|
}
|
|
781
952
|
return this.factory.createUnaryExpression(UNARY_OPERATORS.get(ast.operator), ast.expr.visitExpression(this, context));
|
|
782
953
|
}
|
|
@@ -819,7 +990,7 @@ var ImportManager = class {
|
|
|
819
990
|
constructor(rewriter = new NoopImportRewriter(), prefix = "i") {
|
|
820
991
|
this.rewriter = rewriter;
|
|
821
992
|
this.prefix = prefix;
|
|
822
|
-
this.specifierToIdentifier = new Map();
|
|
993
|
+
this.specifierToIdentifier = /* @__PURE__ */ new Map();
|
|
823
994
|
this.nextIndex = 0;
|
|
824
995
|
}
|
|
825
996
|
generateNamespaceImport(moduleName) {
|
|
@@ -850,9 +1021,7 @@ var ImportManager = class {
|
|
|
850
1021
|
};
|
|
851
1022
|
|
|
852
1023
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
853
|
-
import
|
|
854
|
-
BuiltinTypeName
|
|
855
|
-
} from "@angular/compiler";
|
|
1024
|
+
import * as o2 from "@angular/compiler";
|
|
856
1025
|
import ts6 from "typescript";
|
|
857
1026
|
function translateType(type, imports) {
|
|
858
1027
|
return type.visitType(new TypeTranslatorVisitor(imports), new Context(false));
|
|
@@ -863,19 +1032,19 @@ var TypeTranslatorVisitor = class {
|
|
|
863
1032
|
}
|
|
864
1033
|
visitBuiltinType(type, context) {
|
|
865
1034
|
switch (type.name) {
|
|
866
|
-
case BuiltinTypeName.Bool:
|
|
1035
|
+
case o2.BuiltinTypeName.Bool:
|
|
867
1036
|
return ts6.createKeywordTypeNode(ts6.SyntaxKind.BooleanKeyword);
|
|
868
|
-
case BuiltinTypeName.Dynamic:
|
|
1037
|
+
case o2.BuiltinTypeName.Dynamic:
|
|
869
1038
|
return ts6.createKeywordTypeNode(ts6.SyntaxKind.AnyKeyword);
|
|
870
|
-
case BuiltinTypeName.Int:
|
|
871
|
-
case BuiltinTypeName.Number:
|
|
1039
|
+
case o2.BuiltinTypeName.Int:
|
|
1040
|
+
case o2.BuiltinTypeName.Number:
|
|
872
1041
|
return ts6.createKeywordTypeNode(ts6.SyntaxKind.NumberKeyword);
|
|
873
|
-
case BuiltinTypeName.String:
|
|
1042
|
+
case o2.BuiltinTypeName.String:
|
|
874
1043
|
return ts6.createKeywordTypeNode(ts6.SyntaxKind.StringKeyword);
|
|
875
|
-
case BuiltinTypeName.None:
|
|
1044
|
+
case o2.BuiltinTypeName.None:
|
|
876
1045
|
return ts6.createKeywordTypeNode(ts6.SyntaxKind.NeverKeyword);
|
|
877
1046
|
default:
|
|
878
|
-
throw new Error(`Unsupported builtin type: ${BuiltinTypeName[type.name]}`);
|
|
1047
|
+
throw new Error(`Unsupported builtin type: ${o2.BuiltinTypeName[type.name]}`);
|
|
879
1048
|
}
|
|
880
1049
|
}
|
|
881
1050
|
visitExpressionType(type, context) {
|
|
@@ -956,12 +1125,6 @@ var TypeTranslatorVisitor = class {
|
|
|
956
1125
|
visitNotExpr(ast, context) {
|
|
957
1126
|
throw new Error("Method not implemented.");
|
|
958
1127
|
}
|
|
959
|
-
visitAssertNotNullExpr(ast, context) {
|
|
960
|
-
throw new Error("Method not implemented.");
|
|
961
|
-
}
|
|
962
|
-
visitCastExpr(ast, context) {
|
|
963
|
-
throw new Error("Method not implemented.");
|
|
964
|
-
}
|
|
965
1128
|
visitFunctionExpr(ast, context) {
|
|
966
1129
|
throw new Error("Method not implemented.");
|
|
967
1130
|
}
|
|
@@ -1067,7 +1230,7 @@ var VAR_TYPES = {
|
|
|
1067
1230
|
var TypeScriptAstFactory = class {
|
|
1068
1231
|
constructor(annotateForClosureCompiler) {
|
|
1069
1232
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
1070
|
-
this.externalSourceFiles = new Map();
|
|
1233
|
+
this.externalSourceFiles = /* @__PURE__ */ new Map();
|
|
1071
1234
|
this.attachComments = attachComments;
|
|
1072
1235
|
this.createArrayLiteral = ts7.createArrayLiteral;
|
|
1073
1236
|
this.createConditional = ts7.createConditional;
|
|
@@ -1209,6 +1372,16 @@ function translateStatement(statement, imports, options = {}) {
|
|
|
1209
1372
|
}
|
|
1210
1373
|
|
|
1211
1374
|
export {
|
|
1375
|
+
ErrorCode,
|
|
1376
|
+
COMPILER_ERRORS_WITH_GUIDES,
|
|
1377
|
+
replaceTsWithNgInErrors,
|
|
1378
|
+
ngErrorCode,
|
|
1379
|
+
FatalDiagnosticError,
|
|
1380
|
+
makeDiagnostic,
|
|
1381
|
+
makeRelatedInformation,
|
|
1382
|
+
isFatalDiagnosticError,
|
|
1383
|
+
ERROR_DETAILS_PAGE_BASE_URL,
|
|
1384
|
+
ExtendedTemplateDiagnosticName,
|
|
1212
1385
|
isSymbolWithValueDeclaration,
|
|
1213
1386
|
isDtsPath,
|
|
1214
1387
|
isNonDeclarationTsPath,
|
|
@@ -1223,7 +1396,9 @@ export {
|
|
|
1223
1396
|
nodeDebugInfo,
|
|
1224
1397
|
isAssignment,
|
|
1225
1398
|
toUnredirectedSourceFile,
|
|
1399
|
+
createExportSpecifier,
|
|
1226
1400
|
ImportFlags,
|
|
1401
|
+
assertSuccessfulReferenceEmit,
|
|
1227
1402
|
ReferenceEmitter,
|
|
1228
1403
|
LocalIdentifierStrategy,
|
|
1229
1404
|
AbsoluteModuleStrategy,
|
|
@@ -1247,7 +1422,6 @@ export {
|
|
|
1247
1422
|
ImportManager,
|
|
1248
1423
|
ExpressionTranslatorVisitor,
|
|
1249
1424
|
translateType,
|
|
1250
|
-
attachComments,
|
|
1251
1425
|
translateExpression,
|
|
1252
1426
|
translateStatement
|
|
1253
1427
|
};
|
|
@@ -1258,4 +1432,4 @@ export {
|
|
|
1258
1432
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1259
1433
|
* found in the LICENSE file at https://angular.io/license
|
|
1260
1434
|
*/
|
|
1261
|
-
//# sourceMappingURL=chunk-
|
|
1435
|
+
//# sourceMappingURL=chunk-QBU7RUKB.js.map
|