@angular/compiler-cli 13.0.0-rc.3 → 13.0.3
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/index.js +857 -897
- package/bundles/index.js.map +2 -2
- package/bundles/linker/babel/index.js +67 -67
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +59 -59
- package/bundles/linker/index.js.map +1 -1
- package/bundles/ngcc/index.js +1256 -1225
- package/bundles/ngcc/index.js.map +2 -2
- package/bundles/ngcc/main-ngcc.js +1257 -1226
- package/bundles/ngcc/main-ngcc.js.map +2 -2
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +761 -743
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +2 -2
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +8 -8
- package/bundles/private/bazel.js +2 -2
- package/bundles/private/localize.js +14 -14
- package/bundles/private/migrations.js +84 -64
- package/bundles/private/migrations.js.map +1 -1
- package/bundles/private/tooling.js +11 -11
- package/bundles/private/tooling.js.map +1 -1
- package/bundles/src/bin/ng_xi18n.js +867 -907
- package/bundles/src/bin/ng_xi18n.js.map +2 -2
- package/bundles/src/bin/ngc.js +865 -905
- package/bundles/src/bin/ngc.js.map +2 -2
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +2 -2
- package/linker/src/file_linker/translator.d.ts +1 -1
- 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/entry_point.d.ts +5 -0
- package/ngcc/src/packages/transformer.d.ts +0 -2
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +1 -1
- 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 +2 -2
- package/src/ngtsc/partial_evaluator/src/builtin.d.ts +5 -0
- package/src/ngtsc/typecheck/api/checker.d.ts +1 -1
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +1 -1
- package/ngcc/src/analysis/switch_marker_analyzer.d.ts +0 -35
- package/src/ngtsc/switch/index.d.ts +0 -9
- package/src/ngtsc/switch/src/switch.d.ts +0 -10
package/bundles/index.js
CHANGED
|
@@ -30,13 +30,13 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
30
30
|
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
// bazel-out/
|
|
33
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
|
|
34
34
|
import {
|
|
35
35
|
EOL
|
|
36
36
|
} from "os";
|
|
37
37
|
import ts from "typescript";
|
|
38
38
|
|
|
39
|
-
// bazel-out/
|
|
39
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
|
|
40
40
|
var InvalidFileSystem = class {
|
|
41
41
|
exists(path7) {
|
|
42
42
|
throw makeError();
|
|
@@ -124,7 +124,7 @@ function makeError() {
|
|
|
124
124
|
return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
// bazel-out/
|
|
127
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/util.mjs
|
|
128
128
|
var TS_DTS_JS_EXTENSION = /(?:\.d)?\.ts$|\.js$/;
|
|
129
129
|
function normalizeSeparators(path7) {
|
|
130
130
|
return path7.replace(/\\/g, "/");
|
|
@@ -140,7 +140,7 @@ function getSourceFileOrError(program, fileName) {
|
|
|
140
140
|
return sf;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
// bazel-out/
|
|
143
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
|
|
144
144
|
var fs = new InvalidFileSystem();
|
|
145
145
|
function getFileSystem() {
|
|
146
146
|
return fs;
|
|
@@ -197,7 +197,7 @@ function toRelativeImport(relativePath) {
|
|
|
197
197
|
return isLocalRelativePath(relativePath) ? `./${relativePath}` : relativePath;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
// bazel-out/
|
|
200
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
|
|
201
201
|
var NgtscCompilerHost = class {
|
|
202
202
|
constructor(fs5, options = {}) {
|
|
203
203
|
this.fs = fs5;
|
|
@@ -250,7 +250,7 @@ var NgtscCompilerHost = class {
|
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
252
|
|
|
253
|
-
// bazel-out/
|
|
253
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/logical.mjs
|
|
254
254
|
var LogicalProjectPath = {
|
|
255
255
|
relativePathBetween: function(from, to) {
|
|
256
256
|
const relativePath = relative(dirname(resolve(from)), resolve(to));
|
|
@@ -296,7 +296,7 @@ function isWithinBasePath(base, path7) {
|
|
|
296
296
|
return isLocalRelativePath(relative(base, path7));
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
// bazel-out/
|
|
299
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
|
|
300
300
|
import {
|
|
301
301
|
copyFileSync,
|
|
302
302
|
existsSync,
|
|
@@ -441,20 +441,20 @@ function toggleCase(str) {
|
|
|
441
441
|
return str.replace(/\w/g, (ch) => ch.toUpperCase() === ch ? ch.toLowerCase() : ch.toUpperCase());
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
// bazel-out/
|
|
444
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/index.mjs
|
|
445
445
|
import { StaticReflector, StaticSymbol } from "@angular/compiler";
|
|
446
446
|
|
|
447
|
-
// bazel-out/
|
|
447
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
448
448
|
import { Version } from "@angular/compiler";
|
|
449
|
-
var VERSION = new Version("13.0.
|
|
449
|
+
var VERSION = new Version("13.0.3");
|
|
450
450
|
|
|
451
|
-
// bazel-out/
|
|
451
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/collector.mjs
|
|
452
452
|
import ts4 from "typescript";
|
|
453
453
|
|
|
454
|
-
// bazel-out/
|
|
454
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/evaluator.mjs
|
|
455
455
|
import ts2 from "typescript";
|
|
456
456
|
|
|
457
|
-
// bazel-out/
|
|
457
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/schema.mjs
|
|
458
458
|
var METADATA_VERSION = 4;
|
|
459
459
|
function isModuleMetadata(value) {
|
|
460
460
|
return value && value.__symbolic === "module";
|
|
@@ -542,7 +542,7 @@ function isMetadataError(value) {
|
|
|
542
542
|
return value && value.__symbolic === "error";
|
|
543
543
|
}
|
|
544
544
|
|
|
545
|
-
// bazel-out/
|
|
545
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/evaluator.mjs
|
|
546
546
|
var spreadElementSyntaxKind = ts2.SyntaxKind.SpreadElement || ts2.SyntaxKind.SpreadElementExpression;
|
|
547
547
|
function isMethodCallOf(callExpression, memberName) {
|
|
548
548
|
const expression = callExpression.expression;
|
|
@@ -1101,7 +1101,7 @@ function arrayOrEmpty(v) {
|
|
|
1101
1101
|
return v || empty;
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
|
-
// bazel-out/
|
|
1104
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/symbols.mjs
|
|
1105
1105
|
import ts3 from "typescript";
|
|
1106
1106
|
var Symbols = class {
|
|
1107
1107
|
constructor(sourceFile) {
|
|
@@ -1226,7 +1226,7 @@ function populateBuiltins(symbols) {
|
|
|
1226
1226
|
].forEach((name) => symbols.set(name, { __symbolic: "reference", name }));
|
|
1227
1227
|
}
|
|
1228
1228
|
|
|
1229
|
-
// bazel-out/
|
|
1229
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/collector.mjs
|
|
1230
1230
|
var isStatic = (node) => ts4.getCombinedModifierFlags(node) & ts4.ModifierFlags.Static;
|
|
1231
1231
|
var MetadataCollector = class {
|
|
1232
1232
|
constructor(options = {}) {
|
|
@@ -1847,7 +1847,7 @@ function expandedMessage(error2) {
|
|
|
1847
1847
|
return error2.message;
|
|
1848
1848
|
}
|
|
1849
1849
|
|
|
1850
|
-
// bazel-out/
|
|
1850
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/bundle_index_host.mjs
|
|
1851
1851
|
import {
|
|
1852
1852
|
basename as basename4,
|
|
1853
1853
|
dirname as dirname4,
|
|
@@ -1856,7 +1856,7 @@ import {
|
|
|
1856
1856
|
} from "path";
|
|
1857
1857
|
import ts6 from "typescript";
|
|
1858
1858
|
|
|
1859
|
-
// bazel-out/
|
|
1859
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/bundler.mjs
|
|
1860
1860
|
import {
|
|
1861
1861
|
basename as basename3,
|
|
1862
1862
|
dirname as dirname3,
|
|
@@ -2326,7 +2326,7 @@ function getSymbolDeclaration(symbol) {
|
|
|
2326
2326
|
return symbol.exports ? getSymbolDeclaration(symbol.exports) : symbol;
|
|
2327
2327
|
}
|
|
2328
2328
|
|
|
2329
|
-
// bazel-out/
|
|
2329
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/index_writer.mjs
|
|
2330
2330
|
var INDEX_HEADER = `/**
|
|
2331
2331
|
* Generated bundle index. Do not edit.
|
|
2332
2332
|
*/
|
|
@@ -2360,7 +2360,7 @@ function compare(select) {
|
|
|
2360
2360
|
};
|
|
2361
2361
|
}
|
|
2362
2362
|
|
|
2363
|
-
// bazel-out/
|
|
2363
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/metadata/bundle_index_host.mjs
|
|
2364
2364
|
var DTS = /\.d\.ts$/;
|
|
2365
2365
|
var JS_EXT = /(\.js|)$/;
|
|
2366
2366
|
function createSyntheticIndexHost(delegate, syntheticIndex) {
|
|
@@ -2439,7 +2439,7 @@ function createBundleIndexHost(ngOptions, rootFiles, host, getMetadataCache) {
|
|
|
2439
2439
|
return { host, indexName: name };
|
|
2440
2440
|
}
|
|
2441
2441
|
|
|
2442
|
-
// bazel-out/
|
|
2442
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
2443
2443
|
var DEFAULT_ERROR_CODE = 100;
|
|
2444
2444
|
var UNKNOWN_ERROR_CODE = 500;
|
|
2445
2445
|
var SOURCE = "angular";
|
|
@@ -2460,7 +2460,7 @@ var EmitFlags;
|
|
|
2460
2460
|
EmitFlags2[EmitFlags2["All"] = 31] = "All";
|
|
2461
2461
|
})(EmitFlags || (EmitFlags = {}));
|
|
2462
2462
|
|
|
2463
|
-
// bazel-out/
|
|
2463
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/compiler_host.mjs
|
|
2464
2464
|
import { collectExternalReferences, syntaxError as syntaxError2, TypeScriptEmitter } from "@angular/compiler";
|
|
2465
2465
|
import fs3 from "fs";
|
|
2466
2466
|
import {
|
|
@@ -2473,7 +2473,7 @@ import {
|
|
|
2473
2473
|
} from "path";
|
|
2474
2474
|
import ts8 from "typescript";
|
|
2475
2475
|
|
|
2476
|
-
// bazel-out/
|
|
2476
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
2477
2477
|
import { syntaxError } from "@angular/compiler";
|
|
2478
2478
|
import {
|
|
2479
2479
|
relative as relative3
|
|
@@ -2539,7 +2539,7 @@ function stripComment(commentText) {
|
|
|
2539
2539
|
return commentText.replace(/^\/\*\*?/, "").replace(/\*\/$/, "").trim();
|
|
2540
2540
|
}
|
|
2541
2541
|
|
|
2542
|
-
// bazel-out/
|
|
2542
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/metadata_reader.mjs
|
|
2543
2543
|
function createMetadataReaderCache() {
|
|
2544
2544
|
const data = new Map();
|
|
2545
2545
|
return { data };
|
|
@@ -2616,7 +2616,7 @@ function upgradeMetadataWithDtsData(host, oldMetadata, dtsFilePath) {
|
|
|
2616
2616
|
return newMetadata;
|
|
2617
2617
|
}
|
|
2618
2618
|
|
|
2619
|
-
// bazel-out/
|
|
2619
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/compiler_host.mjs
|
|
2620
2620
|
var NODE_MODULES_PACKAGE_NAME = /node_modules\/((\w|-|\.)+|(@(\w|-|\.)+\/(\w|-|\.)+))/;
|
|
2621
2621
|
var EXT = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;
|
|
2622
2622
|
var CSS_PREPROCESSOR_EXT = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
@@ -3076,18 +3076,18 @@ function addNgResourceSuffix(fileName) {
|
|
|
3076
3076
|
return `${fileName}.$ngresource$`;
|
|
3077
3077
|
}
|
|
3078
3078
|
|
|
3079
|
-
// bazel-out/
|
|
3079
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/program.mjs
|
|
3080
3080
|
import { core, createAotCompiler, getMissingNgModuleMetadataErrorData, getParseErrors, isFormattedError, isSyntaxError } from "@angular/compiler";
|
|
3081
3081
|
import {
|
|
3082
3082
|
readFileSync as readFileSync2
|
|
3083
3083
|
} from "fs";
|
|
3084
3084
|
import * as path6 from "path";
|
|
3085
|
-
import
|
|
3085
|
+
import ts84 from "typescript";
|
|
3086
3086
|
|
|
3087
|
-
// bazel-out/
|
|
3087
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/diagnostics/translate_diagnostics.mjs
|
|
3088
3088
|
import ts9 from "typescript";
|
|
3089
3089
|
function translateDiagnostics(host, untranslatedDiagnostics) {
|
|
3090
|
-
const
|
|
3090
|
+
const ts86 = [];
|
|
3091
3091
|
const ng2 = [];
|
|
3092
3092
|
untranslatedDiagnostics.forEach((diagnostic) => {
|
|
3093
3093
|
if (diagnostic.file && diagnostic.start && GENERATED_FILES.test(diagnostic.file.fileName)) {
|
|
@@ -3106,10 +3106,10 @@ function translateDiagnostics(host, untranslatedDiagnostics) {
|
|
|
3106
3106
|
});
|
|
3107
3107
|
}
|
|
3108
3108
|
} else {
|
|
3109
|
-
|
|
3109
|
+
ts86.push(diagnostic);
|
|
3110
3110
|
}
|
|
3111
3111
|
});
|
|
3112
|
-
return { ts:
|
|
3112
|
+
return { ts: ts86, ng: ng2 };
|
|
3113
3113
|
}
|
|
3114
3114
|
function sourceSpanOf(host, source, start) {
|
|
3115
3115
|
const { line, character } = ts9.getLineAndCharacterOfPosition(source, start);
|
|
@@ -3119,14 +3119,14 @@ function diagnosticMessageToString(message) {
|
|
|
3119
3119
|
return ts9.flattenDiagnosticMessageText(message, "\n");
|
|
3120
3120
|
}
|
|
3121
3121
|
|
|
3122
|
-
// bazel-out/
|
|
3123
|
-
import
|
|
3122
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
3123
|
+
import ts72 from "typescript";
|
|
3124
3124
|
|
|
3125
|
-
// bazel-out/
|
|
3125
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
3126
3126
|
import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DomElementSchemaRegistry, ExternalExpr as ExternalExpr7, FactoryTarget as FactoryTarget3, InterpolationConfig, makeBindingParser as makeBindingParser2, ParseSourceFile as ParseSourceFile2, parseTemplate, R3TargetBinder, SelectorMatcher, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
3127
3127
|
import ts39 from "typescript";
|
|
3128
3128
|
|
|
3129
|
-
// bazel-out/
|
|
3129
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
3130
3130
|
var ErrorCode;
|
|
3131
3131
|
(function(ErrorCode2) {
|
|
3132
3132
|
ErrorCode2[ErrorCode2["DECORATOR_ARG_NOT_LITERAL"] = 1001] = "DECORATOR_ARG_NOT_LITERAL";
|
|
@@ -3177,7 +3177,7 @@ var ErrorCode;
|
|
|
3177
3177
|
ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
|
|
3178
3178
|
})(ErrorCode || (ErrorCode = {}));
|
|
3179
3179
|
|
|
3180
|
-
// bazel-out/
|
|
3180
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
3181
3181
|
var COMPILER_ERRORS_WITH_GUIDES = new Set([
|
|
3182
3182
|
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
3183
3183
|
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
@@ -3188,10 +3188,10 @@ var COMPILER_ERRORS_WITH_GUIDES = new Set([
|
|
|
3188
3188
|
ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR
|
|
3189
3189
|
]);
|
|
3190
3190
|
|
|
3191
|
-
// bazel-out/
|
|
3191
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
3192
3192
|
import ts10 from "typescript";
|
|
3193
3193
|
|
|
3194
|
-
// bazel-out/
|
|
3194
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
3195
3195
|
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
3196
3196
|
function replaceTsWithNgInErrors(errors) {
|
|
3197
3197
|
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
@@ -3200,7 +3200,7 @@ function ngErrorCode(code) {
|
|
|
3200
3200
|
return parseInt("-99" + code);
|
|
3201
3201
|
}
|
|
3202
3202
|
|
|
3203
|
-
// bazel-out/
|
|
3203
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
3204
3204
|
var FatalDiagnosticError = class {
|
|
3205
3205
|
constructor(code, node, message, relatedInformation) {
|
|
3206
3206
|
this.code = code;
|
|
@@ -3237,17 +3237,17 @@ function makeRelatedInformation(node, messageText) {
|
|
|
3237
3237
|
};
|
|
3238
3238
|
}
|
|
3239
3239
|
|
|
3240
|
-
// bazel-out/
|
|
3240
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
|
|
3241
3241
|
var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
|
|
3242
3242
|
|
|
3243
|
-
// bazel-out/
|
|
3243
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
3244
3244
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
3245
3245
|
|
|
3246
|
-
// bazel-out/
|
|
3246
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
3247
3247
|
import { ExternalExpr, ExternalReference, WrappedNodeExpr } from "@angular/compiler";
|
|
3248
3248
|
import ts13 from "typescript";
|
|
3249
3249
|
|
|
3250
|
-
// bazel-out/
|
|
3250
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
|
|
3251
3251
|
import ts11 from "typescript";
|
|
3252
3252
|
var TS2 = /\.tsx?$/i;
|
|
3253
3253
|
var D_TS = /\.d\.ts$/i;
|
|
@@ -3335,7 +3335,7 @@ function toUnredirectedSourceFile(sf) {
|
|
|
3335
3335
|
return redirectInfo.unredirected;
|
|
3336
3336
|
}
|
|
3337
3337
|
|
|
3338
|
-
// bazel-out/
|
|
3338
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
|
|
3339
3339
|
import ts12 from "typescript";
|
|
3340
3340
|
function findExportedNameOfNode(target, file, reflector) {
|
|
3341
3341
|
const exports = reflector.getExportsOfModule(file);
|
|
@@ -3359,7 +3359,7 @@ function findExportedNameOfNode(target, file, reflector) {
|
|
|
3359
3359
|
return foundExportName;
|
|
3360
3360
|
}
|
|
3361
3361
|
|
|
3362
|
-
// bazel-out/
|
|
3362
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
3363
3363
|
var ImportFlags;
|
|
3364
3364
|
(function(ImportFlags2) {
|
|
3365
3365
|
ImportFlags2[ImportFlags2["None"] = 0] = "None";
|
|
@@ -3519,7 +3519,7 @@ var UnifiedModulesStrategy = class {
|
|
|
3519
3519
|
}
|
|
3520
3520
|
};
|
|
3521
3521
|
|
|
3522
|
-
// bazel-out/
|
|
3522
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
|
|
3523
3523
|
var CHARS_TO_ESCAPE = /[^a-zA-Z0-9/_]/g;
|
|
3524
3524
|
var UnifiedModulesAliasingHost = class {
|
|
3525
3525
|
constructor(unifiedModulesHost) {
|
|
@@ -3582,7 +3582,7 @@ var AliasStrategy = class {
|
|
|
3582
3582
|
}
|
|
3583
3583
|
};
|
|
3584
3584
|
|
|
3585
|
-
// bazel-out/
|
|
3585
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/path.mjs
|
|
3586
3586
|
function relativePathBetween(from, to) {
|
|
3587
3587
|
const relativePath = stripExtension(relative(dirname(resolve(from)), resolve(to)));
|
|
3588
3588
|
return relativePath !== "" ? toRelativeImport(relativePath) : null;
|
|
@@ -3591,7 +3591,7 @@ function normalizeSeparators2(path7) {
|
|
|
3591
3591
|
return path7.replace(/\\/g, "/");
|
|
3592
3592
|
}
|
|
3593
3593
|
|
|
3594
|
-
// bazel-out/
|
|
3594
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
|
|
3595
3595
|
var NoopImportRewriter = class {
|
|
3596
3596
|
shouldImportSymbol(symbol, specifier) {
|
|
3597
3597
|
return true;
|
|
@@ -3649,7 +3649,7 @@ function validateAndRewriteCoreSymbol(name) {
|
|
|
3649
3649
|
return CORE_SUPPORTED_SYMBOLS.get(name);
|
|
3650
3650
|
}
|
|
3651
3651
|
|
|
3652
|
-
// bazel-out/
|
|
3652
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
|
|
3653
3653
|
import ts14 from "typescript";
|
|
3654
3654
|
var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
|
|
3655
3655
|
function attachDefaultImportDeclaration(expr, importDecl) {
|
|
@@ -3694,7 +3694,7 @@ var DefaultImportTracker = class {
|
|
|
3694
3694
|
}
|
|
3695
3695
|
};
|
|
3696
3696
|
|
|
3697
|
-
// bazel-out/
|
|
3697
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/references.mjs
|
|
3698
3698
|
var Reference = class {
|
|
3699
3699
|
constructor(node, bestGuessOwningModule = null) {
|
|
3700
3700
|
this.node = node;
|
|
@@ -3757,7 +3757,7 @@ var Reference = class {
|
|
|
3757
3757
|
}
|
|
3758
3758
|
};
|
|
3759
3759
|
|
|
3760
|
-
// bazel-out/
|
|
3760
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/resolver.mjs
|
|
3761
3761
|
var ModuleResolver = class {
|
|
3762
3762
|
constructor(program, compilerOptions, host, moduleResolutionCache) {
|
|
3763
3763
|
this.program = program;
|
|
@@ -3774,7 +3774,7 @@ var ModuleResolver = class {
|
|
|
3774
3774
|
}
|
|
3775
3775
|
};
|
|
3776
3776
|
|
|
3777
|
-
// bazel-out/
|
|
3777
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
3778
3778
|
import ts15 from "typescript";
|
|
3779
3779
|
var SemanticSymbol = class {
|
|
3780
3780
|
constructor(decl) {
|
|
@@ -3790,7 +3790,7 @@ function getSymbolIdentifier(decl) {
|
|
|
3790
3790
|
return decl.name.text;
|
|
3791
3791
|
}
|
|
3792
3792
|
|
|
3793
|
-
// bazel-out/
|
|
3793
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
3794
3794
|
import { ExternalExpr as ExternalExpr3 } from "@angular/compiler";
|
|
3795
3795
|
var OpaqueSymbol = class extends SemanticSymbol {
|
|
3796
3796
|
isPublicApiAffected() {
|
|
@@ -3933,10 +3933,10 @@ function getImportPath(expr) {
|
|
|
3933
3933
|
}
|
|
3934
3934
|
}
|
|
3935
3935
|
|
|
3936
|
-
// bazel-out/
|
|
3936
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
3937
3937
|
import ts16 from "typescript";
|
|
3938
3938
|
|
|
3939
|
-
// bazel-out/
|
|
3939
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
3940
3940
|
function isSymbolEqual(a, b) {
|
|
3941
3941
|
if (a.decl === b.decl) {
|
|
3942
3942
|
return true;
|
|
@@ -3986,7 +3986,7 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
3986
3986
|
return true;
|
|
3987
3987
|
}
|
|
3988
3988
|
|
|
3989
|
-
// bazel-out/
|
|
3989
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
3990
3990
|
function extractSemanticTypeParameters(node) {
|
|
3991
3991
|
if (!ts16.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
3992
3992
|
return null;
|
|
@@ -4006,17 +4006,17 @@ function isTypeParameterEqual(a, b) {
|
|
|
4006
4006
|
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
4007
4007
|
}
|
|
4008
4008
|
|
|
4009
|
-
// bazel-out/
|
|
4009
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
4010
4010
|
var MetaType;
|
|
4011
4011
|
(function(MetaType2) {
|
|
4012
4012
|
MetaType2[MetaType2["Pipe"] = 0] = "Pipe";
|
|
4013
4013
|
MetaType2[MetaType2["Directive"] = 1] = "Directive";
|
|
4014
4014
|
})(MetaType || (MetaType = {}));
|
|
4015
4015
|
|
|
4016
|
-
// bazel-out/
|
|
4016
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
4017
4017
|
import ts22 from "typescript";
|
|
4018
4018
|
|
|
4019
|
-
// bazel-out/
|
|
4019
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/host.mjs
|
|
4020
4020
|
import ts17 from "typescript";
|
|
4021
4021
|
var Decorator = {
|
|
4022
4022
|
nodeForError: (decorator) => {
|
|
@@ -4051,7 +4051,7 @@ function isConcreteDeclaration(decl) {
|
|
|
4051
4051
|
return decl.kind === 0;
|
|
4052
4052
|
}
|
|
4053
4053
|
|
|
4054
|
-
// bazel-out/
|
|
4054
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/type_to_value.mjs
|
|
4055
4055
|
import ts18 from "typescript";
|
|
4056
4056
|
function typeToValue(typeNode, checker) {
|
|
4057
4057
|
if (typeNode === null) {
|
|
@@ -4212,10 +4212,10 @@ function extractModuleName(node) {
|
|
|
4212
4212
|
return node.moduleSpecifier.text;
|
|
4213
4213
|
}
|
|
4214
4214
|
|
|
4215
|
-
// bazel-out/
|
|
4215
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
4216
4216
|
import ts20 from "typescript";
|
|
4217
4217
|
|
|
4218
|
-
// bazel-out/
|
|
4218
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/util.mjs
|
|
4219
4219
|
import ts19 from "typescript";
|
|
4220
4220
|
function isNamedClassDeclaration(node) {
|
|
4221
4221
|
return ts19.isClassDeclaration(node) && isIdentifier(node.name);
|
|
@@ -4224,7 +4224,7 @@ function isIdentifier(node) {
|
|
|
4224
4224
|
return node !== void 0 && ts19.isIdentifier(node);
|
|
4225
4225
|
}
|
|
4226
4226
|
|
|
4227
|
-
// bazel-out/
|
|
4227
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/reflection/src/typescript.mjs
|
|
4228
4228
|
var TypeScriptReflectionHost = class {
|
|
4229
4229
|
constructor(checker) {
|
|
4230
4230
|
this.checker = checker;
|
|
@@ -4660,7 +4660,7 @@ function getExportedName(decl, originalId) {
|
|
|
4660
4660
|
}
|
|
4661
4661
|
var LocalExportedDeclarations = Symbol("LocalExportedDeclarations");
|
|
4662
4662
|
|
|
4663
|
-
// bazel-out/
|
|
4663
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
4664
4664
|
var ClassPropertyMapping = class {
|
|
4665
4665
|
constructor(forwardMap) {
|
|
4666
4666
|
this.forwardMap = forwardMap;
|
|
@@ -4736,7 +4736,7 @@ function reverseMapFromForwardMap(forwardMap) {
|
|
|
4736
4736
|
return reverseMap;
|
|
4737
4737
|
}
|
|
4738
4738
|
|
|
4739
|
-
// bazel-out/
|
|
4739
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
4740
4740
|
import ts21 from "typescript";
|
|
4741
4741
|
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
4742
4742
|
if (!ts21.isTupleTypeNode(def)) {
|
|
@@ -4903,7 +4903,7 @@ function hasInjectableFields(clazz, host) {
|
|
|
4903
4903
|
return members.some(({ isStatic: isStatic2, name }) => isStatic2 && (name === "\u0275prov" || name === "\u0275fac"));
|
|
4904
4904
|
}
|
|
4905
4905
|
|
|
4906
|
-
// bazel-out/
|
|
4906
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
4907
4907
|
var DtsMetadataReader = class {
|
|
4908
4908
|
constructor(checker, reflector) {
|
|
4909
4909
|
this.checker = checker;
|
|
@@ -5003,7 +5003,7 @@ function readBaseClass(clazz, checker, reflector) {
|
|
|
5003
5003
|
return null;
|
|
5004
5004
|
}
|
|
5005
5005
|
|
|
5006
|
-
// bazel-out/
|
|
5006
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
5007
5007
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
5008
5008
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
5009
5009
|
if (topMeta === null) {
|
|
@@ -5060,7 +5060,7 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
5060
5060
|
});
|
|
5061
5061
|
}
|
|
5062
5062
|
|
|
5063
|
-
// bazel-out/
|
|
5063
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
5064
5064
|
var LocalMetadataRegistry = class {
|
|
5065
5065
|
constructor() {
|
|
5066
5066
|
this.directives = new Map();
|
|
@@ -5119,7 +5119,7 @@ var InjectableClassRegistry = class {
|
|
|
5119
5119
|
}
|
|
5120
5120
|
};
|
|
5121
5121
|
|
|
5122
|
-
// bazel-out/
|
|
5122
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
5123
5123
|
var ResourceRegistry = class {
|
|
5124
5124
|
constructor() {
|
|
5125
5125
|
this.externalTemplateToComponentsMap = new Map();
|
|
@@ -5184,10 +5184,10 @@ var ResourceRegistry = class {
|
|
|
5184
5184
|
}
|
|
5185
5185
|
};
|
|
5186
5186
|
|
|
5187
|
-
// bazel-out/
|
|
5187
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
5188
5188
|
import ts23 from "typescript";
|
|
5189
5189
|
|
|
5190
|
-
// bazel-out/
|
|
5190
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
5191
5191
|
var DynamicValue = class {
|
|
5192
5192
|
constructor(node, reason, code) {
|
|
5193
5193
|
this.node = node;
|
|
@@ -5272,7 +5272,7 @@ var DynamicValue = class {
|
|
|
5272
5272
|
}
|
|
5273
5273
|
};
|
|
5274
5274
|
|
|
5275
|
-
// bazel-out/
|
|
5275
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
|
|
5276
5276
|
var ResolvedModule = class {
|
|
5277
5277
|
constructor(exports, evaluate) {
|
|
5278
5278
|
this.exports = exports;
|
|
@@ -5302,7 +5302,7 @@ var EnumValue = class {
|
|
|
5302
5302
|
var KnownFn = class {
|
|
5303
5303
|
};
|
|
5304
5304
|
|
|
5305
|
-
// bazel-out/
|
|
5305
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
5306
5306
|
function describeResolvedType(value, maxDepth = 1) {
|
|
5307
5307
|
var _a, _b;
|
|
5308
5308
|
if (value === null) {
|
|
@@ -5428,10 +5428,10 @@ function getContainerNode(node) {
|
|
|
5428
5428
|
return node.getSourceFile();
|
|
5429
5429
|
}
|
|
5430
5430
|
|
|
5431
|
-
// bazel-out/
|
|
5431
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
5432
5432
|
import ts24 from "typescript";
|
|
5433
5433
|
|
|
5434
|
-
// bazel-out/
|
|
5434
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
|
|
5435
5435
|
var ArraySliceBuiltinFn = class extends KnownFn {
|
|
5436
5436
|
constructor(lhs) {
|
|
5437
5437
|
super();
|
|
@@ -5464,6 +5464,24 @@ var ArrayConcatBuiltinFn = class extends KnownFn {
|
|
|
5464
5464
|
return result;
|
|
5465
5465
|
}
|
|
5466
5466
|
};
|
|
5467
|
+
var StringConcatBuiltinFn = class extends KnownFn {
|
|
5468
|
+
constructor(lhs) {
|
|
5469
|
+
super();
|
|
5470
|
+
this.lhs = lhs;
|
|
5471
|
+
}
|
|
5472
|
+
evaluate(node, args) {
|
|
5473
|
+
let result = this.lhs;
|
|
5474
|
+
for (const arg of args) {
|
|
5475
|
+
const resolved = arg instanceof EnumValue ? arg.resolved : arg;
|
|
5476
|
+
if (typeof resolved === "string" || typeof resolved === "number" || typeof resolved === "boolean" || resolved == null) {
|
|
5477
|
+
result = result.concat(resolved);
|
|
5478
|
+
} else {
|
|
5479
|
+
return DynamicValue.fromUnknown(node);
|
|
5480
|
+
}
|
|
5481
|
+
}
|
|
5482
|
+
return result;
|
|
5483
|
+
}
|
|
5484
|
+
};
|
|
5467
5485
|
var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
5468
5486
|
evaluate(node, args) {
|
|
5469
5487
|
if (args.length === 0) {
|
|
@@ -5484,7 +5502,7 @@ var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
|
5484
5502
|
}
|
|
5485
5503
|
};
|
|
5486
5504
|
|
|
5487
|
-
// bazel-out/
|
|
5505
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/ts_helpers.mjs
|
|
5488
5506
|
var AssignHelperFn = class extends ObjectAssignBuiltinFn {
|
|
5489
5507
|
};
|
|
5490
5508
|
var SpreadHelperFn = class extends KnownFn {
|
|
@@ -5537,7 +5555,7 @@ var ReadHelperFn = class extends KnownFn {
|
|
|
5537
5555
|
}
|
|
5538
5556
|
};
|
|
5539
5557
|
|
|
5540
|
-
// bazel-out/
|
|
5558
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
|
|
5541
5559
|
var jsGlobalObjectValue = new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
5542
5560
|
var assignTsHelperFn = new AssignHelperFn();
|
|
5543
5561
|
var spreadTsHelperFn = new SpreadHelperFn();
|
|
@@ -5561,7 +5579,7 @@ function resolveKnownDeclaration(decl) {
|
|
|
5561
5579
|
}
|
|
5562
5580
|
}
|
|
5563
5581
|
|
|
5564
|
-
// bazel-out/
|
|
5582
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
5565
5583
|
function literalBinaryOp(op) {
|
|
5566
5584
|
return { op, literal: true };
|
|
5567
5585
|
}
|
|
@@ -5853,6 +5871,8 @@ var StaticInterpreter = class {
|
|
|
5853
5871
|
return DynamicValue.fromInvalidExpressionType(node, rhs);
|
|
5854
5872
|
}
|
|
5855
5873
|
return lhs[rhs];
|
|
5874
|
+
} else if (typeof lhs === "string" && rhs === "concat") {
|
|
5875
|
+
return new StringConcatBuiltinFn(lhs);
|
|
5856
5876
|
} else if (lhs instanceof Reference) {
|
|
5857
5877
|
const ref = lhs.node;
|
|
5858
5878
|
if (this.host.isClass(ref)) {
|
|
@@ -6146,7 +6166,7 @@ function owningModule(context, override = null) {
|
|
|
6146
6166
|
}
|
|
6147
6167
|
}
|
|
6148
6168
|
|
|
6149
|
-
// bazel-out/
|
|
6169
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
|
|
6150
6170
|
var PartialEvaluator = class {
|
|
6151
6171
|
constructor(host, checker, dependencyTracker) {
|
|
6152
6172
|
this.host = host;
|
|
@@ -6166,7 +6186,7 @@ var PartialEvaluator = class {
|
|
|
6166
6186
|
}
|
|
6167
6187
|
};
|
|
6168
6188
|
|
|
6169
|
-
// bazel-out/
|
|
6189
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/api.mjs
|
|
6170
6190
|
var PerfPhase;
|
|
6171
6191
|
(function(PerfPhase2) {
|
|
6172
6192
|
PerfPhase2[PerfPhase2["Unaccounted"] = 0] = "Unaccounted";
|
|
@@ -6231,7 +6251,7 @@ var PerfCheckpoint;
|
|
|
6231
6251
|
PerfCheckpoint2[PerfCheckpoint2["LAST"] = 9] = "LAST";
|
|
6232
6252
|
})(PerfCheckpoint || (PerfCheckpoint = {}));
|
|
6233
6253
|
|
|
6234
|
-
// bazel-out/
|
|
6254
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/noop.mjs
|
|
6235
6255
|
var NoopPerfRecorder = class {
|
|
6236
6256
|
eventCount() {
|
|
6237
6257
|
}
|
|
@@ -6248,7 +6268,7 @@ var NoopPerfRecorder = class {
|
|
|
6248
6268
|
};
|
|
6249
6269
|
var NOOP_PERF_RECORDER = new NoopPerfRecorder();
|
|
6250
6270
|
|
|
6251
|
-
// bazel-out/
|
|
6271
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/clock.mjs
|
|
6252
6272
|
function mark() {
|
|
6253
6273
|
return process.hrtime();
|
|
6254
6274
|
}
|
|
@@ -6257,7 +6277,7 @@ function timeSinceInMicros(mark2) {
|
|
|
6257
6277
|
return delta[0] * 1e6 + Math.floor(delta[1] / 1e3);
|
|
6258
6278
|
}
|
|
6259
6279
|
|
|
6260
|
-
// bazel-out/
|
|
6280
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/perf/src/recorder.mjs
|
|
6261
6281
|
var ActivePerfRecorder = class {
|
|
6262
6282
|
constructor(zeroTime) {
|
|
6263
6283
|
this.zeroTime = zeroTime;
|
|
@@ -6351,7 +6371,7 @@ var DelegatingPerfRecorder = class {
|
|
|
6351
6371
|
}
|
|
6352
6372
|
};
|
|
6353
6373
|
|
|
6354
|
-
// bazel-out/
|
|
6374
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
6355
6375
|
var CompilationMode;
|
|
6356
6376
|
(function(CompilationMode2) {
|
|
6357
6377
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -6369,7 +6389,7 @@ var HandlerFlags;
|
|
|
6369
6389
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
6370
6390
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
6371
6391
|
|
|
6372
|
-
// bazel-out/
|
|
6392
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
6373
6393
|
import ts25 from "typescript";
|
|
6374
6394
|
function aliasTransformFactory(exportStatements) {
|
|
6375
6395
|
return (context) => {
|
|
@@ -6387,10 +6407,10 @@ function aliasTransformFactory(exportStatements) {
|
|
|
6387
6407
|
};
|
|
6388
6408
|
}
|
|
6389
6409
|
|
|
6390
|
-
// bazel-out/
|
|
6410
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
6391
6411
|
import ts26 from "typescript";
|
|
6392
6412
|
|
|
6393
|
-
// bazel-out/
|
|
6413
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
6394
6414
|
var TraitState;
|
|
6395
6415
|
(function(TraitState2) {
|
|
6396
6416
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -6445,7 +6465,7 @@ var TraitImpl = class {
|
|
|
6445
6465
|
}
|
|
6446
6466
|
};
|
|
6447
6467
|
|
|
6448
|
-
// bazel-out/
|
|
6468
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
6449
6469
|
var TraitCompiler = class {
|
|
6450
6470
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater) {
|
|
6451
6471
|
this.handlers = handlers;
|
|
@@ -6882,10 +6902,10 @@ var TraitCompiler = class {
|
|
|
6882
6902
|
}
|
|
6883
6903
|
};
|
|
6884
6904
|
|
|
6885
|
-
// bazel-out/
|
|
6905
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
6886
6906
|
import ts31 from "typescript";
|
|
6887
6907
|
|
|
6888
|
-
// bazel-out/
|
|
6908
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
|
|
6889
6909
|
var Context = class {
|
|
6890
6910
|
constructor(isStatement) {
|
|
6891
6911
|
this.isStatement = isStatement;
|
|
@@ -6898,7 +6918,7 @@ var Context = class {
|
|
|
6898
6918
|
}
|
|
6899
6919
|
};
|
|
6900
6920
|
|
|
6901
|
-
// bazel-out/
|
|
6921
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
|
|
6902
6922
|
import ts27 from "typescript";
|
|
6903
6923
|
var ImportManager = class {
|
|
6904
6924
|
constructor(rewriter = new NoopImportRewriter(), prefix = "i") {
|
|
@@ -6934,7 +6954,7 @@ var ImportManager = class {
|
|
|
6934
6954
|
}
|
|
6935
6955
|
};
|
|
6936
6956
|
|
|
6937
|
-
// bazel-out/
|
|
6957
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
|
|
6938
6958
|
import {
|
|
6939
6959
|
BinaryOperator,
|
|
6940
6960
|
ConditionalExpr,
|
|
@@ -7178,7 +7198,7 @@ function createRange(span) {
|
|
|
7178
7198
|
};
|
|
7179
7199
|
}
|
|
7180
7200
|
|
|
7181
|
-
// bazel-out/
|
|
7201
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
|
|
7182
7202
|
import {
|
|
7183
7203
|
BuiltinTypeName
|
|
7184
7204
|
} from "@angular/compiler";
|
|
@@ -7357,7 +7377,7 @@ var TypeTranslatorVisitor = class {
|
|
|
7357
7377
|
}
|
|
7358
7378
|
};
|
|
7359
7379
|
|
|
7360
|
-
// bazel-out/
|
|
7380
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
|
|
7361
7381
|
import ts29 from "typescript";
|
|
7362
7382
|
var PureAnnotation;
|
|
7363
7383
|
(function(PureAnnotation2) {
|
|
@@ -7529,7 +7549,7 @@ function attachComments(statement, leadingComments) {
|
|
|
7529
7549
|
}
|
|
7530
7550
|
}
|
|
7531
7551
|
|
|
7532
|
-
// bazel-out/
|
|
7552
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_translator.mjs
|
|
7533
7553
|
function translateExpression(expression, imports, options = {}) {
|
|
7534
7554
|
return expression.visitExpression(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, options), new Context(false));
|
|
7535
7555
|
}
|
|
@@ -7537,7 +7557,7 @@ function translateStatement(statement, imports, options = {}) {
|
|
|
7537
7557
|
return statement.visitStatement(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, options), new Context(true));
|
|
7538
7558
|
}
|
|
7539
7559
|
|
|
7540
|
-
// bazel-out/
|
|
7560
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
7541
7561
|
import ts30 from "typescript";
|
|
7542
7562
|
function addImports(importManager, sf, extraStatements = []) {
|
|
7543
7563
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
@@ -7565,7 +7585,7 @@ function isImportStatement(stmt) {
|
|
|
7565
7585
|
return ts30.isImportDeclaration(stmt) || ts30.isImportEqualsDeclaration(stmt) || ts30.isNamespaceImport(stmt);
|
|
7566
7586
|
}
|
|
7567
7587
|
|
|
7568
|
-
// bazel-out/
|
|
7588
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
7569
7589
|
var DtsTransformRegistry = class {
|
|
7570
7590
|
constructor() {
|
|
7571
7591
|
this.ivyDeclarationTransforms = new Map();
|
|
@@ -7690,11 +7710,11 @@ function markForEmitAsSingleLine(node) {
|
|
|
7690
7710
|
ts31.forEachChild(node, markForEmitAsSingleLine);
|
|
7691
7711
|
}
|
|
7692
7712
|
|
|
7693
|
-
// bazel-out/
|
|
7713
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
7694
7714
|
import { ConstantPool } from "@angular/compiler";
|
|
7695
7715
|
import ts33 from "typescript";
|
|
7696
7716
|
|
|
7697
|
-
// bazel-out/
|
|
7717
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
7698
7718
|
import ts32 from "typescript";
|
|
7699
7719
|
function visit(node, visitor, context) {
|
|
7700
7720
|
return visitor._visit(node, context);
|
|
@@ -7756,7 +7776,7 @@ function hasStatements(node) {
|
|
|
7756
7776
|
return block.statements !== void 0 && Array.isArray(block.statements);
|
|
7757
7777
|
}
|
|
7758
7778
|
|
|
7759
|
-
// bazel-out/
|
|
7779
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
7760
7780
|
var NO_DECORATORS = new Set();
|
|
7761
7781
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
7762
7782
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
@@ -7937,10 +7957,10 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
7937
7957
|
};
|
|
7938
7958
|
}
|
|
7939
7959
|
|
|
7940
|
-
// bazel-out/
|
|
7960
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
|
|
7941
7961
|
import ts35 from "typescript";
|
|
7942
7962
|
|
|
7943
|
-
// bazel-out/
|
|
7963
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/util.mjs
|
|
7944
7964
|
import { ExternalExpr as ExternalExpr4, LiteralExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
7945
7965
|
import ts34 from "typescript";
|
|
7946
7966
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
@@ -8300,7 +8320,7 @@ function toFactoryMetadata(meta, target) {
|
|
|
8300
8320
|
};
|
|
8301
8321
|
}
|
|
8302
8322
|
|
|
8303
|
-
// bazel-out/
|
|
8323
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/diagnostics.mjs
|
|
8304
8324
|
function createValueHasWrongTypeError(node, value, messageText) {
|
|
8305
8325
|
var _a;
|
|
8306
8326
|
let chainedMessage;
|
|
@@ -8396,11 +8416,11 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
8396
8416
|
return makeDiagnostic(ErrorCode.DIRECTIVE_INHERITS_UNDECORATED_CTOR, node.name, `The ${dirOrComp.toLowerCase()} ${node.name.text} inherits its constructor from ${baseClassName}, but the latter does not have an Angular decorator of its own. Dependency injection will not be able to resolve the parameters of ${baseClassName}'s constructor. Either add a @Directive decorator to ${baseClassName}, or add an explicit constructor to ${node.name.text}.`);
|
|
8397
8417
|
}
|
|
8398
8418
|
|
|
8399
|
-
// bazel-out/
|
|
8400
|
-
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr5, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
8419
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
8420
|
+
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr5, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
8401
8421
|
import ts37 from "typescript";
|
|
8402
8422
|
|
|
8403
|
-
// bazel-out/
|
|
8423
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
|
|
8404
8424
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
8405
8425
|
function compileNgFactoryDefField(metadata) {
|
|
8406
8426
|
const res = compileFactoryFunction(metadata);
|
|
@@ -8411,7 +8431,7 @@ function compileDeclareFactory(metadata) {
|
|
|
8411
8431
|
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
8412
8432
|
}
|
|
8413
8433
|
|
|
8414
|
-
// bazel-out/
|
|
8434
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/metadata.mjs
|
|
8415
8435
|
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
8416
8436
|
import ts36 from "typescript";
|
|
8417
8437
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
@@ -8499,7 +8519,7 @@ function removeIdentifierReferences(node, name) {
|
|
|
8499
8519
|
return result.transformed[0];
|
|
8500
8520
|
}
|
|
8501
8521
|
|
|
8502
|
-
// bazel-out/
|
|
8522
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
8503
8523
|
var EMPTY_OBJECT = {};
|
|
8504
8524
|
var FIELD_DECORATORS = [
|
|
8505
8525
|
"Input",
|
|
@@ -8807,17 +8827,17 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, isCore
|
|
|
8807
8827
|
};
|
|
8808
8828
|
}
|
|
8809
8829
|
function extractQueryMetadata(exprNode, name, args, propertyName, reflector, evaluator) {
|
|
8810
|
-
var _a;
|
|
8811
8830
|
if (args.length === 0) {
|
|
8812
8831
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, exprNode, `@${name} must have arguments`);
|
|
8813
8832
|
}
|
|
8814
8833
|
const first = name === "ViewChild" || name === "ContentChild";
|
|
8815
|
-
const
|
|
8834
|
+
const forwardReferenceTarget = tryUnwrapForwardRef(args[0], reflector);
|
|
8835
|
+
const node = forwardReferenceTarget != null ? forwardReferenceTarget : args[0];
|
|
8816
8836
|
const arg = evaluator.evaluate(node);
|
|
8817
8837
|
let isStatic2 = false;
|
|
8818
8838
|
let predicate = null;
|
|
8819
8839
|
if (arg instanceof Reference || arg instanceof DynamicValue) {
|
|
8820
|
-
predicate = new WrappedNodeExpr4(node);
|
|
8840
|
+
predicate = createMayBeForwardRefExpression(new WrappedNodeExpr4(node), forwardReferenceTarget !== null ? 2 : 0);
|
|
8821
8841
|
} else if (typeof arg === "string") {
|
|
8822
8842
|
predicate = [arg];
|
|
8823
8843
|
} else if (isStringArrayOrDie(arg, `@${name} predicate`, node)) {
|
|
@@ -9061,7 +9081,7 @@ var QUERY_TYPES = new Set([
|
|
|
9061
9081
|
"ViewChildren"
|
|
9062
9082
|
]);
|
|
9063
9083
|
|
|
9064
|
-
// bazel-out/
|
|
9084
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
|
|
9065
9085
|
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, ExternalExpr as ExternalExpr6, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, NO_ERRORS_SCHEMA, R3Identifiers, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
9066
9086
|
import ts38 from "typescript";
|
|
9067
9087
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
@@ -9495,7 +9515,7 @@ function isNgModule(node, compilation) {
|
|
|
9495
9515
|
return !compilation.directives.some((directive) => directive.ref.node === node) && !compilation.pipes.some((pipe) => pipe.ref.node === node);
|
|
9496
9516
|
}
|
|
9497
9517
|
|
|
9498
|
-
// bazel-out/
|
|
9518
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/component.mjs
|
|
9499
9519
|
var EMPTY_MAP = new Map();
|
|
9500
9520
|
var EMPTY_ARRAY = [];
|
|
9501
9521
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
@@ -10379,8 +10399,8 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
10379
10399
|
return null;
|
|
10380
10400
|
}
|
|
10381
10401
|
|
|
10382
|
-
// bazel-out/
|
|
10383
|
-
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable,
|
|
10402
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
10403
|
+
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
10384
10404
|
import ts40 from "typescript";
|
|
10385
10405
|
var InjectableDecoratorHandler = class {
|
|
10386
10406
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
@@ -10468,7 +10488,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
10468
10488
|
type,
|
|
10469
10489
|
typeArgumentCount,
|
|
10470
10490
|
internalType,
|
|
10471
|
-
providedIn:
|
|
10491
|
+
providedIn: createMayBeForwardRefExpression2(new LiteralExpr3(null), 0)
|
|
10472
10492
|
};
|
|
10473
10493
|
} else if (decorator.args.length === 1) {
|
|
10474
10494
|
const metaNode = decorator.args[0];
|
|
@@ -10476,7 +10496,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
10476
10496
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
10477
10497
|
}
|
|
10478
10498
|
const meta = reflectObjectLiteral(metaNode);
|
|
10479
|
-
const providedIn = meta.has("providedIn") ? getProviderExpression(meta.get("providedIn"), reflector) :
|
|
10499
|
+
const providedIn = meta.has("providedIn") ? getProviderExpression(meta.get("providedIn"), reflector) : createMayBeForwardRefExpression2(new LiteralExpr3(null), 0);
|
|
10480
10500
|
let deps = void 0;
|
|
10481
10501
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
10482
10502
|
const depsExpr = meta.get("deps");
|
|
@@ -10504,7 +10524,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
10504
10524
|
}
|
|
10505
10525
|
function getProviderExpression(expression, reflector) {
|
|
10506
10526
|
const forwardRefValue = tryUnwrapForwardRef(expression, reflector);
|
|
10507
|
-
return
|
|
10527
|
+
return createMayBeForwardRefExpression2(new WrappedNodeExpr7(forwardRefValue != null ? forwardRefValue : expression), forwardRefValue !== null ? 2 : 0);
|
|
10508
10528
|
}
|
|
10509
10529
|
function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, strictCtorDeps) {
|
|
10510
10530
|
if (decorator.args === null) {
|
|
@@ -10579,7 +10599,7 @@ function getDep(dep, reflector) {
|
|
|
10579
10599
|
return meta;
|
|
10580
10600
|
}
|
|
10581
10601
|
|
|
10582
|
-
// bazel-out/
|
|
10602
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
10583
10603
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
10584
10604
|
import ts41 from "typescript";
|
|
10585
10605
|
var PipeSymbol = class extends SemanticSymbol {
|
|
@@ -10704,13 +10724,13 @@ var PipeDecoratorHandler = class {
|
|
|
10704
10724
|
}
|
|
10705
10725
|
};
|
|
10706
10726
|
|
|
10707
|
-
// bazel-out/
|
|
10727
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/references_registry.mjs
|
|
10708
10728
|
var NoopReferencesRegistry = class {
|
|
10709
10729
|
add(source, ...references) {
|
|
10710
10730
|
}
|
|
10711
10731
|
};
|
|
10712
10732
|
|
|
10713
|
-
// bazel-out/
|
|
10733
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
10714
10734
|
var CycleAnalyzer = class {
|
|
10715
10735
|
constructor(importGraph) {
|
|
10716
10736
|
this.importGraph = importGraph;
|
|
@@ -10781,7 +10801,7 @@ var Cycle = class {
|
|
|
10781
10801
|
}
|
|
10782
10802
|
};
|
|
10783
10803
|
|
|
10784
|
-
// bazel-out/
|
|
10804
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/imports.mjs
|
|
10785
10805
|
import ts42 from "typescript";
|
|
10786
10806
|
var ImportGraph = class {
|
|
10787
10807
|
constructor(checker, perf) {
|
|
@@ -10864,7 +10884,7 @@ var Found = class {
|
|
|
10864
10884
|
}
|
|
10865
10885
|
};
|
|
10866
10886
|
|
|
10867
|
-
// bazel-out/
|
|
10887
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/generator.mjs
|
|
10868
10888
|
import ts43 from "typescript";
|
|
10869
10889
|
var FlatIndexGenerator = class {
|
|
10870
10890
|
constructor(entryPoint, relativeFlatIndexPath, moduleName) {
|
|
@@ -10889,7 +10909,7 @@ export * from '${relativeEntryPoint}';
|
|
|
10889
10909
|
}
|
|
10890
10910
|
};
|
|
10891
10911
|
|
|
10892
|
-
// bazel-out/
|
|
10912
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/logic.mjs
|
|
10893
10913
|
function findFlatIndexEntryPoint(rootFiles) {
|
|
10894
10914
|
const tsFiles = rootFiles.filter((file) => isNonDeclarationTsPath(file));
|
|
10895
10915
|
let resolvedEntryPoint = null;
|
|
@@ -10905,7 +10925,7 @@ function findFlatIndexEntryPoint(rootFiles) {
|
|
|
10905
10925
|
return resolvedEntryPoint;
|
|
10906
10926
|
}
|
|
10907
10927
|
|
|
10908
|
-
// bazel-out/
|
|
10928
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/private_export_checker.mjs
|
|
10909
10929
|
import ts44 from "typescript";
|
|
10910
10930
|
function checkForPrivateExports(entryPoint, checker, refGraph) {
|
|
10911
10931
|
const diagnostics = [];
|
|
@@ -10985,7 +11005,7 @@ function getDescriptorOfDeclaration(decl) {
|
|
|
10985
11005
|
}
|
|
10986
11006
|
}
|
|
10987
11007
|
|
|
10988
|
-
// bazel-out/
|
|
11008
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/entry_point/src/reference_graph.mjs
|
|
10989
11009
|
var ReferenceGraph = class {
|
|
10990
11010
|
constructor() {
|
|
10991
11011
|
this.references = new Map();
|
|
@@ -11039,7 +11059,7 @@ var ReferenceGraph = class {
|
|
|
11039
11059
|
}
|
|
11040
11060
|
};
|
|
11041
11061
|
|
|
11042
|
-
// bazel-out/
|
|
11062
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/api.mjs
|
|
11043
11063
|
var NgOriginalFile = Symbol("NgOriginalFile");
|
|
11044
11064
|
var UpdateMode;
|
|
11045
11065
|
(function(UpdateMode2) {
|
|
@@ -11047,13 +11067,13 @@ var UpdateMode;
|
|
|
11047
11067
|
UpdateMode2[UpdateMode2["Incremental"] = 1] = "Incremental";
|
|
11048
11068
|
})(UpdateMode || (UpdateMode = {}));
|
|
11049
11069
|
|
|
11050
|
-
// bazel-out/
|
|
11070
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
11051
11071
|
import ts48 from "typescript";
|
|
11052
11072
|
|
|
11053
|
-
// bazel-out/
|
|
11073
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
11054
11074
|
import ts45 from "typescript";
|
|
11055
11075
|
|
|
11056
|
-
// bazel-out/
|
|
11076
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/expando.mjs
|
|
11057
11077
|
var NgExtension = Symbol("NgExtension");
|
|
11058
11078
|
function isExtended(sf) {
|
|
11059
11079
|
return sf[NgExtension] !== void 0;
|
|
@@ -11113,7 +11133,7 @@ function retagTsFile(sf) {
|
|
|
11113
11133
|
}
|
|
11114
11134
|
}
|
|
11115
11135
|
|
|
11116
|
-
// bazel-out/
|
|
11136
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/util.mjs
|
|
11117
11137
|
var TS_EXTENSIONS = /\.tsx?$/i;
|
|
11118
11138
|
function makeShimFileName(fileName, suffix) {
|
|
11119
11139
|
return absoluteFrom(fileName.replace(TS_EXTENSIONS, suffix));
|
|
@@ -11128,7 +11148,7 @@ function generatedModuleName(originalModuleName, originalFileName, genSuffix) {
|
|
|
11128
11148
|
return moduleName;
|
|
11129
11149
|
}
|
|
11130
11150
|
|
|
11131
|
-
// bazel-out/
|
|
11151
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/adapter.mjs
|
|
11132
11152
|
var ShimAdapter = class {
|
|
11133
11153
|
constructor(delegate, tsRootFiles, topLevelGenerators, perFileGenerators, oldProgram) {
|
|
11134
11154
|
this.delegate = delegate;
|
|
@@ -11225,7 +11245,7 @@ var ShimAdapter = class {
|
|
|
11225
11245
|
}
|
|
11226
11246
|
};
|
|
11227
11247
|
|
|
11228
|
-
// bazel-out/
|
|
11248
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/factory_generator.mjs
|
|
11229
11249
|
import ts46 from "typescript";
|
|
11230
11250
|
var TS_DTS_SUFFIX = /(\.d)?\.ts$/;
|
|
11231
11251
|
var STRIP_NG_FACTORY = /(.*)NgFactory$/;
|
|
@@ -11374,7 +11394,7 @@ function updateInitializers(stmt, update) {
|
|
|
11374
11394
|
return ts46.updateVariableStatement(stmt, stmt.modifiers, ts46.updateVariableDeclarationList(stmt.declarationList, stmt.declarationList.declarations.map((decl) => ts46.updateVariableDeclaration(decl, decl.name, decl.type, update(decl.initializer)))));
|
|
11375
11395
|
}
|
|
11376
11396
|
|
|
11377
|
-
// bazel-out/
|
|
11397
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/reference_tagger.mjs
|
|
11378
11398
|
var ShimReferenceTagger = class {
|
|
11379
11399
|
constructor(shimExtensions) {
|
|
11380
11400
|
this.tagged = new Set();
|
|
@@ -11408,7 +11428,7 @@ var ShimReferenceTagger = class {
|
|
|
11408
11428
|
}
|
|
11409
11429
|
};
|
|
11410
11430
|
|
|
11411
|
-
// bazel-out/
|
|
11431
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/shims/src/summary_generator.mjs
|
|
11412
11432
|
import ts47 from "typescript";
|
|
11413
11433
|
var SummaryGenerator = class {
|
|
11414
11434
|
constructor() {
|
|
@@ -11448,7 +11468,7 @@ function isExported2(decl) {
|
|
|
11448
11468
|
return decl.modifiers !== void 0 && decl.modifiers.some((mod) => mod.kind == ts47.SyntaxKind.ExportKeyword);
|
|
11449
11469
|
}
|
|
11450
11470
|
|
|
11451
|
-
// bazel-out/
|
|
11471
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program_driver/src/ts_create_program_driver.mjs
|
|
11452
11472
|
var DelegatingCompilerHost = class {
|
|
11453
11473
|
constructor(delegate) {
|
|
11454
11474
|
this.delegate = delegate;
|
|
@@ -11557,7 +11577,7 @@ var TsCreateProgramDriver = class {
|
|
|
11557
11577
|
}
|
|
11558
11578
|
};
|
|
11559
11579
|
|
|
11560
|
-
// bazel-out/
|
|
11580
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/dependency_tracking.mjs
|
|
11561
11581
|
var FileDependencyGraph = class {
|
|
11562
11582
|
constructor() {
|
|
11563
11583
|
this.nodes = new Map();
|
|
@@ -11624,7 +11644,7 @@ function isLogicallyChanged(sf, node, changedTsPaths, deletedTsPaths, changedRes
|
|
|
11624
11644
|
return false;
|
|
11625
11645
|
}
|
|
11626
11646
|
|
|
11627
|
-
// bazel-out/
|
|
11647
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/state.mjs
|
|
11628
11648
|
var IncrementalStateKind;
|
|
11629
11649
|
(function(IncrementalStateKind2) {
|
|
11630
11650
|
IncrementalStateKind2[IncrementalStateKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -11632,7 +11652,7 @@ var IncrementalStateKind;
|
|
|
11632
11652
|
IncrementalStateKind2[IncrementalStateKind2["Analyzed"] = 2] = "Analyzed";
|
|
11633
11653
|
})(IncrementalStateKind || (IncrementalStateKind = {}));
|
|
11634
11654
|
|
|
11635
|
-
// bazel-out/
|
|
11655
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/incremental.mjs
|
|
11636
11656
|
var PhaseKind;
|
|
11637
11657
|
(function(PhaseKind2) {
|
|
11638
11658
|
PhaseKind2[PhaseKind2["Analysis"] = 0] = "Analysis";
|
|
@@ -11833,7 +11853,7 @@ function toOriginalSourceFile(sf) {
|
|
|
11833
11853
|
}
|
|
11834
11854
|
}
|
|
11835
11855
|
|
|
11836
|
-
// bazel-out/
|
|
11856
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/src/strategy.mjs
|
|
11837
11857
|
var TrackedIncrementalBuildStrategy = class {
|
|
11838
11858
|
constructor() {
|
|
11839
11859
|
this.state = null;
|
|
@@ -11869,7 +11889,7 @@ var PatchedProgramIncrementalBuildStrategy = class {
|
|
|
11869
11889
|
};
|
|
11870
11890
|
var SYM_INCREMENTAL_STATE = Symbol("NgIncrementalState");
|
|
11871
11891
|
|
|
11872
|
-
// bazel-out/
|
|
11892
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/api.mjs
|
|
11873
11893
|
var IdentifierKind;
|
|
11874
11894
|
(function(IdentifierKind2) {
|
|
11875
11895
|
IdentifierKind2[IdentifierKind2["Property"] = 0] = "Property";
|
|
@@ -11887,7 +11907,7 @@ var AbsoluteSourceSpan = class {
|
|
|
11887
11907
|
}
|
|
11888
11908
|
};
|
|
11889
11909
|
|
|
11890
|
-
// bazel-out/
|
|
11910
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/context.mjs
|
|
11891
11911
|
var IndexingContext = class {
|
|
11892
11912
|
constructor() {
|
|
11893
11913
|
this.components = new Set();
|
|
@@ -11897,10 +11917,10 @@ var IndexingContext = class {
|
|
|
11897
11917
|
}
|
|
11898
11918
|
};
|
|
11899
11919
|
|
|
11900
|
-
// bazel-out/
|
|
11920
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
11901
11921
|
import { ParseSourceFile as ParseSourceFile3 } from "@angular/compiler";
|
|
11902
11922
|
|
|
11903
|
-
// bazel-out/
|
|
11923
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/template.mjs
|
|
11904
11924
|
import { ASTWithSource, ImplicitReceiver, RecursiveAstVisitor, TmplAstElement, TmplAstRecursiveVisitor, TmplAstReference, TmplAstTemplate } from "@angular/compiler";
|
|
11905
11925
|
var ExpressionVisitor = class extends RecursiveAstVisitor {
|
|
11906
11926
|
constructor(expressionStr, absoluteOffset, boundTemplate, targetToIdentifier) {
|
|
@@ -12104,7 +12124,7 @@ function getTemplateIdentifiers(boundTemplate) {
|
|
|
12104
12124
|
return visitor.identifiers;
|
|
12105
12125
|
}
|
|
12106
12126
|
|
|
12107
|
-
// bazel-out/
|
|
12127
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/indexer/src/transform.mjs
|
|
12108
12128
|
function generateAnalysis(context) {
|
|
12109
12129
|
const analysis = new Map();
|
|
12110
12130
|
context.components.forEach(({ declaration, selector, boundTemplate, templateMeta }) => {
|
|
@@ -12138,7 +12158,7 @@ function generateAnalysis(context) {
|
|
|
12138
12158
|
return analysis;
|
|
12139
12159
|
}
|
|
12140
12160
|
|
|
12141
|
-
// bazel-out/
|
|
12161
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/resource/src/loader.mjs
|
|
12142
12162
|
import ts49 from "typescript";
|
|
12143
12163
|
var CSS_PREPROCESSOR_EXT2 = /(\.scss|\.sass|\.less|\.styl)$/;
|
|
12144
12164
|
var RESOURCE_MARKER = ".$ngresource$";
|
|
@@ -12283,7 +12303,7 @@ function createLookupResolutionHost(adapter) {
|
|
|
12283
12303
|
};
|
|
12284
12304
|
}
|
|
12285
12305
|
|
|
12286
|
-
// bazel-out/
|
|
12306
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/dependency.mjs
|
|
12287
12307
|
var MetadataDtsModuleScopeResolver = class {
|
|
12288
12308
|
constructor(dtsMetaReader, aliasingHost) {
|
|
12289
12309
|
this.dtsMetaReader = dtsMetaReader;
|
|
@@ -12369,7 +12389,7 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
12369
12389
|
}
|
|
12370
12390
|
};
|
|
12371
12391
|
|
|
12372
|
-
// bazel-out/
|
|
12392
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
12373
12393
|
import { ExternalExpr as ExternalExpr8 } from "@angular/compiler";
|
|
12374
12394
|
import ts50 from "typescript";
|
|
12375
12395
|
var LocalModuleScopeRegistry = class {
|
|
@@ -12677,7 +12697,7 @@ function reexportCollision(module2, refA, refB) {
|
|
|
12677
12697
|
]);
|
|
12678
12698
|
}
|
|
12679
12699
|
|
|
12680
|
-
// bazel-out/
|
|
12700
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
12681
12701
|
import { CssSelector as CssSelector2, SelectorMatcher as SelectorMatcher2 } from "@angular/compiler";
|
|
12682
12702
|
import ts51 from "typescript";
|
|
12683
12703
|
var TypeCheckScopeRegistry = class {
|
|
@@ -12738,88 +12758,24 @@ var TypeCheckScopeRegistry = class {
|
|
|
12738
12758
|
}
|
|
12739
12759
|
};
|
|
12740
12760
|
|
|
12741
|
-
// bazel-out/
|
|
12742
|
-
import ts52 from "typescript";
|
|
12743
|
-
var IVY_SWITCH_PRE_SUFFIX = "__PRE_R3__";
|
|
12744
|
-
var IVY_SWITCH_POST_SUFFIX = "__POST_R3__";
|
|
12745
|
-
function ivySwitchTransform(_) {
|
|
12746
|
-
return flipIvySwitchInFile;
|
|
12747
|
-
}
|
|
12748
|
-
function flipIvySwitchInFile(sf) {
|
|
12749
|
-
let newStatements = void 0;
|
|
12750
|
-
for (let i = 0; i < sf.statements.length; i++) {
|
|
12751
|
-
const statement = sf.statements[i];
|
|
12752
|
-
if (!ts52.isVariableStatement(statement) || !hasIvySwitches(statement)) {
|
|
12753
|
-
continue;
|
|
12754
|
-
}
|
|
12755
|
-
if (newStatements === void 0) {
|
|
12756
|
-
newStatements = [...sf.statements];
|
|
12757
|
-
}
|
|
12758
|
-
newStatements[i] = flipIvySwitchesInVariableStatement(statement, sf.statements);
|
|
12759
|
-
}
|
|
12760
|
-
if (newStatements !== void 0) {
|
|
12761
|
-
return ts52.updateSourceFileNode(sf, newStatements);
|
|
12762
|
-
}
|
|
12763
|
-
return sf;
|
|
12764
|
-
}
|
|
12765
|
-
function findPostSwitchIdentifier(statements, name) {
|
|
12766
|
-
for (const stmt of statements) {
|
|
12767
|
-
if (ts52.isVariableStatement(stmt)) {
|
|
12768
|
-
const decl = stmt.declarationList.declarations.find((decl2) => ts52.isIdentifier(decl2.name) && decl2.name.text === name);
|
|
12769
|
-
if (decl !== void 0) {
|
|
12770
|
-
return decl.name;
|
|
12771
|
-
}
|
|
12772
|
-
} else if (ts52.isFunctionDeclaration(stmt) || ts52.isClassDeclaration(stmt)) {
|
|
12773
|
-
if (stmt.name !== void 0 && ts52.isIdentifier(stmt.name) && stmt.name.text === name) {
|
|
12774
|
-
return stmt.name;
|
|
12775
|
-
}
|
|
12776
|
-
}
|
|
12777
|
-
}
|
|
12778
|
-
return null;
|
|
12779
|
-
}
|
|
12780
|
-
function flipIvySwitchesInVariableStatement(stmt, statements) {
|
|
12781
|
-
const newDeclarations = [...stmt.declarationList.declarations];
|
|
12782
|
-
for (let i = 0; i < newDeclarations.length; i++) {
|
|
12783
|
-
const decl = newDeclarations[i];
|
|
12784
|
-
if (decl.initializer === void 0 || !ts52.isIdentifier(decl.initializer)) {
|
|
12785
|
-
continue;
|
|
12786
|
-
}
|
|
12787
|
-
if (!decl.initializer.text.endsWith(IVY_SWITCH_PRE_SUFFIX)) {
|
|
12788
|
-
continue;
|
|
12789
|
-
}
|
|
12790
|
-
const postSwitchName = decl.initializer.text.replace(IVY_SWITCH_PRE_SUFFIX, IVY_SWITCH_POST_SUFFIX);
|
|
12791
|
-
const newIdentifier = findPostSwitchIdentifier(statements, postSwitchName);
|
|
12792
|
-
if (newIdentifier === null) {
|
|
12793
|
-
throw new Error(`Unable to find identifier ${postSwitchName} in ${stmt.getSourceFile().fileName} for the Ivy switch.`);
|
|
12794
|
-
}
|
|
12795
|
-
newDeclarations[i] = ts52.updateVariableDeclaration(decl, decl.name, decl.type, newIdentifier);
|
|
12796
|
-
}
|
|
12797
|
-
const newDeclList = ts52.updateVariableDeclarationList(stmt.declarationList, newDeclarations);
|
|
12798
|
-
const newStmt = ts52.updateVariableStatement(stmt, stmt.modifiers, newDeclList);
|
|
12799
|
-
return newStmt;
|
|
12800
|
-
}
|
|
12801
|
-
function hasIvySwitches(stmt) {
|
|
12802
|
-
return stmt.declarationList.declarations.some((decl) => decl.initializer !== void 0 && ts52.isIdentifier(decl.initializer) && decl.initializer.text.endsWith(IVY_SWITCH_PRE_SUFFIX));
|
|
12803
|
-
}
|
|
12804
|
-
|
|
12805
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
12761
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
12806
12762
|
import { CssSelector as CssSelector3, DomElementSchemaRegistry as DomElementSchemaRegistry3 } from "@angular/compiler";
|
|
12807
12763
|
|
|
12808
|
-
// bazel-out/
|
|
12764
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/checker.mjs
|
|
12809
12765
|
var OptimizeFor;
|
|
12810
12766
|
(function(OptimizeFor2) {
|
|
12811
12767
|
OptimizeFor2[OptimizeFor2["SingleFile"] = 0] = "SingleFile";
|
|
12812
12768
|
OptimizeFor2[OptimizeFor2["WholeProgram"] = 1] = "WholeProgram";
|
|
12813
12769
|
})(OptimizeFor || (OptimizeFor = {}));
|
|
12814
12770
|
|
|
12815
|
-
// bazel-out/
|
|
12771
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/completion.mjs
|
|
12816
12772
|
var CompletionKind;
|
|
12817
12773
|
(function(CompletionKind2) {
|
|
12818
12774
|
CompletionKind2[CompletionKind2["Reference"] = 0] = "Reference";
|
|
12819
12775
|
CompletionKind2[CompletionKind2["Variable"] = 1] = "Variable";
|
|
12820
12776
|
})(CompletionKind || (CompletionKind = {}));
|
|
12821
12777
|
|
|
12822
|
-
// bazel-out/
|
|
12778
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/symbols.mjs
|
|
12823
12779
|
var SymbolKind;
|
|
12824
12780
|
(function(SymbolKind2) {
|
|
12825
12781
|
SymbolKind2[SymbolKind2["Input"] = 0] = "Input";
|
|
@@ -12835,8 +12791,8 @@ var SymbolKind;
|
|
|
12835
12791
|
SymbolKind2[SymbolKind2["Pipe"] = 10] = "Pipe";
|
|
12836
12792
|
})(SymbolKind || (SymbolKind = {}));
|
|
12837
12793
|
|
|
12838
|
-
// bazel-out/
|
|
12839
|
-
import
|
|
12794
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/diagnostic.mjs
|
|
12795
|
+
import ts52 from "typescript";
|
|
12840
12796
|
function makeTemplateDiagnostic(templateId, mapping, span, category, code, messageText, relatedMessages) {
|
|
12841
12797
|
if (mapping.type === "direct") {
|
|
12842
12798
|
let relatedInformation = void 0;
|
|
@@ -12844,7 +12800,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
12844
12800
|
relatedInformation = [];
|
|
12845
12801
|
for (const relatedMessage of relatedMessages) {
|
|
12846
12802
|
relatedInformation.push({
|
|
12847
|
-
category:
|
|
12803
|
+
category: ts52.DiagnosticCategory.Message,
|
|
12848
12804
|
code: 0,
|
|
12849
12805
|
file: relatedMessage.sourceFile,
|
|
12850
12806
|
start: relatedMessage.start,
|
|
@@ -12869,12 +12825,12 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
12869
12825
|
const componentSf = mapping.componentClass.getSourceFile();
|
|
12870
12826
|
const componentName = mapping.componentClass.name.text;
|
|
12871
12827
|
const fileName = mapping.type === "indirect" ? `${componentSf.fileName} (${componentName} template)` : mapping.templateUrl;
|
|
12872
|
-
const sf =
|
|
12828
|
+
const sf = ts52.createSourceFile(fileName, mapping.template, ts52.ScriptTarget.Latest, false, ts52.ScriptKind.JSX);
|
|
12873
12829
|
let relatedInformation = [];
|
|
12874
12830
|
if (relatedMessages !== void 0) {
|
|
12875
12831
|
for (const relatedMessage of relatedMessages) {
|
|
12876
12832
|
relatedInformation.push({
|
|
12877
|
-
category:
|
|
12833
|
+
category: ts52.DiagnosticCategory.Message,
|
|
12878
12834
|
code: 0,
|
|
12879
12835
|
file: relatedMessage.sourceFile,
|
|
12880
12836
|
start: relatedMessage.start,
|
|
@@ -12884,7 +12840,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
12884
12840
|
}
|
|
12885
12841
|
}
|
|
12886
12842
|
relatedInformation.push({
|
|
12887
|
-
category:
|
|
12843
|
+
category: ts52.DiagnosticCategory.Message,
|
|
12888
12844
|
code: 0,
|
|
12889
12845
|
file: componentSf,
|
|
12890
12846
|
start: mapping.node.getStart(),
|
|
@@ -12908,7 +12864,7 @@ function makeTemplateDiagnostic(templateId, mapping, span, category, code, messa
|
|
|
12908
12864
|
}
|
|
12909
12865
|
}
|
|
12910
12866
|
|
|
12911
|
-
// bazel-out/
|
|
12867
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/diagnostics/src/id.mjs
|
|
12912
12868
|
var TEMPLATE_ID = Symbol("ngTemplateId");
|
|
12913
12869
|
var NEXT_TEMPLATE_ID = Symbol("ngNextTemplateId");
|
|
12914
12870
|
function getTemplateId(clazz) {
|
|
@@ -12925,17 +12881,17 @@ function allocateTemplateId(sf) {
|
|
|
12925
12881
|
return `tcb${sf[NEXT_TEMPLATE_ID]++}`;
|
|
12926
12882
|
}
|
|
12927
12883
|
|
|
12928
|
-
// bazel-out/
|
|
12884
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
12929
12885
|
import { EmptyExpr, ImplicitReceiver as ImplicitReceiver2, PropertyRead, PropertyWrite, SafePropertyRead, TmplAstReference as TmplAstReference2, TmplAstTextAttribute } from "@angular/compiler";
|
|
12930
|
-
import
|
|
12886
|
+
import ts54 from "typescript";
|
|
12931
12887
|
|
|
12932
|
-
// bazel-out/
|
|
12888
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/comments.mjs
|
|
12933
12889
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan2 } from "@angular/compiler";
|
|
12934
|
-
import
|
|
12890
|
+
import ts53 from "typescript";
|
|
12935
12891
|
var parseSpanComment = /^(\d+),(\d+)$/;
|
|
12936
12892
|
function readSpanComment(node, sourceFile = node.getSourceFile()) {
|
|
12937
|
-
return
|
|
12938
|
-
if (kind !==
|
|
12893
|
+
return ts53.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
12894
|
+
if (kind !== ts53.SyntaxKind.MultiLineCommentTrivia) {
|
|
12939
12895
|
return null;
|
|
12940
12896
|
}
|
|
12941
12897
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -12958,15 +12914,15 @@ var ExpressionIdentifier;
|
|
|
12958
12914
|
ExpressionIdentifier2["EVENT_PARAMETER"] = "EP";
|
|
12959
12915
|
})(ExpressionIdentifier || (ExpressionIdentifier = {}));
|
|
12960
12916
|
function addExpressionIdentifier(node, identifier) {
|
|
12961
|
-
|
|
12917
|
+
ts53.addSyntheticTrailingComment(node, ts53.SyntaxKind.MultiLineCommentTrivia, `${CommentTriviaType.EXPRESSION_TYPE_IDENTIFIER}:${identifier}`, false);
|
|
12962
12918
|
}
|
|
12963
12919
|
var IGNORE_FOR_DIAGNOSTICS_MARKER = `${CommentTriviaType.DIAGNOSTIC}:ignore`;
|
|
12964
12920
|
function markIgnoreDiagnostics(node) {
|
|
12965
|
-
|
|
12921
|
+
ts53.addSyntheticTrailingComment(node, ts53.SyntaxKind.MultiLineCommentTrivia, IGNORE_FOR_DIAGNOSTICS_MARKER, false);
|
|
12966
12922
|
}
|
|
12967
12923
|
function hasIgnoreForDiagnosticsMarker(node, sourceFile) {
|
|
12968
|
-
return
|
|
12969
|
-
if (kind !==
|
|
12924
|
+
return ts53.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
12925
|
+
if (kind !== ts53.SyntaxKind.MultiLineCommentTrivia) {
|
|
12970
12926
|
return null;
|
|
12971
12927
|
}
|
|
12972
12928
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -13040,8 +12996,8 @@ function findAllMatchingNodes(tcb, opts) {
|
|
|
13040
12996
|
return results;
|
|
13041
12997
|
}
|
|
13042
12998
|
function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
13043
|
-
return
|
|
13044
|
-
if (kind !==
|
|
12999
|
+
return ts53.forEachTrailingCommentRange(sourceFile.text, node.getEnd(), (pos, end, kind) => {
|
|
13000
|
+
if (kind !== ts53.SyntaxKind.MultiLineCommentTrivia) {
|
|
13045
13001
|
return false;
|
|
13046
13002
|
}
|
|
13047
13003
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -13049,7 +13005,7 @@ function hasExpressionIdentifier(sourceFile, node, identifier) {
|
|
|
13049
13005
|
}) || false;
|
|
13050
13006
|
}
|
|
13051
13007
|
|
|
13052
|
-
// bazel-out/
|
|
13008
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/completion.mjs
|
|
13053
13009
|
var CompletionEngine = class {
|
|
13054
13010
|
constructor(tcb, data, shimPath) {
|
|
13055
13011
|
this.tcb = tcb;
|
|
@@ -13058,7 +13014,7 @@ var CompletionEngine = class {
|
|
|
13058
13014
|
this.templateContextCache = new Map();
|
|
13059
13015
|
this.expressionCompletionCache = new Map();
|
|
13060
13016
|
const globalRead = findFirstMatchingNode(this.tcb, {
|
|
13061
|
-
filter:
|
|
13017
|
+
filter: ts54.isPropertyAccessExpression,
|
|
13062
13018
|
withExpressionIdentifier: ExpressionIdentifier.COMPONENT_COMPLETION
|
|
13063
13019
|
});
|
|
13064
13020
|
if (globalRead !== null) {
|
|
@@ -13081,7 +13037,7 @@ var CompletionEngine = class {
|
|
|
13081
13037
|
let nodeContext = null;
|
|
13082
13038
|
if (node instanceof EmptyExpr) {
|
|
13083
13039
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
13084
|
-
filter:
|
|
13040
|
+
filter: ts54.isIdentifier,
|
|
13085
13041
|
withSpan: node.sourceSpan
|
|
13086
13042
|
});
|
|
13087
13043
|
if (nodeLocation !== null) {
|
|
@@ -13093,7 +13049,7 @@ var CompletionEngine = class {
|
|
|
13093
13049
|
}
|
|
13094
13050
|
if (node instanceof PropertyRead && node.receiver instanceof ImplicitReceiver2) {
|
|
13095
13051
|
const nodeLocation = findFirstMatchingNode(this.tcb, {
|
|
13096
|
-
filter:
|
|
13052
|
+
filter: ts54.isPropertyAccessExpression,
|
|
13097
13053
|
withSpan: node.sourceSpan
|
|
13098
13054
|
});
|
|
13099
13055
|
if (nodeLocation) {
|
|
@@ -13116,21 +13072,21 @@ var CompletionEngine = class {
|
|
|
13116
13072
|
let tsExpr = null;
|
|
13117
13073
|
if (expr instanceof PropertyRead || expr instanceof PropertyWrite) {
|
|
13118
13074
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
13119
|
-
filter:
|
|
13075
|
+
filter: ts54.isPropertyAccessExpression,
|
|
13120
13076
|
withSpan: expr.nameSpan
|
|
13121
13077
|
});
|
|
13122
13078
|
} else if (expr instanceof SafePropertyRead) {
|
|
13123
13079
|
const ternaryExpr = findFirstMatchingNode(this.tcb, {
|
|
13124
|
-
filter:
|
|
13080
|
+
filter: ts54.isParenthesizedExpression,
|
|
13125
13081
|
withSpan: expr.sourceSpan
|
|
13126
13082
|
});
|
|
13127
|
-
if (ternaryExpr === null || !
|
|
13083
|
+
if (ternaryExpr === null || !ts54.isConditionalExpression(ternaryExpr.expression)) {
|
|
13128
13084
|
return null;
|
|
13129
13085
|
}
|
|
13130
13086
|
const whenTrue = ternaryExpr.expression.whenTrue;
|
|
13131
|
-
if (
|
|
13087
|
+
if (ts54.isPropertyAccessExpression(whenTrue)) {
|
|
13132
13088
|
tsExpr = whenTrue;
|
|
13133
|
-
} else if (
|
|
13089
|
+
} else if (ts54.isCallExpression(whenTrue) && ts54.isPropertyAccessExpression(whenTrue.expression)) {
|
|
13134
13090
|
tsExpr = whenTrue.expression;
|
|
13135
13091
|
}
|
|
13136
13092
|
}
|
|
@@ -13151,15 +13107,15 @@ var CompletionEngine = class {
|
|
|
13151
13107
|
let tsExpr = null;
|
|
13152
13108
|
if (expr instanceof TmplAstTextAttribute) {
|
|
13153
13109
|
const strNode = findFirstMatchingNode(this.tcb, {
|
|
13154
|
-
filter:
|
|
13110
|
+
filter: ts54.isParenthesizedExpression,
|
|
13155
13111
|
withSpan: expr.sourceSpan
|
|
13156
13112
|
});
|
|
13157
|
-
if (strNode !== null &&
|
|
13113
|
+
if (strNode !== null && ts54.isStringLiteral(strNode.expression)) {
|
|
13158
13114
|
tsExpr = strNode.expression;
|
|
13159
13115
|
}
|
|
13160
13116
|
} else {
|
|
13161
13117
|
tsExpr = findFirstMatchingNode(this.tcb, {
|
|
13162
|
-
filter: (n) =>
|
|
13118
|
+
filter: (n) => ts54.isStringLiteral(n) || ts54.isNumericLiteral(n),
|
|
13163
13119
|
withSpan: expr.sourceSpan
|
|
13164
13120
|
});
|
|
13165
13121
|
}
|
|
@@ -13167,7 +13123,7 @@ var CompletionEngine = class {
|
|
|
13167
13123
|
return null;
|
|
13168
13124
|
}
|
|
13169
13125
|
let positionInShimFile = tsExpr.getEnd();
|
|
13170
|
-
if (
|
|
13126
|
+
if (ts54.isStringLiteral(tsExpr)) {
|
|
13171
13127
|
positionInShimFile -= 1;
|
|
13172
13128
|
}
|
|
13173
13129
|
const res = {
|
|
@@ -13200,12 +13156,12 @@ var CompletionEngine = class {
|
|
|
13200
13156
|
}
|
|
13201
13157
|
};
|
|
13202
13158
|
|
|
13203
|
-
// bazel-out/
|
|
13204
|
-
import
|
|
13159
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
13160
|
+
import ts68 from "typescript";
|
|
13205
13161
|
|
|
13206
|
-
// bazel-out/
|
|
13162
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/dom.mjs
|
|
13207
13163
|
import { DomElementSchemaRegistry as DomElementSchemaRegistry2 } from "@angular/compiler";
|
|
13208
|
-
import
|
|
13164
|
+
import ts55 from "typescript";
|
|
13209
13165
|
var REGISTRY = new DomElementSchemaRegistry2();
|
|
13210
13166
|
var REMOVE_XHTML_REGEX = /^:xhtml:/;
|
|
13211
13167
|
var RegistryDomSchemaChecker = class {
|
|
@@ -13229,7 +13185,7 @@ var RegistryDomSchemaChecker = class {
|
|
|
13229
13185
|
} else {
|
|
13230
13186
|
errorMsg += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
|
|
13231
13187
|
}
|
|
13232
|
-
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan,
|
|
13188
|
+
const diag = makeTemplateDiagnostic(id, mapping, element.startSourceSpan, ts55.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ELEMENT), errorMsg);
|
|
13233
13189
|
this._diagnostics.push(diag);
|
|
13234
13190
|
}
|
|
13235
13191
|
}
|
|
@@ -13247,70 +13203,70 @@ var RegistryDomSchemaChecker = class {
|
|
|
13247
13203
|
2. If '${element.name}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
|
|
13248
13204
|
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
|
|
13249
13205
|
}
|
|
13250
|
-
const diag = makeTemplateDiagnostic(id, mapping, span,
|
|
13206
|
+
const diag = makeTemplateDiagnostic(id, mapping, span, ts55.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SCHEMA_INVALID_ATTRIBUTE), errorMsg);
|
|
13251
13207
|
this._diagnostics.push(diag);
|
|
13252
13208
|
}
|
|
13253
13209
|
}
|
|
13254
13210
|
};
|
|
13255
13211
|
|
|
13256
|
-
// bazel-out/
|
|
13212
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
13257
13213
|
import { ExpressionType, ExternalExpr as ExternalExpr9 } from "@angular/compiler";
|
|
13258
|
-
import
|
|
13214
|
+
import ts61 from "typescript";
|
|
13259
13215
|
|
|
13260
|
-
// bazel-out/
|
|
13261
|
-
import
|
|
13216
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/ts_util.mjs
|
|
13217
|
+
import ts56 from "typescript";
|
|
13262
13218
|
var SAFE_TO_CAST_WITHOUT_PARENS = new Set([
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13219
|
+
ts56.SyntaxKind.ParenthesizedExpression,
|
|
13220
|
+
ts56.SyntaxKind.Identifier,
|
|
13221
|
+
ts56.SyntaxKind.CallExpression,
|
|
13222
|
+
ts56.SyntaxKind.NonNullExpression,
|
|
13223
|
+
ts56.SyntaxKind.ElementAccessExpression,
|
|
13224
|
+
ts56.SyntaxKind.PropertyAccessExpression,
|
|
13225
|
+
ts56.SyntaxKind.ArrayLiteralExpression,
|
|
13226
|
+
ts56.SyntaxKind.ObjectLiteralExpression,
|
|
13227
|
+
ts56.SyntaxKind.StringLiteral,
|
|
13228
|
+
ts56.SyntaxKind.NumericLiteral,
|
|
13229
|
+
ts56.SyntaxKind.TrueKeyword,
|
|
13230
|
+
ts56.SyntaxKind.FalseKeyword,
|
|
13231
|
+
ts56.SyntaxKind.NullKeyword,
|
|
13232
|
+
ts56.SyntaxKind.UndefinedKeyword
|
|
13277
13233
|
]);
|
|
13278
13234
|
function tsCastToAny(expr) {
|
|
13279
13235
|
if (!SAFE_TO_CAST_WITHOUT_PARENS.has(expr.kind)) {
|
|
13280
|
-
expr =
|
|
13236
|
+
expr = ts56.createParen(expr);
|
|
13281
13237
|
}
|
|
13282
|
-
return
|
|
13238
|
+
return ts56.createParen(ts56.createAsExpression(expr, ts56.createKeywordTypeNode(ts56.SyntaxKind.AnyKeyword)));
|
|
13283
13239
|
}
|
|
13284
13240
|
function tsCreateElement(tagName) {
|
|
13285
|
-
const createElement =
|
|
13286
|
-
return
|
|
13241
|
+
const createElement = ts56.createPropertyAccess(ts56.createIdentifier("document"), "createElement");
|
|
13242
|
+
return ts56.createCall(createElement, void 0, [ts56.createLiteral(tagName)]);
|
|
13287
13243
|
}
|
|
13288
13244
|
function tsDeclareVariable(id, type) {
|
|
13289
|
-
const decl =
|
|
13290
|
-
return
|
|
13245
|
+
const decl = ts56.createVariableDeclaration(id, type, ts56.createNonNullExpression(ts56.createNull()));
|
|
13246
|
+
return ts56.createVariableStatement(void 0, [decl]);
|
|
13291
13247
|
}
|
|
13292
13248
|
function tsCreateTypeQueryForCoercedInput(typeName, coercedInputName) {
|
|
13293
|
-
return
|
|
13249
|
+
return ts56.createTypeQueryNode(ts56.createQualifiedName(typeName, `ngAcceptInputType_${coercedInputName}`));
|
|
13294
13250
|
}
|
|
13295
13251
|
function tsCreateVariable(id, initializer) {
|
|
13296
|
-
const decl =
|
|
13297
|
-
return
|
|
13252
|
+
const decl = ts56.createVariableDeclaration(id, void 0, initializer);
|
|
13253
|
+
return ts56.createVariableStatement(void 0, [decl]);
|
|
13298
13254
|
}
|
|
13299
13255
|
function tsCallMethod(receiver, methodName, args = []) {
|
|
13300
|
-
const methodAccess =
|
|
13301
|
-
return
|
|
13256
|
+
const methodAccess = ts56.createPropertyAccess(receiver, methodName);
|
|
13257
|
+
return ts56.createCall(methodAccess, void 0, args);
|
|
13302
13258
|
}
|
|
13303
13259
|
function checkIfClassIsExported(node) {
|
|
13304
|
-
if (node.modifiers !== void 0 && node.modifiers.some((mod) => mod.kind ===
|
|
13260
|
+
if (node.modifiers !== void 0 && node.modifiers.some((mod) => mod.kind === ts56.SyntaxKind.ExportKeyword)) {
|
|
13305
13261
|
return true;
|
|
13306
|
-
} else if (node.parent !== void 0 &&
|
|
13262
|
+
} else if (node.parent !== void 0 && ts56.isSourceFile(node.parent) && checkIfFileHasExport(node.parent, node.name.text)) {
|
|
13307
13263
|
return true;
|
|
13308
13264
|
}
|
|
13309
13265
|
return false;
|
|
13310
13266
|
}
|
|
13311
13267
|
function checkIfFileHasExport(sf, name) {
|
|
13312
13268
|
for (const stmt of sf.statements) {
|
|
13313
|
-
if (
|
|
13269
|
+
if (ts56.isExportDeclaration(stmt) && stmt.exportClause !== void 0 && ts56.isNamedExports(stmt.exportClause)) {
|
|
13314
13270
|
for (const element of stmt.exportClause.elements) {
|
|
13315
13271
|
if (element.propertyName === void 0 && element.name.text === name) {
|
|
13316
13272
|
return true;
|
|
@@ -13323,20 +13279,20 @@ function checkIfFileHasExport(sf, name) {
|
|
|
13323
13279
|
return false;
|
|
13324
13280
|
}
|
|
13325
13281
|
function isAccessExpression(node) {
|
|
13326
|
-
return
|
|
13282
|
+
return ts56.isPropertyAccessExpression(node) || ts56.isElementAccessExpression(node);
|
|
13327
13283
|
}
|
|
13328
13284
|
|
|
13329
|
-
// bazel-out/
|
|
13330
|
-
import ts61 from "typescript";
|
|
13331
|
-
|
|
13332
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
13285
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
13333
13286
|
import ts60 from "typescript";
|
|
13334
13287
|
|
|
13335
|
-
// bazel-out/
|
|
13288
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
13336
13289
|
import ts59 from "typescript";
|
|
13337
13290
|
|
|
13338
|
-
// bazel-out/
|
|
13291
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
13339
13292
|
import ts58 from "typescript";
|
|
13293
|
+
|
|
13294
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_emitter.mjs
|
|
13295
|
+
import ts57 from "typescript";
|
|
13340
13296
|
var INELIGIBLE = {};
|
|
13341
13297
|
function canEmitType(type, resolver) {
|
|
13342
13298
|
return canEmitTypeWorker(type);
|
|
@@ -13344,13 +13300,13 @@ function canEmitType(type, resolver) {
|
|
|
13344
13300
|
return visitNode(type2) !== INELIGIBLE;
|
|
13345
13301
|
}
|
|
13346
13302
|
function visitNode(node) {
|
|
13347
|
-
if (
|
|
13303
|
+
if (ts57.isImportTypeNode(node)) {
|
|
13348
13304
|
return INELIGIBLE;
|
|
13349
13305
|
}
|
|
13350
|
-
if (
|
|
13306
|
+
if (ts57.isTypeReferenceNode(node) && !canEmitTypeReference(node)) {
|
|
13351
13307
|
return INELIGIBLE;
|
|
13352
13308
|
} else {
|
|
13353
|
-
return
|
|
13309
|
+
return ts57.forEachChild(node, visitNode);
|
|
13354
13310
|
}
|
|
13355
13311
|
}
|
|
13356
13312
|
function canEmitTypeReference(type2) {
|
|
@@ -13372,22 +13328,22 @@ var TypeEmitter = class {
|
|
|
13372
13328
|
emitType(type) {
|
|
13373
13329
|
const typeReferenceTransformer = (context) => {
|
|
13374
13330
|
const visitNode = (node) => {
|
|
13375
|
-
if (
|
|
13331
|
+
if (ts57.isImportTypeNode(node)) {
|
|
13376
13332
|
throw new Error("Unable to emit import type");
|
|
13377
13333
|
}
|
|
13378
|
-
if (
|
|
13334
|
+
if (ts57.isTypeReferenceNode(node)) {
|
|
13379
13335
|
return this.emitTypeReference(node);
|
|
13380
|
-
} else if (
|
|
13381
|
-
const clone =
|
|
13382
|
-
|
|
13336
|
+
} else if (ts57.isLiteralExpression(node)) {
|
|
13337
|
+
const clone = ts57.getMutableClone(node);
|
|
13338
|
+
ts57.setTextRange(clone, { pos: -1, end: -1 });
|
|
13383
13339
|
return clone;
|
|
13384
13340
|
} else {
|
|
13385
|
-
return
|
|
13341
|
+
return ts57.visitEachChild(node, visitNode, context);
|
|
13386
13342
|
}
|
|
13387
13343
|
};
|
|
13388
|
-
return (node) =>
|
|
13344
|
+
return (node) => ts57.visitNode(node, visitNode);
|
|
13389
13345
|
};
|
|
13390
|
-
return
|
|
13346
|
+
return ts57.transform(type, [typeReferenceTransformer]).transformed[0];
|
|
13391
13347
|
}
|
|
13392
13348
|
emitTypeReference(type) {
|
|
13393
13349
|
const reference = this.resolver(type);
|
|
@@ -13396,21 +13352,21 @@ var TypeEmitter = class {
|
|
|
13396
13352
|
}
|
|
13397
13353
|
let typeArguments = void 0;
|
|
13398
13354
|
if (type.typeArguments !== void 0) {
|
|
13399
|
-
typeArguments =
|
|
13355
|
+
typeArguments = ts57.createNodeArray(type.typeArguments.map((typeArg) => this.emitType(typeArg)));
|
|
13400
13356
|
}
|
|
13401
13357
|
let typeName = type.typeName;
|
|
13402
13358
|
if (reference instanceof Reference) {
|
|
13403
13359
|
const emittedType = this.emitReference(reference);
|
|
13404
|
-
if (!
|
|
13405
|
-
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${
|
|
13360
|
+
if (!ts57.isTypeReferenceNode(emittedType)) {
|
|
13361
|
+
throw new Error(`Expected TypeReferenceNode for emitted reference, got ${ts57.SyntaxKind[emittedType.kind]}`);
|
|
13406
13362
|
}
|
|
13407
13363
|
typeName = emittedType.typeName;
|
|
13408
13364
|
}
|
|
13409
|
-
return
|
|
13365
|
+
return ts57.updateTypeReferenceNode(type, typeName, typeArguments);
|
|
13410
13366
|
}
|
|
13411
13367
|
};
|
|
13412
13368
|
|
|
13413
|
-
// bazel-out/
|
|
13369
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.mjs
|
|
13414
13370
|
var TypeParameterEmitter = class {
|
|
13415
13371
|
constructor(typeParameters, reflector) {
|
|
13416
13372
|
this.typeParameters = typeParameters;
|
|
@@ -13438,11 +13394,11 @@ var TypeParameterEmitter = class {
|
|
|
13438
13394
|
return this.typeParameters.map((typeParam) => {
|
|
13439
13395
|
const constraint = typeParam.constraint !== void 0 ? emitter.emitType(typeParam.constraint) : void 0;
|
|
13440
13396
|
const defaultType = typeParam.default !== void 0 ? emitter.emitType(typeParam.default) : void 0;
|
|
13441
|
-
return
|
|
13397
|
+
return ts58.updateTypeParameterDeclaration(typeParam, typeParam.name, constraint, defaultType);
|
|
13442
13398
|
});
|
|
13443
13399
|
}
|
|
13444
13400
|
resolveTypeReference(type) {
|
|
13445
|
-
const target =
|
|
13401
|
+
const target = ts58.isIdentifier(type.typeName) ? type.typeName : type.typeName.right;
|
|
13446
13402
|
const declaration = this.reflector.getDeclarationOfIdentifier(target);
|
|
13447
13403
|
if (declaration === null || declaration.node === null) {
|
|
13448
13404
|
return null;
|
|
@@ -13463,7 +13419,7 @@ var TypeParameterEmitter = class {
|
|
|
13463
13419
|
return new Reference(declaration.node, owningModule2);
|
|
13464
13420
|
}
|
|
13465
13421
|
isTopLevelExport(decl) {
|
|
13466
|
-
if (decl.parent === void 0 || !
|
|
13422
|
+
if (decl.parent === void 0 || !ts58.isSourceFile(decl.parent)) {
|
|
13467
13423
|
return false;
|
|
13468
13424
|
}
|
|
13469
13425
|
return this.reflector.isStaticallyExported(decl);
|
|
@@ -13473,7 +13429,7 @@ var TypeParameterEmitter = class {
|
|
|
13473
13429
|
}
|
|
13474
13430
|
};
|
|
13475
13431
|
|
|
13476
|
-
// bazel-out/
|
|
13432
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.mjs
|
|
13477
13433
|
var TcbInliningRequirement;
|
|
13478
13434
|
(function(TcbInliningRequirement2) {
|
|
13479
13435
|
TcbInliningRequirement2[TcbInliningRequirement2["MustInline"] = 0] = "MustInline";
|
|
@@ -13506,14 +13462,14 @@ function getTemplateMapping(shimSf, position, resolver, isDiagnosticRequest) {
|
|
|
13506
13462
|
}
|
|
13507
13463
|
function findTypeCheckBlock(file, id, isDiagnosticRequest) {
|
|
13508
13464
|
for (const stmt of file.statements) {
|
|
13509
|
-
if (
|
|
13465
|
+
if (ts59.isFunctionDeclaration(stmt) && getTemplateId2(stmt, file, isDiagnosticRequest) === id) {
|
|
13510
13466
|
return stmt;
|
|
13511
13467
|
}
|
|
13512
13468
|
}
|
|
13513
13469
|
return null;
|
|
13514
13470
|
}
|
|
13515
13471
|
function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
13516
|
-
while (node !== void 0 && !
|
|
13472
|
+
while (node !== void 0 && !ts59.isFunctionDeclaration(node)) {
|
|
13517
13473
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticsRequest) {
|
|
13518
13474
|
return null;
|
|
13519
13475
|
}
|
|
@@ -13530,7 +13486,7 @@ function findSourceLocation(node, sourceFile, isDiagnosticsRequest) {
|
|
|
13530
13486
|
return null;
|
|
13531
13487
|
}
|
|
13532
13488
|
function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
13533
|
-
while (!
|
|
13489
|
+
while (!ts59.isFunctionDeclaration(node)) {
|
|
13534
13490
|
if (hasIgnoreForDiagnosticsMarker(node, sourceFile) && isDiagnosticRequest) {
|
|
13535
13491
|
return null;
|
|
13536
13492
|
}
|
|
@@ -13540,8 +13496,8 @@ function getTemplateId2(node, sourceFile, isDiagnosticRequest) {
|
|
|
13540
13496
|
}
|
|
13541
13497
|
}
|
|
13542
13498
|
const start = node.getFullStart();
|
|
13543
|
-
return
|
|
13544
|
-
if (kind !==
|
|
13499
|
+
return ts59.forEachLeadingCommentRange(sourceFile.text, start, (pos, end, kind) => {
|
|
13500
|
+
if (kind !== ts59.SyntaxKind.MultiLineCommentTrivia) {
|
|
13545
13501
|
return null;
|
|
13546
13502
|
}
|
|
13547
13503
|
const commentText = sourceFile.text.substring(pos + 2, end - 2);
|
|
@@ -13552,35 +13508,35 @@ function checkIfGenericTypeBoundsAreContextFree(node, reflector) {
|
|
|
13552
13508
|
return new TypeParameterEmitter(node.typeParameters, reflector).canEmit();
|
|
13553
13509
|
}
|
|
13554
13510
|
|
|
13555
|
-
// bazel-out/
|
|
13511
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.mjs
|
|
13556
13512
|
function generateTypeCtorDeclarationFn(node, meta, nodeTypeRef, typeParams, reflector) {
|
|
13557
13513
|
if (requiresInlineTypeCtor(node, reflector)) {
|
|
13558
13514
|
throw new Error(`${node.name.text} requires an inline type constructor`);
|
|
13559
13515
|
}
|
|
13560
13516
|
const rawTypeArgs = typeParams !== void 0 ? generateGenericArgs(typeParams) : void 0;
|
|
13561
|
-
const rawType =
|
|
13517
|
+
const rawType = ts60.createTypeReferenceNode(nodeTypeRef, rawTypeArgs);
|
|
13562
13518
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
13563
13519
|
const typeParameters = typeParametersWithDefaultTypes(typeParams);
|
|
13564
13520
|
if (meta.body) {
|
|
13565
|
-
const fnType =
|
|
13566
|
-
const decl =
|
|
13567
|
-
const declList =
|
|
13568
|
-
return
|
|
13521
|
+
const fnType = ts60.createFunctionTypeNode(typeParameters, [initParam], rawType);
|
|
13522
|
+
const decl = ts60.createVariableDeclaration(meta.fnName, fnType, ts60.createNonNullExpression(ts60.createNull()));
|
|
13523
|
+
const declList = ts60.createVariableDeclarationList([decl], ts60.NodeFlags.Const);
|
|
13524
|
+
return ts60.createVariableStatement(void 0, declList);
|
|
13569
13525
|
} else {
|
|
13570
|
-
return
|
|
13526
|
+
return ts60.createFunctionDeclaration(void 0, [ts60.createModifier(ts60.SyntaxKind.DeclareKeyword)], void 0, meta.fnName, typeParameters, [initParam], rawType, void 0);
|
|
13571
13527
|
}
|
|
13572
13528
|
}
|
|
13573
13529
|
function generateInlineTypeCtor(node, meta) {
|
|
13574
13530
|
const rawTypeArgs = node.typeParameters !== void 0 ? generateGenericArgs(node.typeParameters) : void 0;
|
|
13575
|
-
const rawType =
|
|
13531
|
+
const rawType = ts60.createTypeReferenceNode(node.name, rawTypeArgs);
|
|
13576
13532
|
const initParam = constructTypeCtorParameter(node, meta, rawType);
|
|
13577
13533
|
let body = void 0;
|
|
13578
13534
|
if (meta.body) {
|
|
13579
|
-
body =
|
|
13580
|
-
|
|
13535
|
+
body = ts60.createBlock([
|
|
13536
|
+
ts60.createReturn(ts60.createNonNullExpression(ts60.createNull()))
|
|
13581
13537
|
]);
|
|
13582
13538
|
}
|
|
13583
|
-
return
|
|
13539
|
+
return ts60.createMethod(void 0, [ts60.createModifier(ts60.SyntaxKind.StaticKeyword)], void 0, meta.fnName, void 0, typeParametersWithDefaultTypes(node.typeParameters), [initParam], rawType, body);
|
|
13584
13540
|
}
|
|
13585
13541
|
function constructTypeCtorParameter(node, meta, rawType) {
|
|
13586
13542
|
let initType = null;
|
|
@@ -13589,26 +13545,26 @@ function constructTypeCtorParameter(node, meta, rawType) {
|
|
|
13589
13545
|
const coercedKeys = [];
|
|
13590
13546
|
for (const key of keys) {
|
|
13591
13547
|
if (!meta.coercedInputFields.has(key)) {
|
|
13592
|
-
plainKeys.push(
|
|
13548
|
+
plainKeys.push(ts60.createLiteralTypeNode(ts60.createStringLiteral(key)));
|
|
13593
13549
|
} else {
|
|
13594
|
-
coercedKeys.push(
|
|
13550
|
+
coercedKeys.push(ts60.createPropertySignature(void 0, key, void 0, tsCreateTypeQueryForCoercedInput(rawType.typeName, key), void 0));
|
|
13595
13551
|
}
|
|
13596
13552
|
}
|
|
13597
13553
|
if (plainKeys.length > 0) {
|
|
13598
|
-
const keyTypeUnion =
|
|
13599
|
-
initType =
|
|
13554
|
+
const keyTypeUnion = ts60.createUnionTypeNode(plainKeys);
|
|
13555
|
+
initType = ts60.createTypeReferenceNode("Pick", [rawType, keyTypeUnion]);
|
|
13600
13556
|
}
|
|
13601
13557
|
if (coercedKeys.length > 0) {
|
|
13602
|
-
const coercedLiteral =
|
|
13603
|
-
initType = initType !== null ?
|
|
13558
|
+
const coercedLiteral = ts60.createTypeLiteralNode(coercedKeys);
|
|
13559
|
+
initType = initType !== null ? ts60.createIntersectionTypeNode([initType, coercedLiteral]) : coercedLiteral;
|
|
13604
13560
|
}
|
|
13605
13561
|
if (initType === null) {
|
|
13606
|
-
initType =
|
|
13562
|
+
initType = ts60.createTypeLiteralNode([]);
|
|
13607
13563
|
}
|
|
13608
|
-
return
|
|
13564
|
+
return ts60.createParameter(void 0, void 0, void 0, "init", void 0, initType, void 0);
|
|
13609
13565
|
}
|
|
13610
13566
|
function generateGenericArgs(params) {
|
|
13611
|
-
return params.map((param) =>
|
|
13567
|
+
return params.map((param) => ts60.createTypeReferenceNode(param.name, void 0));
|
|
13612
13568
|
}
|
|
13613
13569
|
function requiresInlineTypeCtor(node, host) {
|
|
13614
13570
|
return !checkIfGenericTypeBoundsAreContextFree(node, host);
|
|
@@ -13619,14 +13575,14 @@ function typeParametersWithDefaultTypes(params) {
|
|
|
13619
13575
|
}
|
|
13620
13576
|
return params.map((param) => {
|
|
13621
13577
|
if (param.default === void 0) {
|
|
13622
|
-
return
|
|
13578
|
+
return ts60.updateTypeParameterDeclaration(param, param.name, param.constraint, ts60.createKeywordTypeNode(ts60.SyntaxKind.AnyKeyword));
|
|
13623
13579
|
} else {
|
|
13624
13580
|
return param;
|
|
13625
13581
|
}
|
|
13626
13582
|
});
|
|
13627
13583
|
}
|
|
13628
13584
|
|
|
13629
|
-
// bazel-out/
|
|
13585
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/environment.mjs
|
|
13630
13586
|
var Environment = class {
|
|
13631
13587
|
constructor(config, importManager, refEmitter, reflector, contextFile) {
|
|
13632
13588
|
this.config = config;
|
|
@@ -13651,13 +13607,13 @@ var Environment = class {
|
|
|
13651
13607
|
}
|
|
13652
13608
|
if (requiresInlineTypeCtor(node, this.reflector)) {
|
|
13653
13609
|
const ref = this.reference(dirRef);
|
|
13654
|
-
const typeCtorExpr =
|
|
13610
|
+
const typeCtorExpr = ts61.createPropertyAccess(ref, "ngTypeCtor");
|
|
13655
13611
|
this.typeCtors.set(node, typeCtorExpr);
|
|
13656
13612
|
return typeCtorExpr;
|
|
13657
13613
|
} else {
|
|
13658
13614
|
const fnName = `_ctor${this.nextIds.typeCtor++}`;
|
|
13659
13615
|
const nodeTypeRef = this.referenceType(dirRef);
|
|
13660
|
-
if (!
|
|
13616
|
+
if (!ts61.isTypeReferenceNode(nodeTypeRef)) {
|
|
13661
13617
|
throw new Error(`Expected TypeReferenceNode from reference to ${dirRef.debugName}`);
|
|
13662
13618
|
}
|
|
13663
13619
|
const meta = {
|
|
@@ -13673,7 +13629,7 @@ var Environment = class {
|
|
|
13673
13629
|
const typeParams = this.emitTypeParameters(node);
|
|
13674
13630
|
const typeCtor = generateTypeCtorDeclarationFn(node, meta, nodeTypeRef.typeName, typeParams, this.reflector);
|
|
13675
13631
|
this.typeCtorStatements.push(typeCtor);
|
|
13676
|
-
const fnId =
|
|
13632
|
+
const fnId = ts61.createIdentifier(fnName);
|
|
13677
13633
|
this.typeCtors.set(node, fnId);
|
|
13678
13634
|
return fnId;
|
|
13679
13635
|
}
|
|
@@ -13683,7 +13639,7 @@ var Environment = class {
|
|
|
13683
13639
|
return this.pipeInsts.get(ref.node);
|
|
13684
13640
|
}
|
|
13685
13641
|
const pipeType = this.referenceType(ref);
|
|
13686
|
-
const pipeInstId =
|
|
13642
|
+
const pipeInstId = ts61.createIdentifier(`_pipe${this.nextIds.pipeInst++}`);
|
|
13687
13643
|
this.pipeInstStatements.push(tsDeclareVariable(pipeInstId, pipeType));
|
|
13688
13644
|
this.pipeInsts.set(ref.node, pipeInstId);
|
|
13689
13645
|
return pipeInstId;
|
|
@@ -13712,9 +13668,9 @@ var Environment = class {
|
|
|
13712
13668
|
}
|
|
13713
13669
|
};
|
|
13714
13670
|
|
|
13715
|
-
// bazel-out/
|
|
13671
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/oob.mjs
|
|
13716
13672
|
import { TmplAstElement as TmplAstElement2 } from "@angular/compiler";
|
|
13717
|
-
import
|
|
13673
|
+
import ts62 from "typescript";
|
|
13718
13674
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
13719
13675
|
constructor(resolver) {
|
|
13720
13676
|
this.resolver = resolver;
|
|
@@ -13728,7 +13684,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
13728
13684
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
13729
13685
|
const value = ref.value.trim();
|
|
13730
13686
|
const errorMsg = `No directive found with exportAs '${value}'.`;
|
|
13731
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan,
|
|
13687
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, ref.valueSpan || ref.sourceSpan, ts62.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REFERENCE_TARGET), errorMsg));
|
|
13732
13688
|
}
|
|
13733
13689
|
missingPipe(templateId, ast) {
|
|
13734
13690
|
if (this.recordedPipes.has(ast)) {
|
|
@@ -13740,7 +13696,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
13740
13696
|
if (sourceSpan === null) {
|
|
13741
13697
|
throw new Error(`Assertion failure: no SourceLocation found for usage of pipe '${ast.name}'.`);
|
|
13742
13698
|
}
|
|
13743
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
13699
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts62.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_PIPE), errorMsg));
|
|
13744
13700
|
this.recordedPipes.add(ast);
|
|
13745
13701
|
}
|
|
13746
13702
|
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
@@ -13751,7 +13707,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
13751
13707
|
if (sourceSpan === null) {
|
|
13752
13708
|
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
13753
13709
|
}
|
|
13754
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan,
|
|
13710
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts62.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
13755
13711
|
text: `The variable ${assignment.name} is declared here.`,
|
|
13756
13712
|
start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
|
|
13757
13713
|
end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
|
|
@@ -13761,7 +13717,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
13761
13717
|
duplicateTemplateVar(templateId, variable, firstDecl) {
|
|
13762
13718
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
13763
13719
|
const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
|
|
13764
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan,
|
|
13720
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, variable.sourceSpan, ts62.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_VARIABLE_DECLARATION), errorMsg, [{
|
|
13765
13721
|
text: `The variable '${firstDecl.name}' was first declared here.`,
|
|
13766
13722
|
start: firstDecl.sourceSpan.start.offset,
|
|
13767
13723
|
end: firstDecl.sourceSpan.end.offset,
|
|
@@ -13800,7 +13756,7 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
13800
13756
|
const message = `This structural directive supports advanced type inference, but the current compiler configuration prevents its usage. The variable ${varIdentification} will have type 'any' as a result.
|
|
13801
13757
|
|
|
13802
13758
|
Consider enabling the 'strictTemplates' option in your tsconfig.json for better type inference within this template.`;
|
|
13803
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan,
|
|
13759
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, diagnosticVar.keySpan, ts62.DiagnosticCategory.Suggestion, ngErrorCode(ErrorCode.SUGGEST_SUBOPTIMAL_TYPE_INFERENCE), message));
|
|
13804
13760
|
}
|
|
13805
13761
|
splitTwoWayBinding(templateId, input, output, inputConsumer, outputConsumer) {
|
|
13806
13762
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
@@ -13834,7 +13790,7 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
13834
13790
|
sourceFile: outputConsumer.name.getSourceFile()
|
|
13835
13791
|
});
|
|
13836
13792
|
}
|
|
13837
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan,
|
|
13793
|
+
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, input.keySpan, ts62.DiagnosticCategory.Error, ngErrorCode(ErrorCode.SPLIT_TWO_WAY_BINDING), errorMsg, relatedMessages));
|
|
13838
13794
|
}
|
|
13839
13795
|
};
|
|
13840
13796
|
function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
|
|
@@ -13844,8 +13800,8 @@ function makeInlineDiagnostic(templateId, code, node, messageText, relatedInform
|
|
|
13844
13800
|
});
|
|
13845
13801
|
}
|
|
13846
13802
|
|
|
13847
|
-
// bazel-out/
|
|
13848
|
-
import
|
|
13803
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/shim.mjs
|
|
13804
|
+
import ts63 from "typescript";
|
|
13849
13805
|
var TypeCheckShimGenerator = class {
|
|
13850
13806
|
constructor() {
|
|
13851
13807
|
this.extensionPrefix = "ngtypecheck";
|
|
@@ -13855,25 +13811,25 @@ var TypeCheckShimGenerator = class {
|
|
|
13855
13811
|
if (priorShimSf !== null) {
|
|
13856
13812
|
return priorShimSf;
|
|
13857
13813
|
}
|
|
13858
|
-
return
|
|
13814
|
+
return ts63.createSourceFile(genFilePath, "export const USED_FOR_NG_TYPE_CHECKING = true;", ts63.ScriptTarget.Latest, true, ts63.ScriptKind.TS);
|
|
13859
13815
|
}
|
|
13860
13816
|
static shimFor(fileName) {
|
|
13861
13817
|
return absoluteFrom(fileName.replace(/\.tsx?$/, ".ngtypecheck.ts"));
|
|
13862
13818
|
}
|
|
13863
13819
|
};
|
|
13864
13820
|
|
|
13865
|
-
// bazel-out/
|
|
13821
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
13866
13822
|
import { BindingPipe, Call as Call2, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver4, PropertyRead as PropertyRead2, PropertyWrite as PropertyWrite2, SafePropertyRead as SafePropertyRead3, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstElement as TmplAstElement3, TmplAstIcu, TmplAstReference as TmplAstReference3, TmplAstTemplate as TmplAstTemplate2, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
|
|
13867
|
-
import
|
|
13823
|
+
import ts66 from "typescript";
|
|
13868
13824
|
|
|
13869
|
-
// bazel-out/
|
|
13825
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
|
|
13870
13826
|
import { AbsoluteSourceSpan as AbsoluteSourceSpan3 } from "@angular/compiler";
|
|
13871
|
-
import
|
|
13827
|
+
import ts64 from "typescript";
|
|
13872
13828
|
function wrapForDiagnostics(expr) {
|
|
13873
|
-
return
|
|
13829
|
+
return ts64.createParen(expr);
|
|
13874
13830
|
}
|
|
13875
13831
|
function wrapForTypeChecker(expr) {
|
|
13876
|
-
return
|
|
13832
|
+
return ts64.createParen(expr);
|
|
13877
13833
|
}
|
|
13878
13834
|
function addParseSpanInfo(node, span) {
|
|
13879
13835
|
let commentText;
|
|
@@ -13882,10 +13838,10 @@ function addParseSpanInfo(node, span) {
|
|
|
13882
13838
|
} else {
|
|
13883
13839
|
commentText = `${span.start.offset},${span.end.offset}`;
|
|
13884
13840
|
}
|
|
13885
|
-
|
|
13841
|
+
ts64.addSyntheticTrailingComment(node, ts64.SyntaxKind.MultiLineCommentTrivia, commentText, false);
|
|
13886
13842
|
}
|
|
13887
13843
|
function addTemplateId(tcb, id) {
|
|
13888
|
-
|
|
13844
|
+
ts64.addSyntheticLeadingComment(tcb, ts64.SyntaxKind.MultiLineCommentTrivia, id, true);
|
|
13889
13845
|
}
|
|
13890
13846
|
function shouldReportDiagnostic(diagnostic) {
|
|
13891
13847
|
const { code } = diagnostic;
|
|
@@ -13912,34 +13868,34 @@ function translateDiagnostic(diagnostic, resolver) {
|
|
|
13912
13868
|
return makeTemplateDiagnostic(sourceLocation.id, templateSourceMapping, span, diagnostic.category, diagnostic.code, diagnostic.messageText);
|
|
13913
13869
|
}
|
|
13914
13870
|
|
|
13915
|
-
// bazel-out/
|
|
13871
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/expression.mjs
|
|
13916
13872
|
import { ASTWithSource as ASTWithSource2, Call, EmptyExpr as EmptyExpr2, SafeKeyedRead, SafePropertyRead as SafePropertyRead2 } from "@angular/compiler";
|
|
13917
|
-
import
|
|
13918
|
-
var NULL_AS_ANY =
|
|
13919
|
-
var UNDEFINED =
|
|
13873
|
+
import ts65 from "typescript";
|
|
13874
|
+
var NULL_AS_ANY = ts65.createAsExpression(ts65.createNull(), ts65.createKeywordTypeNode(ts65.SyntaxKind.AnyKeyword));
|
|
13875
|
+
var UNDEFINED = ts65.createIdentifier("undefined");
|
|
13920
13876
|
var UNARY_OPS = new Map([
|
|
13921
|
-
["+",
|
|
13922
|
-
["-",
|
|
13877
|
+
["+", ts65.SyntaxKind.PlusToken],
|
|
13878
|
+
["-", ts65.SyntaxKind.MinusToken]
|
|
13923
13879
|
]);
|
|
13924
13880
|
var BINARY_OPS = new Map([
|
|
13925
|
-
["+",
|
|
13926
|
-
["-",
|
|
13927
|
-
["<",
|
|
13928
|
-
[">",
|
|
13929
|
-
["<=",
|
|
13930
|
-
[">=",
|
|
13931
|
-
["==",
|
|
13932
|
-
["===",
|
|
13933
|
-
["*",
|
|
13934
|
-
["/",
|
|
13935
|
-
["%",
|
|
13936
|
-
["!=",
|
|
13937
|
-
["!==",
|
|
13938
|
-
["||",
|
|
13939
|
-
["&&",
|
|
13940
|
-
["&",
|
|
13941
|
-
["|",
|
|
13942
|
-
["??",
|
|
13881
|
+
["+", ts65.SyntaxKind.PlusToken],
|
|
13882
|
+
["-", ts65.SyntaxKind.MinusToken],
|
|
13883
|
+
["<", ts65.SyntaxKind.LessThanToken],
|
|
13884
|
+
[">", ts65.SyntaxKind.GreaterThanToken],
|
|
13885
|
+
["<=", ts65.SyntaxKind.LessThanEqualsToken],
|
|
13886
|
+
[">=", ts65.SyntaxKind.GreaterThanEqualsToken],
|
|
13887
|
+
["==", ts65.SyntaxKind.EqualsEqualsToken],
|
|
13888
|
+
["===", ts65.SyntaxKind.EqualsEqualsEqualsToken],
|
|
13889
|
+
["*", ts65.SyntaxKind.AsteriskToken],
|
|
13890
|
+
["/", ts65.SyntaxKind.SlashToken],
|
|
13891
|
+
["%", ts65.SyntaxKind.PercentToken],
|
|
13892
|
+
["!=", ts65.SyntaxKind.ExclamationEqualsToken],
|
|
13893
|
+
["!==", ts65.SyntaxKind.ExclamationEqualsEqualsToken],
|
|
13894
|
+
["||", ts65.SyntaxKind.BarBarToken],
|
|
13895
|
+
["&&", ts65.SyntaxKind.AmpersandAmpersandToken],
|
|
13896
|
+
["&", ts65.SyntaxKind.AmpersandToken],
|
|
13897
|
+
["|", ts65.SyntaxKind.BarToken],
|
|
13898
|
+
["??", ts65.SyntaxKind.QuestionQuestionToken]
|
|
13943
13899
|
]);
|
|
13944
13900
|
function astToTypescript(ast, maybeResolve, config) {
|
|
13945
13901
|
const translator = new AstTranslator(maybeResolve, config);
|
|
@@ -13955,7 +13911,7 @@ var AstTranslator = class {
|
|
|
13955
13911
|
ast = ast.ast;
|
|
13956
13912
|
}
|
|
13957
13913
|
if (ast instanceof EmptyExpr2) {
|
|
13958
|
-
const res =
|
|
13914
|
+
const res = ts65.factory.createIdentifier("undefined");
|
|
13959
13915
|
addParseSpanInfo(res, ast.sourceSpan);
|
|
13960
13916
|
return res;
|
|
13961
13917
|
}
|
|
@@ -13971,7 +13927,7 @@ var AstTranslator = class {
|
|
|
13971
13927
|
if (op === void 0) {
|
|
13972
13928
|
throw new Error(`Unsupported Unary.operator: ${ast.operator}`);
|
|
13973
13929
|
}
|
|
13974
|
-
const node = wrapForDiagnostics(
|
|
13930
|
+
const node = wrapForDiagnostics(ts65.createPrefix(op, expr));
|
|
13975
13931
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
13976
13932
|
return node;
|
|
13977
13933
|
}
|
|
@@ -13982,13 +13938,13 @@ var AstTranslator = class {
|
|
|
13982
13938
|
if (op === void 0) {
|
|
13983
13939
|
throw new Error(`Unsupported Binary.operation: ${ast.operation}`);
|
|
13984
13940
|
}
|
|
13985
|
-
const node =
|
|
13941
|
+
const node = ts65.createBinary(lhs, op, rhs);
|
|
13986
13942
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
13987
13943
|
return node;
|
|
13988
13944
|
}
|
|
13989
13945
|
visitChain(ast) {
|
|
13990
13946
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
13991
|
-
const node = wrapForDiagnostics(
|
|
13947
|
+
const node = wrapForDiagnostics(ts65.createCommaList(elements));
|
|
13992
13948
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
13993
13949
|
return node;
|
|
13994
13950
|
}
|
|
@@ -13996,7 +13952,7 @@ var AstTranslator = class {
|
|
|
13996
13952
|
const condExpr = this.translate(ast.condition);
|
|
13997
13953
|
const trueExpr = this.translate(ast.trueExp);
|
|
13998
13954
|
const falseExpr = wrapForTypeChecker(this.translate(ast.falseExp));
|
|
13999
|
-
const node =
|
|
13955
|
+
const node = ts65.createParen(ts65.createConditional(condExpr, trueExpr, falseExpr));
|
|
14000
13956
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14001
13957
|
return node;
|
|
14002
13958
|
}
|
|
@@ -14007,26 +13963,26 @@ var AstTranslator = class {
|
|
|
14007
13963
|
throw new Error("Method not implemented.");
|
|
14008
13964
|
}
|
|
14009
13965
|
visitInterpolation(ast) {
|
|
14010
|
-
return ast.expressions.reduce((lhs, ast2) =>
|
|
13966
|
+
return ast.expressions.reduce((lhs, ast2) => ts65.createBinary(lhs, ts65.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts65.createLiteral(""));
|
|
14011
13967
|
}
|
|
14012
13968
|
visitKeyedRead(ast) {
|
|
14013
13969
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
14014
13970
|
const key = this.translate(ast.key);
|
|
14015
|
-
const node =
|
|
13971
|
+
const node = ts65.createElementAccess(receiver, key);
|
|
14016
13972
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14017
13973
|
return node;
|
|
14018
13974
|
}
|
|
14019
13975
|
visitKeyedWrite(ast) {
|
|
14020
13976
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
14021
|
-
const left =
|
|
13977
|
+
const left = ts65.createElementAccess(receiver, this.translate(ast.key));
|
|
14022
13978
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
14023
|
-
const node = wrapForDiagnostics(
|
|
13979
|
+
const node = wrapForDiagnostics(ts65.createBinary(left, ts65.SyntaxKind.EqualsToken, right));
|
|
14024
13980
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14025
13981
|
return node;
|
|
14026
13982
|
}
|
|
14027
13983
|
visitLiteralArray(ast) {
|
|
14028
13984
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
14029
|
-
const literal2 =
|
|
13985
|
+
const literal2 = ts65.createArrayLiteral(elements);
|
|
14030
13986
|
const node = this.config.strictLiteralTypes ? literal2 : tsCastToAny(literal2);
|
|
14031
13987
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14032
13988
|
return node;
|
|
@@ -14034,9 +13990,9 @@ var AstTranslator = class {
|
|
|
14034
13990
|
visitLiteralMap(ast) {
|
|
14035
13991
|
const properties = ast.keys.map(({ key }, idx) => {
|
|
14036
13992
|
const value = this.translate(ast.values[idx]);
|
|
14037
|
-
return
|
|
13993
|
+
return ts65.createPropertyAssignment(ts65.createStringLiteral(key), value);
|
|
14038
13994
|
});
|
|
14039
|
-
const literal2 =
|
|
13995
|
+
const literal2 = ts65.createObjectLiteral(properties, true);
|
|
14040
13996
|
const node = this.config.strictLiteralTypes ? literal2 : tsCastToAny(literal2);
|
|
14041
13997
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14042
13998
|
return node;
|
|
@@ -14044,18 +14000,18 @@ var AstTranslator = class {
|
|
|
14044
14000
|
visitLiteralPrimitive(ast) {
|
|
14045
14001
|
let node;
|
|
14046
14002
|
if (ast.value === void 0) {
|
|
14047
|
-
node =
|
|
14003
|
+
node = ts65.createIdentifier("undefined");
|
|
14048
14004
|
} else if (ast.value === null) {
|
|
14049
|
-
node =
|
|
14005
|
+
node = ts65.createNull();
|
|
14050
14006
|
} else {
|
|
14051
|
-
node =
|
|
14007
|
+
node = ts65.createLiteral(ast.value);
|
|
14052
14008
|
}
|
|
14053
14009
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14054
14010
|
return node;
|
|
14055
14011
|
}
|
|
14056
14012
|
visitNonNullAssert(ast) {
|
|
14057
14013
|
const expr = wrapForDiagnostics(this.translate(ast.expression));
|
|
14058
|
-
const node =
|
|
14014
|
+
const node = ts65.createNonNullExpression(expr);
|
|
14059
14015
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14060
14016
|
return node;
|
|
14061
14017
|
}
|
|
@@ -14064,13 +14020,13 @@ var AstTranslator = class {
|
|
|
14064
14020
|
}
|
|
14065
14021
|
visitPrefixNot(ast) {
|
|
14066
14022
|
const expression = wrapForDiagnostics(this.translate(ast.expression));
|
|
14067
|
-
const node =
|
|
14023
|
+
const node = ts65.createLogicalNot(expression);
|
|
14068
14024
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14069
14025
|
return node;
|
|
14070
14026
|
}
|
|
14071
14027
|
visitPropertyRead(ast) {
|
|
14072
14028
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
14073
|
-
const name =
|
|
14029
|
+
const name = ts65.createPropertyAccess(receiver, ast.name);
|
|
14074
14030
|
addParseSpanInfo(name, ast.nameSpan);
|
|
14075
14031
|
const node = wrapForDiagnostics(name);
|
|
14076
14032
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
@@ -14078,12 +14034,12 @@ var AstTranslator = class {
|
|
|
14078
14034
|
}
|
|
14079
14035
|
visitPropertyWrite(ast) {
|
|
14080
14036
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
14081
|
-
const left =
|
|
14037
|
+
const left = ts65.createPropertyAccess(receiver, ast.name);
|
|
14082
14038
|
addParseSpanInfo(left, ast.nameSpan);
|
|
14083
14039
|
const leftWithPath = wrapForDiagnostics(left);
|
|
14084
14040
|
addParseSpanInfo(leftWithPath, ast.sourceSpan);
|
|
14085
14041
|
const right = wrapForTypeChecker(this.translate(ast.value));
|
|
14086
|
-
const node = wrapForDiagnostics(
|
|
14042
|
+
const node = wrapForDiagnostics(ts65.createBinary(leftWithPath, ts65.SyntaxKind.EqualsToken, right));
|
|
14087
14043
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14088
14044
|
return node;
|
|
14089
14045
|
}
|
|
@@ -14094,13 +14050,13 @@ var AstTranslator = class {
|
|
|
14094
14050
|
let node;
|
|
14095
14051
|
const receiver = wrapForDiagnostics(this.translate(ast.receiver));
|
|
14096
14052
|
if (this.config.strictSafeNavigationTypes) {
|
|
14097
|
-
const expr =
|
|
14053
|
+
const expr = ts65.createPropertyAccess(ts65.createNonNullExpression(receiver), ast.name);
|
|
14098
14054
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
14099
|
-
node =
|
|
14055
|
+
node = ts65.createParen(ts65.createConditional(NULL_AS_ANY, expr, UNDEFINED));
|
|
14100
14056
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
14101
|
-
node =
|
|
14057
|
+
node = ts65.createPropertyAccess(tsCastToAny(receiver), ast.name);
|
|
14102
14058
|
} else {
|
|
14103
|
-
const expr =
|
|
14059
|
+
const expr = ts65.createPropertyAccess(ts65.createNonNullExpression(receiver), ast.name);
|
|
14104
14060
|
addParseSpanInfo(expr, ast.nameSpan);
|
|
14105
14061
|
node = tsCastToAny(expr);
|
|
14106
14062
|
}
|
|
@@ -14112,13 +14068,13 @@ var AstTranslator = class {
|
|
|
14112
14068
|
const key = this.translate(ast.key);
|
|
14113
14069
|
let node;
|
|
14114
14070
|
if (this.config.strictSafeNavigationTypes) {
|
|
14115
|
-
const expr =
|
|
14071
|
+
const expr = ts65.createElementAccess(ts65.createNonNullExpression(receiver), key);
|
|
14116
14072
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
14117
|
-
node =
|
|
14073
|
+
node = ts65.createParen(ts65.createConditional(NULL_AS_ANY, expr, UNDEFINED));
|
|
14118
14074
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
14119
|
-
node =
|
|
14075
|
+
node = ts65.createElementAccess(tsCastToAny(receiver), key);
|
|
14120
14076
|
} else {
|
|
14121
|
-
const expr =
|
|
14077
|
+
const expr = ts65.createElementAccess(ts65.createNonNullExpression(receiver), key);
|
|
14122
14078
|
addParseSpanInfo(expr, ast.sourceSpan);
|
|
14123
14079
|
node = tsCastToAny(expr);
|
|
14124
14080
|
}
|
|
@@ -14131,15 +14087,15 @@ var AstTranslator = class {
|
|
|
14131
14087
|
let node;
|
|
14132
14088
|
if (ast.receiver instanceof SafePropertyRead2 || ast.receiver instanceof SafeKeyedRead) {
|
|
14133
14089
|
if (this.config.strictSafeNavigationTypes) {
|
|
14134
|
-
const call =
|
|
14135
|
-
node =
|
|
14090
|
+
const call = ts65.createCall(ts65.createNonNullExpression(expr), void 0, args);
|
|
14091
|
+
node = ts65.createParen(ts65.createConditional(NULL_AS_ANY, call, UNDEFINED));
|
|
14136
14092
|
} else if (VeSafeLhsInferenceBugDetector.veWillInferAnyFor(ast)) {
|
|
14137
|
-
node =
|
|
14093
|
+
node = ts65.createCall(tsCastToAny(expr), void 0, args);
|
|
14138
14094
|
} else {
|
|
14139
|
-
node = tsCastToAny(
|
|
14095
|
+
node = tsCastToAny(ts65.createCall(ts65.createNonNullExpression(expr), void 0, args));
|
|
14140
14096
|
}
|
|
14141
14097
|
} else {
|
|
14142
|
-
node =
|
|
14098
|
+
node = ts65.createCall(expr, void 0, args);
|
|
14143
14099
|
}
|
|
14144
14100
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
14145
14101
|
return node;
|
|
@@ -14216,7 +14172,7 @@ var VeSafeLhsInferenceBugDetector = class {
|
|
|
14216
14172
|
};
|
|
14217
14173
|
VeSafeLhsInferenceBugDetector.SINGLETON = new VeSafeLhsInferenceBugDetector();
|
|
14218
14174
|
|
|
14219
|
-
// bazel-out/
|
|
14175
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
14220
14176
|
import { ImplicitReceiver as ImplicitReceiver3, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstVariable } from "@angular/compiler";
|
|
14221
14177
|
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
14222
14178
|
constructor(templateId, boundTarget, oob) {
|
|
@@ -14240,7 +14196,7 @@ var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
|
14240
14196
|
}
|
|
14241
14197
|
};
|
|
14242
14198
|
|
|
14243
|
-
// bazel-out/
|
|
14199
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
14244
14200
|
var TcbGenericContextBehavior;
|
|
14245
14201
|
(function(TcbGenericContextBehavior2) {
|
|
14246
14202
|
TcbGenericContextBehavior2[TcbGenericContextBehavior2["UseEmitter"] = 0] = "UseEmitter";
|
|
@@ -14251,7 +14207,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
14251
14207
|
const tcb = new Context2(env, domSchemaChecker, oobRecorder, meta.id, meta.boundTarget, meta.pipes, meta.schemas);
|
|
14252
14208
|
const scope = Scope.forNodes(tcb, null, tcb.boundTarget.target.template, null);
|
|
14253
14209
|
const ctxRawType = env.referenceType(ref);
|
|
14254
|
-
if (!
|
|
14210
|
+
if (!ts66.isTypeReferenceNode(ctxRawType)) {
|
|
14255
14211
|
throw new Error(`Expected TypeReferenceNode when referencing the ctx param for ${ref.debugName}`);
|
|
14256
14212
|
}
|
|
14257
14213
|
let typeParameters = void 0;
|
|
@@ -14263,25 +14219,25 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
14263
14219
|
switch (genericContextBehavior) {
|
|
14264
14220
|
case TcbGenericContextBehavior.UseEmitter:
|
|
14265
14221
|
typeParameters = new TypeParameterEmitter(ref.node.typeParameters, env.reflector).emit((typeRef) => env.referenceType(typeRef));
|
|
14266
|
-
typeArguments = typeParameters.map((param) =>
|
|
14222
|
+
typeArguments = typeParameters.map((param) => ts66.factory.createTypeReferenceNode(param.name));
|
|
14267
14223
|
break;
|
|
14268
14224
|
case TcbGenericContextBehavior.CopyClassNodes:
|
|
14269
14225
|
typeParameters = [...ref.node.typeParameters];
|
|
14270
|
-
typeArguments = typeParameters.map((param) =>
|
|
14226
|
+
typeArguments = typeParameters.map((param) => ts66.factory.createTypeReferenceNode(param.name));
|
|
14271
14227
|
break;
|
|
14272
14228
|
case TcbGenericContextBehavior.FallbackToAny:
|
|
14273
|
-
typeArguments = ref.node.typeParameters.map(() =>
|
|
14229
|
+
typeArguments = ref.node.typeParameters.map(() => ts66.factory.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword));
|
|
14274
14230
|
break;
|
|
14275
14231
|
}
|
|
14276
14232
|
}
|
|
14277
14233
|
const paramList = [tcbCtxParam(ref.node, ctxRawType.typeName, typeArguments)];
|
|
14278
14234
|
const scopeStatements = scope.render();
|
|
14279
|
-
const innerBody =
|
|
14235
|
+
const innerBody = ts66.createBlock([
|
|
14280
14236
|
...env.getPreludeStatements(),
|
|
14281
14237
|
...scopeStatements
|
|
14282
14238
|
]);
|
|
14283
|
-
const body =
|
|
14284
|
-
const fnDecl =
|
|
14239
|
+
const body = ts66.createBlock([ts66.createIf(ts66.createTrue(), innerBody, void 0)]);
|
|
14240
|
+
const fnDecl = ts66.createFunctionDeclaration(void 0, void 0, void 0, name, env.config.useContextGenericType ? typeParameters : void 0, paramList, void 0, body);
|
|
14285
14241
|
addTemplateId(fnDecl, meta.id);
|
|
14286
14242
|
return fnDecl;
|
|
14287
14243
|
}
|
|
@@ -14322,7 +14278,7 @@ var TcbVariableOp = class extends TcbOp {
|
|
|
14322
14278
|
execute() {
|
|
14323
14279
|
const ctx = this.scope.resolve(this.template);
|
|
14324
14280
|
const id = this.tcb.allocateId();
|
|
14325
|
-
const initializer =
|
|
14281
|
+
const initializer = ts66.createPropertyAccess(ctx, this.variable.value || "$implicit");
|
|
14326
14282
|
addParseSpanInfo(id, this.variable.keySpan);
|
|
14327
14283
|
let variable;
|
|
14328
14284
|
if (this.variable.valueSpan !== void 0) {
|
|
@@ -14345,7 +14301,7 @@ var TcbTemplateContextOp = class extends TcbOp {
|
|
|
14345
14301
|
}
|
|
14346
14302
|
execute() {
|
|
14347
14303
|
const ctx = this.tcb.allocateId();
|
|
14348
|
-
const type =
|
|
14304
|
+
const type = ts66.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword);
|
|
14349
14305
|
this.scope.addStatement(tsDeclareVariable(ctx, type));
|
|
14350
14306
|
return ctx;
|
|
14351
14307
|
}
|
|
@@ -14398,16 +14354,16 @@ var TcbTemplateBodyOp = class extends TcbOp {
|
|
|
14398
14354
|
}
|
|
14399
14355
|
let guard = null;
|
|
14400
14356
|
if (directiveGuards.length > 0) {
|
|
14401
|
-
guard = directiveGuards.reduce((expr, dirGuard) =>
|
|
14357
|
+
guard = directiveGuards.reduce((expr, dirGuard) => ts66.createBinary(expr, ts66.SyntaxKind.AmpersandAmpersandToken, dirGuard), directiveGuards.pop());
|
|
14402
14358
|
}
|
|
14403
14359
|
const tmplScope = Scope.forNodes(this.tcb, this.scope, this.template, guard);
|
|
14404
14360
|
const statements = tmplScope.render();
|
|
14405
14361
|
if (statements.length === 0) {
|
|
14406
14362
|
return null;
|
|
14407
14363
|
}
|
|
14408
|
-
let tmplBlock =
|
|
14364
|
+
let tmplBlock = ts66.createBlock(statements);
|
|
14409
14365
|
if (guard !== null) {
|
|
14410
|
-
tmplBlock =
|
|
14366
|
+
tmplBlock = ts66.createIf(guard, tmplBlock);
|
|
14411
14367
|
}
|
|
14412
14368
|
this.scope.addStatement(tmplBlock);
|
|
14413
14369
|
return null;
|
|
@@ -14425,7 +14381,7 @@ var TcbTextInterpolationOp = class extends TcbOp {
|
|
|
14425
14381
|
}
|
|
14426
14382
|
execute() {
|
|
14427
14383
|
const expr = tcbExpression(this.binding.value, this.tcb, this.scope);
|
|
14428
|
-
this.scope.addStatement(
|
|
14384
|
+
this.scope.addStatement(ts66.createExpressionStatement(expr));
|
|
14429
14385
|
return null;
|
|
14430
14386
|
}
|
|
14431
14387
|
};
|
|
@@ -14447,11 +14403,11 @@ var TcbDirectiveTypeOpBase = class extends TcbOp {
|
|
|
14447
14403
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === void 0) {
|
|
14448
14404
|
type = rawType;
|
|
14449
14405
|
} else {
|
|
14450
|
-
if (!
|
|
14406
|
+
if (!ts66.isTypeReferenceNode(rawType)) {
|
|
14451
14407
|
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
|
|
14452
14408
|
}
|
|
14453
|
-
const typeArguments = dirRef.node.typeParameters.map(() =>
|
|
14454
|
-
type =
|
|
14409
|
+
const typeArguments = dirRef.node.typeParameters.map(() => ts66.factory.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword));
|
|
14410
|
+
type = ts66.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
14455
14411
|
}
|
|
14456
14412
|
const id = this.tcb.allocateId();
|
|
14457
14413
|
addExpressionIdentifier(type, ExpressionIdentifier.DIRECTIVE);
|
|
@@ -14492,11 +14448,11 @@ var TcbReferenceOp = class extends TcbOp {
|
|
|
14492
14448
|
const id = this.tcb.allocateId();
|
|
14493
14449
|
let initializer = this.target instanceof TmplAstTemplate2 || this.target instanceof TmplAstElement3 ? this.scope.resolve(this.target) : this.scope.resolve(this.host, this.target);
|
|
14494
14450
|
if (this.target instanceof TmplAstElement3 && !this.tcb.env.config.checkTypeOfDomReferences || !this.tcb.env.config.checkTypeOfNonDomReferences) {
|
|
14495
|
-
initializer =
|
|
14451
|
+
initializer = ts66.createAsExpression(initializer, ts66.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword));
|
|
14496
14452
|
} else if (this.target instanceof TmplAstTemplate2) {
|
|
14497
|
-
initializer =
|
|
14498
|
-
initializer =
|
|
14499
|
-
initializer =
|
|
14453
|
+
initializer = ts66.createAsExpression(initializer, ts66.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword));
|
|
14454
|
+
initializer = ts66.createAsExpression(initializer, this.tcb.env.referenceExternalType("@angular/core", "TemplateRef", [DYNAMIC_TYPE]));
|
|
14455
|
+
initializer = ts66.createParen(initializer);
|
|
14500
14456
|
}
|
|
14501
14457
|
addParseSpanInfo(initializer, this.node.sourceSpan);
|
|
14502
14458
|
addParseSpanInfo(id, this.node.keySpan);
|
|
@@ -14580,18 +14536,13 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
14580
14536
|
let dirId = null;
|
|
14581
14537
|
const inputs = getBoundInputs(this.dir, this.node, this.tcb);
|
|
14582
14538
|
for (const input of inputs) {
|
|
14583
|
-
|
|
14584
|
-
if (!this.tcb.env.config.checkTypeOfInputBindings) {
|
|
14585
|
-
expr = tsCastToAny(expr);
|
|
14586
|
-
} else if (!this.tcb.env.config.strictNullInputBindings) {
|
|
14587
|
-
expr = ts67.createNonNullExpression(expr);
|
|
14588
|
-
}
|
|
14539
|
+
const expr = widenBinding(translateInput(input.attribute, this.tcb, this.scope), this.tcb);
|
|
14589
14540
|
let assignment = wrapForDiagnostics(expr);
|
|
14590
14541
|
for (const fieldName of input.fieldNames) {
|
|
14591
14542
|
let target;
|
|
14592
14543
|
if (this.dir.coercedInputFields.has(fieldName)) {
|
|
14593
14544
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
14594
|
-
if (!
|
|
14545
|
+
if (!ts66.isTypeReferenceNode(dirTypeRef)) {
|
|
14595
14546
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
14596
14547
|
}
|
|
14597
14548
|
const id = this.tcb.allocateId();
|
|
@@ -14606,10 +14557,10 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
14606
14557
|
}
|
|
14607
14558
|
const id = this.tcb.allocateId();
|
|
14608
14559
|
const dirTypeRef = this.tcb.env.referenceType(this.dir.ref);
|
|
14609
|
-
if (!
|
|
14560
|
+
if (!ts66.isTypeReferenceNode(dirTypeRef)) {
|
|
14610
14561
|
throw new Error(`Expected TypeReferenceNode from reference to ${this.dir.ref.debugName}`);
|
|
14611
14562
|
}
|
|
14612
|
-
const type =
|
|
14563
|
+
const type = ts66.createIndexedAccessTypeNode(ts66.createTypeQueryNode(dirId), ts66.createLiteralTypeNode(ts66.createStringLiteral(fieldName)));
|
|
14613
14564
|
const temp = tsDeclareVariable(id, type);
|
|
14614
14565
|
this.scope.addStatement(temp);
|
|
14615
14566
|
target = id;
|
|
@@ -14617,18 +14568,18 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
14617
14568
|
if (dirId === null) {
|
|
14618
14569
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
14619
14570
|
}
|
|
14620
|
-
target = this.dir.stringLiteralInputFields.has(fieldName) ?
|
|
14571
|
+
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts66.createElementAccess(dirId, ts66.createStringLiteral(fieldName)) : ts66.createPropertyAccess(dirId, ts66.createIdentifier(fieldName));
|
|
14621
14572
|
}
|
|
14622
14573
|
if (input.attribute.keySpan !== void 0) {
|
|
14623
14574
|
addParseSpanInfo(target, input.attribute.keySpan);
|
|
14624
14575
|
}
|
|
14625
|
-
assignment =
|
|
14576
|
+
assignment = ts66.createBinary(target, ts66.SyntaxKind.EqualsToken, assignment);
|
|
14626
14577
|
}
|
|
14627
14578
|
addParseSpanInfo(assignment, input.attribute.sourceSpan);
|
|
14628
14579
|
if (!this.tcb.env.config.checkTypeOfAttributes && input.attribute instanceof TmplAstTextAttribute2) {
|
|
14629
14580
|
markIgnoreDiagnostics(assignment);
|
|
14630
14581
|
}
|
|
14631
|
-
this.scope.addStatement(
|
|
14582
|
+
this.scope.addStatement(ts66.createExpressionStatement(assignment));
|
|
14632
14583
|
}
|
|
14633
14584
|
return null;
|
|
14634
14585
|
}
|
|
@@ -14647,7 +14598,7 @@ var TcbDirectiveCtorCircularFallbackOp = class extends TcbOp {
|
|
|
14647
14598
|
execute() {
|
|
14648
14599
|
const id = this.tcb.allocateId();
|
|
14649
14600
|
const typeCtor = this.tcb.env.typeCtorFor(this.dir);
|
|
14650
|
-
const circularPlaceholder =
|
|
14601
|
+
const circularPlaceholder = ts66.createCall(typeCtor, void 0, [ts66.createNonNullExpression(ts66.createNull())]);
|
|
14651
14602
|
this.scope.addStatement(tsCreateVariable(id, circularPlaceholder));
|
|
14652
14603
|
return id;
|
|
14653
14604
|
}
|
|
@@ -14706,27 +14657,22 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
|
|
|
14706
14657
|
if (binding.type === 0 && this.claimedInputs.has(binding.name)) {
|
|
14707
14658
|
continue;
|
|
14708
14659
|
}
|
|
14709
|
-
|
|
14710
|
-
if (!this.tcb.env.config.checkTypeOfInputBindings) {
|
|
14711
|
-
expr = tsCastToAny(expr);
|
|
14712
|
-
} else if (!this.tcb.env.config.strictNullInputBindings) {
|
|
14713
|
-
expr = ts67.createNonNullExpression(expr);
|
|
14714
|
-
}
|
|
14660
|
+
const expr = widenBinding(tcbExpression(binding.value, this.tcb, this.scope), this.tcb);
|
|
14715
14661
|
if (this.tcb.env.config.checkTypeOfDomBindings && binding.type === 0) {
|
|
14716
14662
|
if (binding.name !== "style" && binding.name !== "class") {
|
|
14717
14663
|
if (elId === null) {
|
|
14718
14664
|
elId = this.scope.resolve(this.element);
|
|
14719
14665
|
}
|
|
14720
14666
|
const propertyName = ATTR_TO_PROP[binding.name] || binding.name;
|
|
14721
|
-
const prop =
|
|
14722
|
-
const stmt =
|
|
14667
|
+
const prop = ts66.createElementAccess(elId, ts66.createStringLiteral(propertyName));
|
|
14668
|
+
const stmt = ts66.createBinary(prop, ts66.SyntaxKind.EqualsToken, wrapForDiagnostics(expr));
|
|
14723
14669
|
addParseSpanInfo(stmt, binding.sourceSpan);
|
|
14724
|
-
this.scope.addStatement(
|
|
14670
|
+
this.scope.addStatement(ts66.createExpressionStatement(stmt));
|
|
14725
14671
|
} else {
|
|
14726
|
-
this.scope.addStatement(
|
|
14672
|
+
this.scope.addStatement(ts66.createExpressionStatement(expr));
|
|
14727
14673
|
}
|
|
14728
14674
|
} else {
|
|
14729
|
-
this.scope.addStatement(
|
|
14675
|
+
this.scope.addStatement(ts66.createExpressionStatement(expr));
|
|
14730
14676
|
}
|
|
14731
14677
|
}
|
|
14732
14678
|
return null;
|
|
@@ -14758,18 +14704,18 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
14758
14704
|
if (dirId === null) {
|
|
14759
14705
|
dirId = this.scope.resolve(this.node, this.dir);
|
|
14760
14706
|
}
|
|
14761
|
-
const outputField =
|
|
14707
|
+
const outputField = ts66.createElementAccess(dirId, ts66.createStringLiteral(field));
|
|
14762
14708
|
addParseSpanInfo(outputField, output.keySpan);
|
|
14763
14709
|
if (this.tcb.env.config.checkTypeOfOutputEvents) {
|
|
14764
14710
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
14765
|
-
const subscribeFn =
|
|
14766
|
-
const call =
|
|
14711
|
+
const subscribeFn = ts66.createPropertyAccess(outputField, "subscribe");
|
|
14712
|
+
const call = ts66.createCall(subscribeFn, void 0, [handler]);
|
|
14767
14713
|
addParseSpanInfo(call, output.sourceSpan);
|
|
14768
|
-
this.scope.addStatement(
|
|
14714
|
+
this.scope.addStatement(ts66.createExpressionStatement(call));
|
|
14769
14715
|
} else {
|
|
14770
|
-
this.scope.addStatement(
|
|
14716
|
+
this.scope.addStatement(ts66.createExpressionStatement(outputField));
|
|
14771
14717
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
14772
|
-
this.scope.addStatement(
|
|
14718
|
+
this.scope.addStatement(ts66.createExpressionStatement(handler));
|
|
14773
14719
|
}
|
|
14774
14720
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
14775
14721
|
}
|
|
@@ -14802,20 +14748,20 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
14802
14748
|
if (output.type === 1) {
|
|
14803
14749
|
const eventType = this.tcb.env.config.checkTypeOfAnimationEvents ? this.tcb.env.referenceExternalType("@angular/animations", "AnimationEvent") : 1;
|
|
14804
14750
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, eventType);
|
|
14805
|
-
this.scope.addStatement(
|
|
14751
|
+
this.scope.addStatement(ts66.createExpressionStatement(handler));
|
|
14806
14752
|
} else if (this.tcb.env.config.checkTypeOfDomEvents) {
|
|
14807
14753
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 0);
|
|
14808
14754
|
if (elId === null) {
|
|
14809
14755
|
elId = this.scope.resolve(this.element);
|
|
14810
14756
|
}
|
|
14811
|
-
const propertyAccess =
|
|
14757
|
+
const propertyAccess = ts66.createPropertyAccess(elId, "addEventListener");
|
|
14812
14758
|
addParseSpanInfo(propertyAccess, output.keySpan);
|
|
14813
|
-
const call =
|
|
14759
|
+
const call = ts66.createCall(propertyAccess, void 0, [ts66.createStringLiteral(output.name), handler]);
|
|
14814
14760
|
addParseSpanInfo(call, output.sourceSpan);
|
|
14815
|
-
this.scope.addStatement(
|
|
14761
|
+
this.scope.addStatement(ts66.createExpressionStatement(call));
|
|
14816
14762
|
} else {
|
|
14817
14763
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
14818
|
-
this.scope.addStatement(
|
|
14764
|
+
this.scope.addStatement(ts66.createExpressionStatement(handler));
|
|
14819
14765
|
}
|
|
14820
14766
|
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
14821
14767
|
}
|
|
@@ -14829,15 +14775,15 @@ var TcbComponentContextCompletionOp = class extends TcbOp {
|
|
|
14829
14775
|
this.optional = false;
|
|
14830
14776
|
}
|
|
14831
14777
|
execute() {
|
|
14832
|
-
const ctx =
|
|
14833
|
-
const ctxDot =
|
|
14778
|
+
const ctx = ts66.createIdentifier("ctx");
|
|
14779
|
+
const ctxDot = ts66.createPropertyAccess(ctx, "");
|
|
14834
14780
|
markIgnoreDiagnostics(ctxDot);
|
|
14835
14781
|
addExpressionIdentifier(ctxDot, ExpressionIdentifier.COMPONENT_COMPLETION);
|
|
14836
|
-
this.scope.addStatement(
|
|
14782
|
+
this.scope.addStatement(ts66.createExpressionStatement(ctxDot));
|
|
14837
14783
|
return null;
|
|
14838
14784
|
}
|
|
14839
14785
|
};
|
|
14840
|
-
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR =
|
|
14786
|
+
var INFER_TYPE_FOR_CIRCULAR_OP_EXPR = ts66.createNonNullExpression(ts66.createNull());
|
|
14841
14787
|
var Context2 = class {
|
|
14842
14788
|
constructor(env, domSchemaChecker, oobRecorder, id, boundTarget, pipes, schemas) {
|
|
14843
14789
|
this.env = env;
|
|
@@ -14850,7 +14796,7 @@ var Context2 = class {
|
|
|
14850
14796
|
this.nextId = 1;
|
|
14851
14797
|
}
|
|
14852
14798
|
allocateId() {
|
|
14853
|
-
return
|
|
14799
|
+
return ts66.createIdentifier(`_t${this.nextId++}`);
|
|
14854
14800
|
}
|
|
14855
14801
|
getPipeByName(name) {
|
|
14856
14802
|
if (!this.pipes.has(name)) {
|
|
@@ -14902,8 +14848,8 @@ var Scope = class {
|
|
|
14902
14848
|
resolve(node, directive) {
|
|
14903
14849
|
const res = this.resolveLocal(node, directive);
|
|
14904
14850
|
if (res !== null) {
|
|
14905
|
-
const clone =
|
|
14906
|
-
|
|
14851
|
+
const clone = ts66.getMutableClone(res);
|
|
14852
|
+
ts66.setSyntheticTrailingComments(clone, []);
|
|
14907
14853
|
return clone;
|
|
14908
14854
|
} else if (this.parent !== null) {
|
|
14909
14855
|
return this.parent.resolve(node, directive);
|
|
@@ -14931,7 +14877,7 @@ var Scope = class {
|
|
|
14931
14877
|
} else if (parentGuards === null) {
|
|
14932
14878
|
return this.guard;
|
|
14933
14879
|
} else {
|
|
14934
|
-
return
|
|
14880
|
+
return ts66.createBinary(parentGuards, ts66.SyntaxKind.AmpersandAmpersandToken, this.guard);
|
|
14935
14881
|
}
|
|
14936
14882
|
}
|
|
14937
14883
|
resolveLocal(ref, directive) {
|
|
@@ -15111,8 +15057,8 @@ var Scope = class {
|
|
|
15111
15057
|
}
|
|
15112
15058
|
};
|
|
15113
15059
|
function tcbCtxParam(node, name, typeArguments) {
|
|
15114
|
-
const type =
|
|
15115
|
-
return
|
|
15060
|
+
const type = ts66.factory.createTypeReferenceNode(name, typeArguments);
|
|
15061
|
+
return ts66.factory.createParameterDeclaration(void 0, void 0, void 0, "ctx", void 0, type, void 0);
|
|
15116
15062
|
}
|
|
15117
15063
|
function tcbExpression(ast, tcb, scope) {
|
|
15118
15064
|
const translator = new TcbExpressionTranslator(tcb, scope);
|
|
@@ -15135,11 +15081,11 @@ var TcbExpressionTranslator = class {
|
|
|
15135
15081
|
return null;
|
|
15136
15082
|
}
|
|
15137
15083
|
const expr = this.translate(ast.value);
|
|
15138
|
-
const result =
|
|
15084
|
+
const result = ts66.createParen(ts66.createBinary(target, ts66.SyntaxKind.EqualsToken, expr));
|
|
15139
15085
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
15140
15086
|
return result;
|
|
15141
15087
|
} else if (ast instanceof ImplicitReceiver4) {
|
|
15142
|
-
return
|
|
15088
|
+
return ts66.createIdentifier("ctx");
|
|
15143
15089
|
} else if (ast instanceof BindingPipe) {
|
|
15144
15090
|
const expr = this.translate(ast.exp);
|
|
15145
15091
|
const pipeRef = this.tcb.getPipeByName(ast.name);
|
|
@@ -15151,19 +15097,19 @@ var TcbExpressionTranslator = class {
|
|
|
15151
15097
|
pipe = this.tcb.env.pipeInst(pipeRef);
|
|
15152
15098
|
}
|
|
15153
15099
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
15154
|
-
let methodAccess =
|
|
15100
|
+
let methodAccess = ts66.factory.createPropertyAccessExpression(pipe, "transform");
|
|
15155
15101
|
addParseSpanInfo(methodAccess, ast.nameSpan);
|
|
15156
15102
|
if (!this.tcb.env.config.checkTypeOfPipes) {
|
|
15157
|
-
methodAccess =
|
|
15103
|
+
methodAccess = ts66.factory.createAsExpression(methodAccess, ts66.factory.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword));
|
|
15158
15104
|
}
|
|
15159
|
-
const result =
|
|
15105
|
+
const result = ts66.createCall(methodAccess, void 0, [expr, ...args]);
|
|
15160
15106
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
15161
15107
|
return result;
|
|
15162
15108
|
} else if (ast instanceof Call2 && (ast.receiver instanceof PropertyRead2 || ast.receiver instanceof SafePropertyRead3) && !(ast.receiver.receiver instanceof ThisReceiver)) {
|
|
15163
15109
|
if (ast.receiver.name === "$any" && ast.args.length === 1) {
|
|
15164
15110
|
const expr = this.translate(ast.args[0]);
|
|
15165
|
-
const exprAsAny =
|
|
15166
|
-
const result =
|
|
15111
|
+
const exprAsAny = ts66.createAsExpression(expr, ts66.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword));
|
|
15112
|
+
const result = ts66.createParen(exprAsAny);
|
|
15167
15113
|
addParseSpanInfo(result, ast.sourceSpan);
|
|
15168
15114
|
return result;
|
|
15169
15115
|
}
|
|
@@ -15174,7 +15120,7 @@ var TcbExpressionTranslator = class {
|
|
|
15174
15120
|
const method = wrapForDiagnostics(receiver);
|
|
15175
15121
|
addParseSpanInfo(method, ast.receiver.nameSpan);
|
|
15176
15122
|
const args = ast.args.map((arg) => this.translate(arg));
|
|
15177
|
-
const node =
|
|
15123
|
+
const node = ts66.createCall(method, void 0, args);
|
|
15178
15124
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
15179
15125
|
return node;
|
|
15180
15126
|
} else {
|
|
@@ -15194,22 +15140,17 @@ var TcbExpressionTranslator = class {
|
|
|
15194
15140
|
function tcbCallTypeCtor(dir, tcb, inputs) {
|
|
15195
15141
|
const typeCtor = tcb.env.typeCtorFor(dir);
|
|
15196
15142
|
const members = inputs.map((input) => {
|
|
15197
|
-
const propertyName =
|
|
15143
|
+
const propertyName = ts66.createStringLiteral(input.field);
|
|
15198
15144
|
if (input.type === "binding") {
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
expr = tsCastToAny(expr);
|
|
15202
|
-
} else if (!tcb.env.config.strictNullInputBindings) {
|
|
15203
|
-
expr = ts67.createNonNullExpression(expr);
|
|
15204
|
-
}
|
|
15205
|
-
const assignment = ts67.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
|
|
15145
|
+
const expr = widenBinding(input.expression, tcb);
|
|
15146
|
+
const assignment = ts66.createPropertyAssignment(propertyName, wrapForDiagnostics(expr));
|
|
15206
15147
|
addParseSpanInfo(assignment, input.sourceSpan);
|
|
15207
15148
|
return assignment;
|
|
15208
15149
|
} else {
|
|
15209
|
-
return
|
|
15150
|
+
return ts66.createPropertyAssignment(propertyName, NULL_AS_ANY);
|
|
15210
15151
|
}
|
|
15211
15152
|
});
|
|
15212
|
-
return
|
|
15153
|
+
return ts66.createCall(typeCtor, void 0, [ts66.createObjectLiteral(members)]);
|
|
15213
15154
|
}
|
|
15214
15155
|
function getBoundInputs(directive, node, tcb) {
|
|
15215
15156
|
const boundInputs = [];
|
|
@@ -15235,7 +15176,20 @@ function translateInput(attr, tcb, scope) {
|
|
|
15235
15176
|
if (attr instanceof TmplAstBoundAttribute) {
|
|
15236
15177
|
return tcbExpression(attr.value, tcb, scope);
|
|
15237
15178
|
} else {
|
|
15238
|
-
return
|
|
15179
|
+
return ts66.createStringLiteral(attr.value);
|
|
15180
|
+
}
|
|
15181
|
+
}
|
|
15182
|
+
function widenBinding(expr, tcb) {
|
|
15183
|
+
if (!tcb.env.config.checkTypeOfInputBindings) {
|
|
15184
|
+
return tsCastToAny(expr);
|
|
15185
|
+
} else if (!tcb.env.config.strictNullInputBindings) {
|
|
15186
|
+
if (ts66.isObjectLiteralExpression(expr) || ts66.isArrayLiteralExpression(expr)) {
|
|
15187
|
+
return expr;
|
|
15188
|
+
} else {
|
|
15189
|
+
return ts66.createNonNullExpression(expr);
|
|
15190
|
+
}
|
|
15191
|
+
} else {
|
|
15192
|
+
return expr;
|
|
15239
15193
|
}
|
|
15240
15194
|
}
|
|
15241
15195
|
var EVENT_PARAMETER = "$event";
|
|
@@ -15245,18 +15199,18 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
|
|
|
15245
15199
|
if (eventType === 0) {
|
|
15246
15200
|
eventParamType = void 0;
|
|
15247
15201
|
} else if (eventType === 1) {
|
|
15248
|
-
eventParamType =
|
|
15202
|
+
eventParamType = ts66.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword);
|
|
15249
15203
|
} else {
|
|
15250
15204
|
eventParamType = eventType;
|
|
15251
15205
|
}
|
|
15252
15206
|
const guards = scope.guards();
|
|
15253
|
-
let body =
|
|
15207
|
+
let body = ts66.createExpressionStatement(handler);
|
|
15254
15208
|
if (guards !== null) {
|
|
15255
|
-
body =
|
|
15209
|
+
body = ts66.createIf(guards, body);
|
|
15256
15210
|
}
|
|
15257
|
-
const eventParam =
|
|
15211
|
+
const eventParam = ts66.createParameter(void 0, void 0, void 0, EVENT_PARAMETER, void 0, eventParamType);
|
|
15258
15212
|
addExpressionIdentifier(eventParam, ExpressionIdentifier.EVENT_PARAMETER);
|
|
15259
|
-
return
|
|
15213
|
+
return ts66.createFunctionExpression(void 0, void 0, void 0, void 0, [eventParam], ts66.createKeywordTypeNode(ts66.SyntaxKind.AnyKeyword), ts66.createBlock([body]));
|
|
15260
15214
|
}
|
|
15261
15215
|
function tcbEventHandlerExpression(ast, tcb, scope) {
|
|
15262
15216
|
const translator = new TcbEventHandlerTranslator(tcb, scope);
|
|
@@ -15284,7 +15238,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
|
|
|
15284
15238
|
var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
15285
15239
|
resolve(ast) {
|
|
15286
15240
|
if (ast instanceof PropertyRead2 && ast.receiver instanceof ImplicitReceiver4 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
|
|
15287
|
-
const event =
|
|
15241
|
+
const event = ts66.createIdentifier(EVENT_PARAMETER);
|
|
15288
15242
|
addParseSpanInfo(event, ast.nameSpan);
|
|
15289
15243
|
return event;
|
|
15290
15244
|
}
|
|
@@ -15292,33 +15246,33 @@ var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
|
|
|
15292
15246
|
}
|
|
15293
15247
|
};
|
|
15294
15248
|
|
|
15295
|
-
// bazel-out/
|
|
15296
|
-
import
|
|
15249
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.mjs
|
|
15250
|
+
import ts67 from "typescript";
|
|
15297
15251
|
var TypeCheckFile = class extends Environment {
|
|
15298
15252
|
constructor(fileName, config, refEmitter, reflector, compilerHost) {
|
|
15299
|
-
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector,
|
|
15253
|
+
super(config, new ImportManager(new NoopImportRewriter(), "i"), refEmitter, reflector, ts67.createSourceFile(compilerHost.getCanonicalFileName(fileName), "", ts67.ScriptTarget.Latest, true));
|
|
15300
15254
|
this.fileName = fileName;
|
|
15301
15255
|
this.nextTcbId = 1;
|
|
15302
15256
|
this.tcbStatements = [];
|
|
15303
15257
|
}
|
|
15304
15258
|
addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
|
|
15305
|
-
const fnId =
|
|
15259
|
+
const fnId = ts67.createIdentifier(`_tcb${this.nextTcbId++}`);
|
|
15306
15260
|
const fn = generateTypeCheckBlock(this, ref, fnId, meta, domSchemaChecker, oobRecorder, genericContextBehavior);
|
|
15307
15261
|
this.tcbStatements.push(fn);
|
|
15308
15262
|
}
|
|
15309
15263
|
render(removeComments) {
|
|
15310
15264
|
let source = this.importManager.getAllImports(this.contextFile.fileName).map((i) => `import * as ${i.qualifier.text} from '${i.specifier}';`).join("\n") + "\n\n";
|
|
15311
|
-
const printer =
|
|
15265
|
+
const printer = ts67.createPrinter({ removeComments });
|
|
15312
15266
|
source += "\n";
|
|
15313
15267
|
for (const stmt of this.pipeInstStatements) {
|
|
15314
|
-
source += printer.printNode(
|
|
15268
|
+
source += printer.printNode(ts67.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
15315
15269
|
}
|
|
15316
15270
|
for (const stmt of this.typeCtorStatements) {
|
|
15317
|
-
source += printer.printNode(
|
|
15271
|
+
source += printer.printNode(ts67.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
15318
15272
|
}
|
|
15319
15273
|
source += "\n";
|
|
15320
15274
|
for (const stmt of this.tcbStatements) {
|
|
15321
|
-
source += printer.printNode(
|
|
15275
|
+
source += printer.printNode(ts67.EmitHint.Unspecified, stmt, this.contextFile) + "\n";
|
|
15322
15276
|
}
|
|
15323
15277
|
source += "\nexport const IS_A_MODULE = true;\n";
|
|
15324
15278
|
return source;
|
|
@@ -15328,7 +15282,7 @@ var TypeCheckFile = class extends Environment {
|
|
|
15328
15282
|
}
|
|
15329
15283
|
};
|
|
15330
15284
|
|
|
15331
|
-
// bazel-out/
|
|
15285
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/context.mjs
|
|
15332
15286
|
var InliningMode;
|
|
15333
15287
|
(function(InliningMode2) {
|
|
15334
15288
|
InliningMode2[InliningMode2["InlineOps"] = 0] = "InlineOps";
|
|
@@ -15426,7 +15380,7 @@ var TypeCheckContextImpl = class {
|
|
|
15426
15380
|
const importManager = new ImportManager(new NoopImportRewriter(), "_i");
|
|
15427
15381
|
const ops = this.opMap.get(sf).sort(orderOps);
|
|
15428
15382
|
const textParts = splitStringAtPoints(sf.text, ops.map((op) => op.splitPoint));
|
|
15429
|
-
const printer =
|
|
15383
|
+
const printer = ts68.createPrinter({ omitTrailingSemicolon: true });
|
|
15430
15384
|
let code = textParts[0];
|
|
15431
15385
|
ops.forEach((op, idx) => {
|
|
15432
15386
|
const text = op.execute(importManager, sf, this.refEmitter, printer);
|
|
@@ -15507,7 +15461,7 @@ var TypeCheckContextImpl = class {
|
|
|
15507
15461
|
if (span.start.offset === span.end.offset) {
|
|
15508
15462
|
span.end.offset++;
|
|
15509
15463
|
}
|
|
15510
|
-
return makeTemplateDiagnostic(templateId, sourceMapping, span,
|
|
15464
|
+
return makeTemplateDiagnostic(templateId, sourceMapping, span, ts68.DiagnosticCategory.Error, ngErrorCode(ErrorCode.TEMPLATE_PARSE_ERROR), error2.msg);
|
|
15511
15465
|
});
|
|
15512
15466
|
}
|
|
15513
15467
|
};
|
|
@@ -15525,9 +15479,9 @@ var InlineTcbOp = class {
|
|
|
15525
15479
|
}
|
|
15526
15480
|
execute(im, sf, refEmitter, printer) {
|
|
15527
15481
|
const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
|
|
15528
|
-
const fnName =
|
|
15482
|
+
const fnName = ts68.createIdentifier(`_tcb_${this.ref.node.pos}`);
|
|
15529
15483
|
const fn = generateTypeCheckBlock(env, this.ref, fnName, this.meta, this.domSchemaChecker, this.oobRecorder, TcbGenericContextBehavior.CopyClassNodes);
|
|
15530
|
-
return printer.printNode(
|
|
15484
|
+
return printer.printNode(ts68.EmitHint.Unspecified, fn, sf);
|
|
15531
15485
|
}
|
|
15532
15486
|
};
|
|
15533
15487
|
var TypeCtorOp = class {
|
|
@@ -15540,7 +15494,7 @@ var TypeCtorOp = class {
|
|
|
15540
15494
|
}
|
|
15541
15495
|
execute(im, sf, refEmitter, printer) {
|
|
15542
15496
|
const tcb = generateInlineTypeCtor(this.ref.node, this.meta);
|
|
15543
|
-
return printer.printNode(
|
|
15497
|
+
return printer.printNode(ts68.EmitHint.Unspecified, tcb, sf);
|
|
15544
15498
|
}
|
|
15545
15499
|
};
|
|
15546
15500
|
function orderOps(op1, op2) {
|
|
@@ -15558,10 +15512,10 @@ function splitStringAtPoints(str, points) {
|
|
|
15558
15512
|
return splits;
|
|
15559
15513
|
}
|
|
15560
15514
|
|
|
15561
|
-
// bazel-out/
|
|
15515
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
15562
15516
|
import { ParseLocation as ParseLocation2, ParseSourceSpan as ParseSourceSpan2 } from "@angular/compiler";
|
|
15563
15517
|
|
|
15564
|
-
// bazel-out/
|
|
15518
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/line_mappings.mjs
|
|
15565
15519
|
var LF_CHAR = 10;
|
|
15566
15520
|
var CR_CHAR = 13;
|
|
15567
15521
|
var LINE_SEP_CHAR = 8232;
|
|
@@ -15602,7 +15556,7 @@ function findClosestLineStartPosition(linesMap, position, low = 0, high = linesM
|
|
|
15602
15556
|
return low - 1;
|
|
15603
15557
|
}
|
|
15604
15558
|
|
|
15605
|
-
// bazel-out/
|
|
15559
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/source.mjs
|
|
15606
15560
|
var TemplateSource = class {
|
|
15607
15561
|
constructor(mapping, file) {
|
|
15608
15562
|
this.mapping = mapping;
|
|
@@ -15653,9 +15607,9 @@ var TemplateSourceManager = class {
|
|
|
15653
15607
|
}
|
|
15654
15608
|
};
|
|
15655
15609
|
|
|
15656
|
-
// bazel-out/
|
|
15610
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
|
|
15657
15611
|
import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead3, PropertyWrite as PropertyWrite3, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement4, TmplAstReference as TmplAstReference4, TmplAstTemplate as TmplAstTemplate3, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
|
|
15658
|
-
import
|
|
15612
|
+
import ts69 from "typescript";
|
|
15659
15613
|
var SymbolBuilder = class {
|
|
15660
15614
|
constructor(shimPath, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
|
|
15661
15615
|
this.shimPath = shimPath;
|
|
@@ -15698,7 +15652,7 @@ var SymbolBuilder = class {
|
|
|
15698
15652
|
getSymbolOfElement(element) {
|
|
15699
15653
|
var _a;
|
|
15700
15654
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
15701
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter:
|
|
15655
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: ts69.isVariableDeclaration });
|
|
15702
15656
|
if (node === null) {
|
|
15703
15657
|
return null;
|
|
15704
15658
|
}
|
|
@@ -15717,12 +15671,12 @@ var SymbolBuilder = class {
|
|
|
15717
15671
|
var _a;
|
|
15718
15672
|
const elementSourceSpan = (_a = element.startSourceSpan) != null ? _a : element.sourceSpan;
|
|
15719
15673
|
const tcbSourceFile = this.typeCheckBlock.getSourceFile();
|
|
15720
|
-
const isDirectiveDeclaration = (node) => (
|
|
15674
|
+
const isDirectiveDeclaration = (node) => (ts69.isTypeNode(node) || ts69.isIdentifier(node)) && ts69.isVariableDeclaration(node.parent) && hasExpressionIdentifier(tcbSourceFile, node, ExpressionIdentifier.DIRECTIVE);
|
|
15721
15675
|
const nodes = findAllMatchingNodes(this.typeCheckBlock, { withSpan: elementSourceSpan, filter: isDirectiveDeclaration });
|
|
15722
15676
|
return nodes.map((node) => {
|
|
15723
15677
|
var _a2;
|
|
15724
15678
|
const symbol = this.getSymbolOfTsNode(node.parent);
|
|
15725
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
15679
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts69.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
15726
15680
|
return null;
|
|
15727
15681
|
}
|
|
15728
15682
|
const meta = this.getDirectiveMeta(element, symbol.tsSymbol.valueDeclaration);
|
|
@@ -15791,17 +15745,17 @@ var SymbolBuilder = class {
|
|
|
15791
15745
|
if (!isAccessExpression(n)) {
|
|
15792
15746
|
return false;
|
|
15793
15747
|
}
|
|
15794
|
-
if (
|
|
15748
|
+
if (ts69.isPropertyAccessExpression(n)) {
|
|
15795
15749
|
return n.name.getText() === expectedAccess;
|
|
15796
15750
|
} else {
|
|
15797
|
-
return
|
|
15751
|
+
return ts69.isStringLiteral(n.argumentExpression) && n.argumentExpression.text === expectedAccess;
|
|
15798
15752
|
}
|
|
15799
15753
|
}
|
|
15800
15754
|
const outputFieldAccesses = findAllMatchingNodes(this.typeCheckBlock, { withSpan: eventBinding.keySpan, filter });
|
|
15801
15755
|
const bindings = [];
|
|
15802
15756
|
for (const outputFieldAccess of outputFieldAccesses) {
|
|
15803
15757
|
if (consumer instanceof TmplAstTemplate3 || consumer instanceof TmplAstElement4) {
|
|
15804
|
-
if (!
|
|
15758
|
+
if (!ts69.isPropertyAccessExpression(outputFieldAccess)) {
|
|
15805
15759
|
continue;
|
|
15806
15760
|
}
|
|
15807
15761
|
const addEventListener = outputFieldAccess.name;
|
|
@@ -15820,7 +15774,7 @@ var SymbolBuilder = class {
|
|
|
15820
15774
|
shimLocation: { shimPath: this.shimPath, positionInShimFile }
|
|
15821
15775
|
});
|
|
15822
15776
|
} else {
|
|
15823
|
-
if (!
|
|
15777
|
+
if (!ts69.isElementAccessExpression(outputFieldAccess)) {
|
|
15824
15778
|
continue;
|
|
15825
15779
|
}
|
|
15826
15780
|
const tsSymbol = this.getTypeChecker().getSymbolAtLocation(outputFieldAccess.argumentExpression);
|
|
@@ -15888,11 +15842,11 @@ var SymbolBuilder = class {
|
|
|
15888
15842
|
return null;
|
|
15889
15843
|
}
|
|
15890
15844
|
const [declaration] = tsSymbol.declarations;
|
|
15891
|
-
if (!
|
|
15845
|
+
if (!ts69.isVariableDeclaration(declaration) || !hasExpressionIdentifier(declaration.getSourceFile(), (_a = declaration.type) != null ? _a : declaration.name, ExpressionIdentifier.DIRECTIVE)) {
|
|
15892
15846
|
return null;
|
|
15893
15847
|
}
|
|
15894
15848
|
const symbol = this.getSymbolOfTsNode(declaration);
|
|
15895
|
-
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !
|
|
15849
|
+
if (symbol === null || !isSymbolWithValueDeclaration(symbol.tsSymbol) || !ts69.isClassDeclaration(symbol.tsSymbol.valueDeclaration)) {
|
|
15896
15850
|
return null;
|
|
15897
15851
|
}
|
|
15898
15852
|
const ngModule = this.getDirectiveModule(symbol.tsSymbol.valueDeclaration);
|
|
@@ -15908,7 +15862,7 @@ var SymbolBuilder = class {
|
|
|
15908
15862
|
};
|
|
15909
15863
|
}
|
|
15910
15864
|
getSymbolOfVariable(variable) {
|
|
15911
|
-
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter:
|
|
15865
|
+
const node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: variable.sourceSpan, filter: ts69.isVariableDeclaration });
|
|
15912
15866
|
if (node === null || node.initializer === void 0) {
|
|
15913
15867
|
return null;
|
|
15914
15868
|
}
|
|
@@ -15930,11 +15884,11 @@ var SymbolBuilder = class {
|
|
|
15930
15884
|
}
|
|
15931
15885
|
getSymbolOfReference(ref) {
|
|
15932
15886
|
const target = this.templateData.boundTarget.getReferenceTarget(ref);
|
|
15933
|
-
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter:
|
|
15887
|
+
let node = findFirstMatchingNode(this.typeCheckBlock, { withSpan: ref.sourceSpan, filter: ts69.isVariableDeclaration });
|
|
15934
15888
|
if (node === null || target === null || node.initializer === void 0) {
|
|
15935
15889
|
return null;
|
|
15936
15890
|
}
|
|
15937
|
-
const originalDeclaration =
|
|
15891
|
+
const originalDeclaration = ts69.isParenthesizedExpression(node.initializer) && ts69.isAsExpression(node.initializer.expression) ? this.getTypeChecker().getSymbolAtLocation(node.name) : this.getTypeChecker().getSymbolAtLocation(node.initializer);
|
|
15938
15892
|
if (originalDeclaration === void 0 || originalDeclaration.valueDeclaration === void 0) {
|
|
15939
15893
|
return null;
|
|
15940
15894
|
}
|
|
@@ -15957,7 +15911,7 @@ var SymbolBuilder = class {
|
|
|
15957
15911
|
referenceVarLocation: referenceVarShimLocation
|
|
15958
15912
|
};
|
|
15959
15913
|
} else {
|
|
15960
|
-
if (!
|
|
15914
|
+
if (!ts69.isClassDeclaration(target.directive.ref.node)) {
|
|
15961
15915
|
return null;
|
|
15962
15916
|
}
|
|
15963
15917
|
return {
|
|
@@ -15972,7 +15926,7 @@ var SymbolBuilder = class {
|
|
|
15972
15926
|
}
|
|
15973
15927
|
}
|
|
15974
15928
|
getSymbolOfPipe(expression) {
|
|
15975
|
-
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter:
|
|
15929
|
+
const methodAccess = findFirstMatchingNode(this.typeCheckBlock, { withSpan: expression.nameSpan, filter: ts69.isPropertyAccessExpression });
|
|
15976
15930
|
if (methodAccess === null) {
|
|
15977
15931
|
return null;
|
|
15978
15932
|
}
|
|
@@ -16011,7 +15965,7 @@ var SymbolBuilder = class {
|
|
|
16011
15965
|
}
|
|
16012
15966
|
let node = null;
|
|
16013
15967
|
if (expression instanceof PropertyRead3) {
|
|
16014
|
-
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter:
|
|
15968
|
+
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: ts69.isPropertyAccessExpression });
|
|
16015
15969
|
}
|
|
16016
15970
|
if (node === null) {
|
|
16017
15971
|
node = findFirstMatchingNode(this.typeCheckBlock, { withSpan, filter: anyNodeFilter });
|
|
@@ -16019,10 +15973,10 @@ var SymbolBuilder = class {
|
|
|
16019
15973
|
if (node === null) {
|
|
16020
15974
|
return null;
|
|
16021
15975
|
}
|
|
16022
|
-
while (
|
|
15976
|
+
while (ts69.isParenthesizedExpression(node)) {
|
|
16023
15977
|
node = node.expression;
|
|
16024
15978
|
}
|
|
16025
|
-
if (expression instanceof SafePropertyRead4 &&
|
|
15979
|
+
if (expression instanceof SafePropertyRead4 && ts69.isConditionalExpression(node)) {
|
|
16026
15980
|
const whenTrueSymbol = this.getSymbolOfTsNode(node.whenTrue);
|
|
16027
15981
|
if (whenTrueSymbol === null) {
|
|
16028
15982
|
return null;
|
|
@@ -16038,13 +15992,13 @@ var SymbolBuilder = class {
|
|
|
16038
15992
|
}
|
|
16039
15993
|
getSymbolOfTsNode(node) {
|
|
16040
15994
|
var _a;
|
|
16041
|
-
while (
|
|
15995
|
+
while (ts69.isParenthesizedExpression(node)) {
|
|
16042
15996
|
node = node.expression;
|
|
16043
15997
|
}
|
|
16044
15998
|
let tsSymbol;
|
|
16045
|
-
if (
|
|
15999
|
+
if (ts69.isPropertyAccessExpression(node)) {
|
|
16046
16000
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
|
|
16047
|
-
} else if (
|
|
16001
|
+
} else if (ts69.isElementAccessExpression(node)) {
|
|
16048
16002
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.argumentExpression);
|
|
16049
16003
|
} else {
|
|
16050
16004
|
tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
|
|
@@ -16058,13 +16012,13 @@ var SymbolBuilder = class {
|
|
|
16058
16012
|
};
|
|
16059
16013
|
}
|
|
16060
16014
|
getShimPositionForNode(node) {
|
|
16061
|
-
if (
|
|
16015
|
+
if (ts69.isTypeReferenceNode(node)) {
|
|
16062
16016
|
return this.getShimPositionForNode(node.typeName);
|
|
16063
|
-
} else if (
|
|
16017
|
+
} else if (ts69.isQualifiedName(node)) {
|
|
16064
16018
|
return node.right.getStart();
|
|
16065
|
-
} else if (
|
|
16019
|
+
} else if (ts69.isPropertyAccessExpression(node)) {
|
|
16066
16020
|
return node.name.getStart();
|
|
16067
|
-
} else if (
|
|
16021
|
+
} else if (ts69.isElementAccessExpression(node)) {
|
|
16068
16022
|
return node.argumentExpression.getStart();
|
|
16069
16023
|
} else {
|
|
16070
16024
|
return node.getStart();
|
|
@@ -16078,7 +16032,7 @@ function sourceSpanEqual(a, b) {
|
|
|
16078
16032
|
return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
|
|
16079
16033
|
}
|
|
16080
16034
|
|
|
16081
|
-
// bazel-out/
|
|
16035
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
|
|
16082
16036
|
var REGISTRY2 = new DomElementSchemaRegistry3();
|
|
16083
16037
|
var TemplateTypeCheckerImpl = class {
|
|
16084
16038
|
constructor(originalProgram, programDriver, typeCheckAdapter, config, refEmitter, reflector, compilerHost, priorBuild, componentScopeReader, typeCheckScopeRegistry, perf) {
|
|
@@ -16594,7 +16548,7 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
16594
16548
|
}
|
|
16595
16549
|
};
|
|
16596
16550
|
|
|
16597
|
-
// bazel-out/
|
|
16551
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
|
|
16598
16552
|
var ExtendedTemplateCheckerImpl = class {
|
|
16599
16553
|
constructor(templateTypeChecker, typeChecker, templateChecks) {
|
|
16600
16554
|
this.templateChecks = templateChecks;
|
|
@@ -16613,11 +16567,11 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
16613
16567
|
}
|
|
16614
16568
|
};
|
|
16615
16569
|
|
|
16616
|
-
// bazel-out/
|
|
16570
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
16617
16571
|
import { TmplAstBoundEvent as TmplAstBoundEvent2 } from "@angular/compiler";
|
|
16618
|
-
import
|
|
16572
|
+
import ts70 from "typescript";
|
|
16619
16573
|
|
|
16620
|
-
// bazel-out/
|
|
16574
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
16621
16575
|
import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor3 } from "@angular/compiler";
|
|
16622
16576
|
var TemplateCheckWithVisitor = class {
|
|
16623
16577
|
run(ctx, component, template) {
|
|
@@ -16694,7 +16648,7 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
|
|
|
16694
16648
|
}
|
|
16695
16649
|
};
|
|
16696
16650
|
|
|
16697
|
-
// bazel-out/
|
|
16651
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/invalid_banana_in_box/index.mjs
|
|
16698
16652
|
var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
16699
16653
|
constructor() {
|
|
16700
16654
|
super(...arguments);
|
|
@@ -16708,15 +16662,15 @@ var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
|
16708
16662
|
return [];
|
|
16709
16663
|
const boundSyntax = node.sourceSpan.toString();
|
|
16710
16664
|
const expectedBoundSyntax = boundSyntax.replace(`(${name})`, `[(${name.slice(1, -1)})]`);
|
|
16711
|
-
const diagnostic = ctx.templateTypeChecker.makeTemplateDiagnostic(component, node.sourceSpan,
|
|
16665
|
+
const diagnostic = ctx.templateTypeChecker.makeTemplateDiagnostic(component, node.sourceSpan, ts70.DiagnosticCategory.Warning, ErrorCode.INVALID_BANANA_IN_BOX, `In the two-way binding syntax the parentheses should be inside the brackets, ex. '${expectedBoundSyntax}'.
|
|
16712
16666
|
Find more at https://angular.io/guide/two-way-binding`);
|
|
16713
16667
|
return [diagnostic];
|
|
16714
16668
|
}
|
|
16715
16669
|
};
|
|
16716
16670
|
|
|
16717
|
-
// bazel-out/
|
|
16671
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/nullish_coalescing_not_nullable/index.mjs
|
|
16718
16672
|
import { Binary } from "@angular/compiler";
|
|
16719
|
-
import
|
|
16673
|
+
import ts71 from "typescript";
|
|
16720
16674
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
16721
16675
|
constructor() {
|
|
16722
16676
|
super(...arguments);
|
|
@@ -16737,12 +16691,12 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
16737
16691
|
return [];
|
|
16738
16692
|
}
|
|
16739
16693
|
const span = ctx.templateTypeChecker.getTemplateMappingAtShimLocation(symbol.shimLocation).span;
|
|
16740
|
-
const diagnostic = ctx.templateTypeChecker.makeTemplateDiagnostic(component, span,
|
|
16694
|
+
const diagnostic = ctx.templateTypeChecker.makeTemplateDiagnostic(component, span, ts71.DiagnosticCategory.Warning, ErrorCode.NULLISH_COALESCING_NOT_NULLABLE, `The left side of this nullish coalescing operation does not include 'null' or 'undefined' in its type, therefore the '??' operator can be safely removed.`);
|
|
16741
16695
|
return [diagnostic];
|
|
16742
16696
|
}
|
|
16743
16697
|
};
|
|
16744
16698
|
|
|
16745
|
-
// bazel-out/
|
|
16699
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
16746
16700
|
var CompilationTicketKind;
|
|
16747
16701
|
(function(CompilationTicketKind2) {
|
|
16748
16702
|
CompilationTicketKind2[CompilationTicketKind2["Fresh"] = 0] = "Fresh";
|
|
@@ -16826,7 +16780,7 @@ var NgCompiler = class {
|
|
|
16826
16780
|
this.currentProgram = inputProgram;
|
|
16827
16781
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
16828
16782
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
16829
|
-
const moduleResolutionCache =
|
|
16783
|
+
const moduleResolutionCache = ts72.createModuleResolutionCache(this.adapter.getCurrentDirectory(), this.adapter.getCanonicalFileName.bind(this.adapter));
|
|
16830
16784
|
this.moduleResolver = new ModuleResolver(inputProgram, this.options, this.adapter, moduleResolutionCache);
|
|
16831
16785
|
this.resourceManager = new AdapterResourceLoader(adapter, this.options);
|
|
16832
16786
|
this.cycleAnalyzer = new CycleAnalyzer(new ImportGraph(inputProgram.getTypeChecker(), this.delegatingPerfRecorder));
|
|
@@ -16882,7 +16836,7 @@ var NgCompiler = class {
|
|
|
16882
16836
|
}
|
|
16883
16837
|
for (const clazz of classesToUpdate) {
|
|
16884
16838
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
16885
|
-
if (!
|
|
16839
|
+
if (!ts72.isClassDeclaration(clazz)) {
|
|
16886
16840
|
continue;
|
|
16887
16841
|
}
|
|
16888
16842
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -17021,7 +16975,6 @@ var NgCompiler = class {
|
|
|
17021
16975
|
if (this.adapter.factoryTracker !== null) {
|
|
17022
16976
|
before.push(generatedFactoryTransform(this.adapter.factoryTracker.sourceInfo, importRewriter));
|
|
17023
16977
|
}
|
|
17024
|
-
before.push(ivySwitchTransform);
|
|
17025
16978
|
return { transformers: { before, afterDeclarations } };
|
|
17026
16979
|
}
|
|
17027
16980
|
getIndexedComponents() {
|
|
@@ -17292,17 +17245,17 @@ function isAngularCorePackage(program) {
|
|
|
17292
17245
|
return false;
|
|
17293
17246
|
}
|
|
17294
17247
|
return r3Symbols.statements.some((stmt) => {
|
|
17295
|
-
if (!
|
|
17248
|
+
if (!ts72.isVariableStatement(stmt)) {
|
|
17296
17249
|
return false;
|
|
17297
17250
|
}
|
|
17298
|
-
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind ===
|
|
17251
|
+
if (stmt.modifiers === void 0 || !stmt.modifiers.some((mod) => mod.kind === ts72.SyntaxKind.ExportKeyword)) {
|
|
17299
17252
|
return false;
|
|
17300
17253
|
}
|
|
17301
17254
|
return stmt.declarationList.declarations.some((decl) => {
|
|
17302
|
-
if (!
|
|
17255
|
+
if (!ts72.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
17303
17256
|
return false;
|
|
17304
17257
|
}
|
|
17305
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
17258
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== ts72.SyntaxKind.TrueKeyword) {
|
|
17306
17259
|
return false;
|
|
17307
17260
|
}
|
|
17308
17261
|
return true;
|
|
@@ -17315,7 +17268,7 @@ function getR3SymbolsFile(program) {
|
|
|
17315
17268
|
function verifyCompatibleTypeCheckOptions(options) {
|
|
17316
17269
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
17317
17270
|
return {
|
|
17318
|
-
category:
|
|
17271
|
+
category: ts72.DiagnosticCategory.Error,
|
|
17319
17272
|
code: ngErrorCode(ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK),
|
|
17320
17273
|
file: void 0,
|
|
17321
17274
|
start: void 0,
|
|
@@ -17343,7 +17296,7 @@ var ReferenceGraphAdapter = class {
|
|
|
17343
17296
|
for (const { node } of references) {
|
|
17344
17297
|
let sourceFile = node.getSourceFile();
|
|
17345
17298
|
if (sourceFile === void 0) {
|
|
17346
|
-
sourceFile =
|
|
17299
|
+
sourceFile = ts72.getOriginalNode(node).getSourceFile();
|
|
17347
17300
|
}
|
|
17348
17301
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
17349
17302
|
this.graph.add(source, node);
|
|
@@ -17381,11 +17334,11 @@ function versionMapFromProgram(program, driver) {
|
|
|
17381
17334
|
return versions;
|
|
17382
17335
|
}
|
|
17383
17336
|
|
|
17384
|
-
// bazel-out/
|
|
17337
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
17385
17338
|
import { HtmlParser, MessageBundle } from "@angular/compiler";
|
|
17386
|
-
import
|
|
17339
|
+
import ts75 from "typescript";
|
|
17387
17340
|
|
|
17388
|
-
// bazel-out/
|
|
17341
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
17389
17342
|
import { Xliff, Xliff2, Xmb } from "@angular/compiler";
|
|
17390
17343
|
import {
|
|
17391
17344
|
relative as relative5,
|
|
@@ -17440,12 +17393,19 @@ function getPathNormalizer(basePath) {
|
|
|
17440
17393
|
};
|
|
17441
17394
|
}
|
|
17442
17395
|
|
|
17443
|
-
// bazel-out/
|
|
17444
|
-
import
|
|
17396
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
17397
|
+
import ts73 from "typescript";
|
|
17445
17398
|
|
|
17446
|
-
// bazel-out/
|
|
17399
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/diagnostics/typescript_version.mjs
|
|
17447
17400
|
function toNumbers(value) {
|
|
17448
|
-
|
|
17401
|
+
const suffixIndex = value.lastIndexOf("-");
|
|
17402
|
+
return value.slice(0, suffixIndex === -1 ? value.length : suffixIndex).split(".").map((segment) => {
|
|
17403
|
+
const parsed = parseInt(segment, 10);
|
|
17404
|
+
if (isNaN(parsed)) {
|
|
17405
|
+
throw Error(`Unable to parse version string ${value}.`);
|
|
17406
|
+
}
|
|
17407
|
+
return parsed;
|
|
17408
|
+
});
|
|
17449
17409
|
}
|
|
17450
17410
|
function compareNumbers(a, b) {
|
|
17451
17411
|
const max = Math.max(a.length, b.length);
|
|
@@ -17471,10 +17431,10 @@ function compareVersions(v1, v2) {
|
|
|
17471
17431
|
return compareNumbers(toNumbers(v1), toNumbers(v2));
|
|
17472
17432
|
}
|
|
17473
17433
|
|
|
17474
|
-
// bazel-out/
|
|
17434
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/typescript_support.mjs
|
|
17475
17435
|
var MIN_TS_VERSION = "4.4.2";
|
|
17476
17436
|
var MAX_TS_VERSION = "4.5.0";
|
|
17477
|
-
var tsVersion =
|
|
17437
|
+
var tsVersion = ts73.version;
|
|
17478
17438
|
function checkVersion(version, minVersion, maxVersion) {
|
|
17479
17439
|
if (compareVersions(version, minVersion) < 0 || compareVersions(version, maxVersion) >= 0) {
|
|
17480
17440
|
throw new Error(`The Angular Compiler requires TypeScript >=${minVersion} and <${maxVersion} but ${version} was found instead.`);
|
|
@@ -17484,8 +17444,8 @@ function verifySupportedTypeScriptVersion() {
|
|
|
17484
17444
|
checkVersion(tsVersion, MIN_TS_VERSION, MAX_TS_VERSION);
|
|
17485
17445
|
}
|
|
17486
17446
|
|
|
17487
|
-
// bazel-out/
|
|
17488
|
-
import
|
|
17447
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
17448
|
+
import ts74 from "typescript";
|
|
17489
17449
|
var DelegatingCompilerHost2 = class {
|
|
17490
17450
|
constructor(delegate) {
|
|
17491
17451
|
this.delegate = delegate;
|
|
@@ -17574,7 +17534,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
17574
17534
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
17575
17535
|
if (entryPoint === null) {
|
|
17576
17536
|
diagnostics.push({
|
|
17577
|
-
category:
|
|
17537
|
+
category: ts74.DiagnosticCategory.Error,
|
|
17578
17538
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
17579
17539
|
file: void 0,
|
|
17580
17540
|
start: void 0,
|
|
@@ -17614,17 +17574,17 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
17614
17574
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
17615
17575
|
}
|
|
17616
17576
|
createCachedResolveModuleNamesFunction() {
|
|
17617
|
-
const moduleResolutionCache =
|
|
17577
|
+
const moduleResolutionCache = ts74.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
17618
17578
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
17619
17579
|
return moduleNames.map((moduleName) => {
|
|
17620
|
-
const module2 =
|
|
17580
|
+
const module2 = ts74.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
17621
17581
|
return module2.resolvedModule;
|
|
17622
17582
|
});
|
|
17623
17583
|
};
|
|
17624
17584
|
}
|
|
17625
17585
|
};
|
|
17626
17586
|
|
|
17627
|
-
// bazel-out/
|
|
17587
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
17628
17588
|
var NgtscProgram = class {
|
|
17629
17589
|
constructor(rootNames, options, delegateHost, oldProgram) {
|
|
17630
17590
|
this.options = options;
|
|
@@ -17638,7 +17598,7 @@ var NgtscProgram = class {
|
|
|
17638
17598
|
if (reuseProgram !== void 0) {
|
|
17639
17599
|
retagAllTsFiles(reuseProgram);
|
|
17640
17600
|
}
|
|
17641
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
17601
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts75.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
17642
17602
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
17643
17603
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
17644
17604
|
this.host.postProgramCreationCleanup();
|
|
@@ -17837,11 +17797,11 @@ function mergeEmitResults(emitResults) {
|
|
|
17837
17797
|
return { diagnostics, emitSkipped, emittedFiles };
|
|
17838
17798
|
}
|
|
17839
17799
|
|
|
17840
|
-
// bazel-out/
|
|
17841
|
-
import ts78 from "typescript";
|
|
17842
|
-
|
|
17843
|
-
// bazel-out/darwin-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.mjs
|
|
17800
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
|
|
17844
17801
|
import ts77 from "typescript";
|
|
17802
|
+
|
|
17803
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.mjs
|
|
17804
|
+
import ts76 from "typescript";
|
|
17845
17805
|
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
17846
17806
|
function loadIsReferencedAliasDeclarationPatch(context) {
|
|
17847
17807
|
if (!isTransformationContextWithEmitResolver(context)) {
|
|
@@ -17866,7 +17826,7 @@ function loadIsReferencedAliasDeclarationPatch(context) {
|
|
|
17866
17826
|
return emitResolver[patchedReferencedAliasesSymbol] = referencedAliases;
|
|
17867
17827
|
}
|
|
17868
17828
|
function isAliasImportDeclaration(node) {
|
|
17869
|
-
return
|
|
17829
|
+
return ts76.isImportSpecifier(node) || ts76.isNamespaceImport(node) || ts76.isImportClause(node);
|
|
17870
17830
|
}
|
|
17871
17831
|
function isTransformationContextWithEmitResolver(context) {
|
|
17872
17832
|
return context.getEmitResolver !== void 0;
|
|
@@ -17875,7 +17835,7 @@ function throwIncompatibleTransformationContextError() {
|
|
|
17875
17835
|
throw Error("Unable to downlevel Angular decorators due to an incompatible TypeScript version.\nIf you recently updated TypeScript and this issue surfaces now, consider downgrading.\n\nPlease report an issue on the Angular repositories when this issue surfaces and you are using a supposedly compatible TypeScript version.");
|
|
17876
17836
|
}
|
|
17877
17837
|
|
|
17878
|
-
// bazel-out/
|
|
17838
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
|
|
17879
17839
|
function isAngularDecorator3(decorator, isCore) {
|
|
17880
17840
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
17881
17841
|
}
|
|
@@ -17884,19 +17844,19 @@ function extractMetadataFromSingleDecorator(decorator, diagnostics) {
|
|
|
17884
17844
|
const metadataProperties = [];
|
|
17885
17845
|
const expr = decorator.expression;
|
|
17886
17846
|
switch (expr.kind) {
|
|
17887
|
-
case
|
|
17888
|
-
metadataProperties.push(
|
|
17847
|
+
case ts77.SyntaxKind.Identifier:
|
|
17848
|
+
metadataProperties.push(ts77.createPropertyAssignment("type", expr));
|
|
17889
17849
|
break;
|
|
17890
|
-
case
|
|
17850
|
+
case ts77.SyntaxKind.CallExpression:
|
|
17891
17851
|
const call = expr;
|
|
17892
|
-
metadataProperties.push(
|
|
17852
|
+
metadataProperties.push(ts77.createPropertyAssignment("type", call.expression));
|
|
17893
17853
|
if (call.arguments.length) {
|
|
17894
17854
|
const args = [];
|
|
17895
17855
|
for (const arg of call.arguments) {
|
|
17896
17856
|
args.push(arg);
|
|
17897
17857
|
}
|
|
17898
|
-
const argsArrayLiteral =
|
|
17899
|
-
metadataProperties.push(
|
|
17858
|
+
const argsArrayLiteral = ts77.createArrayLiteral(ts77.createNodeArray(args, true));
|
|
17859
|
+
metadataProperties.push(ts77.createPropertyAssignment("args", argsArrayLiteral));
|
|
17900
17860
|
}
|
|
17901
17861
|
break;
|
|
17902
17862
|
default:
|
|
@@ -17904,38 +17864,38 @@ function extractMetadataFromSingleDecorator(decorator, diagnostics) {
|
|
|
17904
17864
|
file: decorator.getSourceFile(),
|
|
17905
17865
|
start: decorator.getStart(),
|
|
17906
17866
|
length: decorator.getEnd() - decorator.getStart(),
|
|
17907
|
-
messageText: `${
|
|
17908
|
-
category:
|
|
17867
|
+
messageText: `${ts77.SyntaxKind[decorator.kind]} not implemented in gathering decorator metadata.`,
|
|
17868
|
+
category: ts77.DiagnosticCategory.Error,
|
|
17909
17869
|
code: 0
|
|
17910
17870
|
});
|
|
17911
17871
|
break;
|
|
17912
17872
|
}
|
|
17913
|
-
return
|
|
17873
|
+
return ts77.createObjectLiteral(metadataProperties);
|
|
17914
17874
|
}
|
|
17915
17875
|
function createCtorParametersClassProperty(diagnostics, entityNameToExpression, ctorParameters, isClosureCompilerEnabled) {
|
|
17916
17876
|
const params = [];
|
|
17917
17877
|
for (const ctorParam of ctorParameters) {
|
|
17918
17878
|
if (!ctorParam.type && ctorParam.decorators.length === 0) {
|
|
17919
|
-
params.push(
|
|
17879
|
+
params.push(ts77.createNull());
|
|
17920
17880
|
continue;
|
|
17921
17881
|
}
|
|
17922
17882
|
const paramType = ctorParam.type ? typeReferenceToExpression(entityNameToExpression, ctorParam.type) : void 0;
|
|
17923
|
-
const members = [
|
|
17883
|
+
const members = [ts77.createPropertyAssignment("type", paramType || ts77.createIdentifier("undefined"))];
|
|
17924
17884
|
const decorators = [];
|
|
17925
17885
|
for (const deco of ctorParam.decorators) {
|
|
17926
17886
|
decorators.push(extractMetadataFromSingleDecorator(deco, diagnostics));
|
|
17927
17887
|
}
|
|
17928
17888
|
if (decorators.length) {
|
|
17929
|
-
members.push(
|
|
17889
|
+
members.push(ts77.createPropertyAssignment("decorators", ts77.createArrayLiteral(decorators)));
|
|
17930
17890
|
}
|
|
17931
|
-
params.push(
|
|
17891
|
+
params.push(ts77.createObjectLiteral(members));
|
|
17932
17892
|
}
|
|
17933
|
-
const initializer =
|
|
17934
|
-
const ctorProp =
|
|
17893
|
+
const initializer = ts77.createArrowFunction(void 0, void 0, [], void 0, ts77.createToken(ts77.SyntaxKind.EqualsGreaterThanToken), ts77.createArrayLiteral(params, true));
|
|
17894
|
+
const ctorProp = ts77.createProperty(void 0, [ts77.createToken(ts77.SyntaxKind.StaticKeyword)], "ctorParameters", void 0, void 0, initializer);
|
|
17935
17895
|
if (isClosureCompilerEnabled) {
|
|
17936
|
-
|
|
17896
|
+
ts77.setSyntheticLeadingComments(ctorProp, [
|
|
17937
17897
|
{
|
|
17938
|
-
kind:
|
|
17898
|
+
kind: ts77.SyntaxKind.MultiLineCommentTrivia,
|
|
17939
17899
|
text: [
|
|
17940
17900
|
`*`,
|
|
17941
17901
|
` * @type {function(): !Array<(null|{`,
|
|
@@ -17955,53 +17915,53 @@ function createCtorParametersClassProperty(diagnostics, entityNameToExpression,
|
|
|
17955
17915
|
}
|
|
17956
17916
|
function typeReferenceToExpression(entityNameToExpression, node) {
|
|
17957
17917
|
let kind = node.kind;
|
|
17958
|
-
if (
|
|
17918
|
+
if (ts77.isLiteralTypeNode(node)) {
|
|
17959
17919
|
kind = node.literal.kind;
|
|
17960
17920
|
}
|
|
17961
17921
|
switch (kind) {
|
|
17962
|
-
case
|
|
17963
|
-
case
|
|
17964
|
-
return
|
|
17965
|
-
case
|
|
17966
|
-
case
|
|
17967
|
-
return
|
|
17968
|
-
case
|
|
17969
|
-
case
|
|
17970
|
-
case
|
|
17971
|
-
case
|
|
17972
|
-
return
|
|
17973
|
-
case
|
|
17974
|
-
case
|
|
17975
|
-
return
|
|
17976
|
-
case
|
|
17977
|
-
return
|
|
17978
|
-
case
|
|
17979
|
-
case
|
|
17980
|
-
return
|
|
17981
|
-
case
|
|
17922
|
+
case ts77.SyntaxKind.FunctionType:
|
|
17923
|
+
case ts77.SyntaxKind.ConstructorType:
|
|
17924
|
+
return ts77.createIdentifier("Function");
|
|
17925
|
+
case ts77.SyntaxKind.ArrayType:
|
|
17926
|
+
case ts77.SyntaxKind.TupleType:
|
|
17927
|
+
return ts77.createIdentifier("Array");
|
|
17928
|
+
case ts77.SyntaxKind.TypePredicate:
|
|
17929
|
+
case ts77.SyntaxKind.TrueKeyword:
|
|
17930
|
+
case ts77.SyntaxKind.FalseKeyword:
|
|
17931
|
+
case ts77.SyntaxKind.BooleanKeyword:
|
|
17932
|
+
return ts77.createIdentifier("Boolean");
|
|
17933
|
+
case ts77.SyntaxKind.StringLiteral:
|
|
17934
|
+
case ts77.SyntaxKind.StringKeyword:
|
|
17935
|
+
return ts77.createIdentifier("String");
|
|
17936
|
+
case ts77.SyntaxKind.ObjectKeyword:
|
|
17937
|
+
return ts77.createIdentifier("Object");
|
|
17938
|
+
case ts77.SyntaxKind.NumberKeyword:
|
|
17939
|
+
case ts77.SyntaxKind.NumericLiteral:
|
|
17940
|
+
return ts77.createIdentifier("Number");
|
|
17941
|
+
case ts77.SyntaxKind.TypeReference:
|
|
17982
17942
|
const typeRef = node;
|
|
17983
17943
|
return entityNameToExpression(typeRef.typeName);
|
|
17984
|
-
case
|
|
17985
|
-
const childTypeNodes = node.types.filter((t) => !(
|
|
17944
|
+
case ts77.SyntaxKind.UnionType:
|
|
17945
|
+
const childTypeNodes = node.types.filter((t) => !(ts77.isLiteralTypeNode(t) && t.literal.kind === ts77.SyntaxKind.NullKeyword));
|
|
17986
17946
|
return childTypeNodes.length === 1 ? typeReferenceToExpression(entityNameToExpression, childTypeNodes[0]) : void 0;
|
|
17987
17947
|
default:
|
|
17988
17948
|
return void 0;
|
|
17989
17949
|
}
|
|
17990
17950
|
}
|
|
17991
17951
|
function symbolIsRuntimeValue(typeChecker, symbol) {
|
|
17992
|
-
if (symbol.flags &
|
|
17952
|
+
if (symbol.flags & ts77.SymbolFlags.Alias) {
|
|
17993
17953
|
symbol = typeChecker.getAliasedSymbol(symbol);
|
|
17994
17954
|
}
|
|
17995
|
-
return (symbol.flags &
|
|
17955
|
+
return (symbol.flags & ts77.SymbolFlags.Value & ts77.SymbolFlags.ConstEnumExcludes) !== 0;
|
|
17996
17956
|
}
|
|
17997
17957
|
function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore, isClosureCompilerEnabled, skipClassDecorators) {
|
|
17998
17958
|
function addJSDocTypeAnnotation(node, jsdocType) {
|
|
17999
17959
|
if (!isClosureCompilerEnabled) {
|
|
18000
17960
|
return;
|
|
18001
17961
|
}
|
|
18002
|
-
|
|
17962
|
+
ts77.setSyntheticLeadingComments(node, [
|
|
18003
17963
|
{
|
|
18004
|
-
kind:
|
|
17964
|
+
kind: ts77.SyntaxKind.MultiLineCommentTrivia,
|
|
18005
17965
|
text: `* @type {${jsdocType}} `,
|
|
18006
17966
|
pos: -1,
|
|
18007
17967
|
end: -1,
|
|
@@ -18010,19 +17970,19 @@ function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore,
|
|
|
18010
17970
|
]);
|
|
18011
17971
|
}
|
|
18012
17972
|
function createDecoratorClassProperty(decoratorList) {
|
|
18013
|
-
const modifier =
|
|
18014
|
-
const initializer =
|
|
18015
|
-
const prop =
|
|
17973
|
+
const modifier = ts77.createToken(ts77.SyntaxKind.StaticKeyword);
|
|
17974
|
+
const initializer = ts77.createArrayLiteral(decoratorList, true);
|
|
17975
|
+
const prop = ts77.createProperty(void 0, [modifier], "decorators", void 0, void 0, initializer);
|
|
18016
17976
|
addJSDocTypeAnnotation(prop, DECORATOR_INVOCATION_JSDOC_TYPE);
|
|
18017
17977
|
return prop;
|
|
18018
17978
|
}
|
|
18019
17979
|
function createPropDecoratorsClassProperty(diagnostics2, properties) {
|
|
18020
17980
|
const entries = [];
|
|
18021
17981
|
for (const [name, decorators] of properties.entries()) {
|
|
18022
|
-
entries.push(
|
|
17982
|
+
entries.push(ts77.createPropertyAssignment(name, ts77.createArrayLiteral(decorators.map((deco) => extractMetadataFromSingleDecorator(deco, diagnostics2)))));
|
|
18023
17983
|
}
|
|
18024
|
-
const initializer =
|
|
18025
|
-
const prop =
|
|
17984
|
+
const initializer = ts77.createObjectLiteral(entries, true);
|
|
17985
|
+
const prop = ts77.createProperty(void 0, [ts77.createToken(ts77.SyntaxKind.StaticKeyword)], "propDecorators", void 0, void 0, initializer);
|
|
18026
17986
|
addJSDocTypeAnnotation(prop, `!Object<string, ${DECORATOR_INVOCATION_JSDOC_TYPE}>`);
|
|
18027
17987
|
return prop;
|
|
18028
17988
|
}
|
|
@@ -18033,24 +17993,24 @@ function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore,
|
|
|
18033
17993
|
if (!symbol || !symbolIsRuntimeValue(typeChecker, symbol) || !symbol.declarations || symbol.declarations.length === 0) {
|
|
18034
17994
|
return void 0;
|
|
18035
17995
|
}
|
|
18036
|
-
if (
|
|
17996
|
+
if (ts77.isQualifiedName(name)) {
|
|
18037
17997
|
const containerExpr = entityNameToExpression(name.left);
|
|
18038
17998
|
if (containerExpr === void 0) {
|
|
18039
17999
|
return void 0;
|
|
18040
18000
|
}
|
|
18041
|
-
return
|
|
18001
|
+
return ts77.createPropertyAccess(containerExpr, name.right);
|
|
18042
18002
|
}
|
|
18043
18003
|
const decl = symbol.declarations[0];
|
|
18044
18004
|
if (isAliasImportDeclaration(decl)) {
|
|
18045
18005
|
referencedParameterTypes.add(decl);
|
|
18046
18006
|
if (decl.name !== void 0) {
|
|
18047
|
-
return
|
|
18007
|
+
return ts77.getMutableClone(decl.name);
|
|
18048
18008
|
}
|
|
18049
18009
|
}
|
|
18050
|
-
return
|
|
18010
|
+
return ts77.getMutableClone(name);
|
|
18051
18011
|
}
|
|
18052
18012
|
function transformClassElement(element) {
|
|
18053
|
-
element =
|
|
18013
|
+
element = ts77.visitEachChild(element, decoratorDownlevelVisitor, context);
|
|
18054
18014
|
const decoratorsToKeep = [];
|
|
18055
18015
|
const toLower = [];
|
|
18056
18016
|
const decorators = host.getDecoratorsOfDeclaration(element) || [];
|
|
@@ -18064,26 +18024,26 @@ function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore,
|
|
|
18064
18024
|
}
|
|
18065
18025
|
if (!toLower.length)
|
|
18066
18026
|
return [void 0, element, []];
|
|
18067
|
-
if (!element.name || !
|
|
18027
|
+
if (!element.name || !ts77.isIdentifier(element.name)) {
|
|
18068
18028
|
diagnostics.push({
|
|
18069
18029
|
file: element.getSourceFile(),
|
|
18070
18030
|
start: element.getStart(),
|
|
18071
18031
|
length: element.getEnd() - element.getStart(),
|
|
18072
18032
|
messageText: `Cannot process decorators for class element with non-analyzable name.`,
|
|
18073
|
-
category:
|
|
18033
|
+
category: ts77.DiagnosticCategory.Error,
|
|
18074
18034
|
code: 0
|
|
18075
18035
|
});
|
|
18076
18036
|
return [void 0, element, []];
|
|
18077
18037
|
}
|
|
18078
18038
|
const name = element.name.text;
|
|
18079
|
-
const mutable =
|
|
18080
|
-
mutable.decorators = decoratorsToKeep.length ?
|
|
18039
|
+
const mutable = ts77.getMutableClone(element);
|
|
18040
|
+
mutable.decorators = decoratorsToKeep.length ? ts77.setTextRange(ts77.createNodeArray(decoratorsToKeep), mutable.decorators) : void 0;
|
|
18081
18041
|
return [name, mutable, toLower];
|
|
18082
18042
|
}
|
|
18083
18043
|
function transformConstructor(ctor) {
|
|
18084
|
-
ctor =
|
|
18044
|
+
ctor = ts77.visitEachChild(ctor, decoratorDownlevelVisitor, context);
|
|
18085
18045
|
const newParameters = [];
|
|
18086
|
-
const oldParameters =
|
|
18046
|
+
const oldParameters = ctor.parameters;
|
|
18087
18047
|
const parametersInfo = [];
|
|
18088
18048
|
for (const param of oldParameters) {
|
|
18089
18049
|
const decoratorsToKeep = [];
|
|
@@ -18101,30 +18061,30 @@ function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore,
|
|
|
18101
18061
|
paramInfo.type = param.type;
|
|
18102
18062
|
}
|
|
18103
18063
|
parametersInfo.push(paramInfo);
|
|
18104
|
-
const newParam =
|
|
18064
|
+
const newParam = ts77.updateParameter(param, decoratorsToKeep.length ? decoratorsToKeep : void 0, param.modifiers, param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer);
|
|
18105
18065
|
newParameters.push(newParam);
|
|
18106
18066
|
}
|
|
18107
|
-
const updated =
|
|
18067
|
+
const updated = ts77.updateConstructor(ctor, ctor.decorators, ctor.modifiers, newParameters, ctor.body);
|
|
18108
18068
|
return [updated, parametersInfo];
|
|
18109
18069
|
}
|
|
18110
18070
|
function transformClassDeclaration(classDecl) {
|
|
18111
|
-
classDecl =
|
|
18071
|
+
classDecl = ts77.getMutableClone(classDecl);
|
|
18112
18072
|
const newMembers = [];
|
|
18113
18073
|
const decoratedProperties = new Map();
|
|
18114
18074
|
let classParameters = null;
|
|
18115
18075
|
for (const member of classDecl.members) {
|
|
18116
18076
|
switch (member.kind) {
|
|
18117
|
-
case
|
|
18118
|
-
case
|
|
18119
|
-
case
|
|
18120
|
-
case
|
|
18077
|
+
case ts77.SyntaxKind.PropertyDeclaration:
|
|
18078
|
+
case ts77.SyntaxKind.GetAccessor:
|
|
18079
|
+
case ts77.SyntaxKind.SetAccessor:
|
|
18080
|
+
case ts77.SyntaxKind.MethodDeclaration: {
|
|
18121
18081
|
const [name, newMember, decorators] = transformClassElement(member);
|
|
18122
18082
|
newMembers.push(newMember);
|
|
18123
18083
|
if (name)
|
|
18124
18084
|
decoratedProperties.set(name, decorators);
|
|
18125
18085
|
continue;
|
|
18126
18086
|
}
|
|
18127
|
-
case
|
|
18087
|
+
case ts77.SyntaxKind.Constructor: {
|
|
18128
18088
|
const ctor = member;
|
|
18129
18089
|
if (!ctor.body)
|
|
18130
18090
|
break;
|
|
@@ -18136,7 +18096,7 @@ function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore,
|
|
|
18136
18096
|
default:
|
|
18137
18097
|
break;
|
|
18138
18098
|
}
|
|
18139
|
-
newMembers.push(
|
|
18099
|
+
newMembers.push(ts77.visitEachChild(member, decoratorDownlevelVisitor, context));
|
|
18140
18100
|
}
|
|
18141
18101
|
const decoratorsToKeep = new Set(classDecl.decorators);
|
|
18142
18102
|
const possibleAngularDecorators = host.getDecoratorsOfDeclaration(classDecl) || [];
|
|
@@ -18164,23 +18124,23 @@ function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore,
|
|
|
18164
18124
|
if (decoratedProperties.size) {
|
|
18165
18125
|
newMembers.push(createPropDecoratorsClassProperty(diagnostics, decoratedProperties));
|
|
18166
18126
|
}
|
|
18167
|
-
const members =
|
|
18168
|
-
return
|
|
18127
|
+
const members = ts77.setTextRange(ts77.createNodeArray(newMembers, classDecl.members.hasTrailingComma), classDecl.members);
|
|
18128
|
+
return ts77.updateClassDeclaration(classDecl, decoratorsToKeep.size ? Array.from(decoratorsToKeep) : void 0, classDecl.modifiers, classDecl.name, classDecl.typeParameters, classDecl.heritageClauses, members);
|
|
18169
18129
|
}
|
|
18170
18130
|
function decoratorDownlevelVisitor(node) {
|
|
18171
|
-
if (
|
|
18131
|
+
if (ts77.isClassDeclaration(node)) {
|
|
18172
18132
|
return transformClassDeclaration(node);
|
|
18173
18133
|
}
|
|
18174
|
-
return
|
|
18134
|
+
return ts77.visitEachChild(node, decoratorDownlevelVisitor, context);
|
|
18175
18135
|
}
|
|
18176
18136
|
return (sf) => {
|
|
18177
|
-
return
|
|
18137
|
+
return ts77.visitEachChild(sf, decoratorDownlevelVisitor, context);
|
|
18178
18138
|
};
|
|
18179
18139
|
};
|
|
18180
18140
|
}
|
|
18181
18141
|
|
|
18182
|
-
// bazel-out/
|
|
18183
|
-
import
|
|
18142
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/inline_resources.mjs
|
|
18143
|
+
import ts78 from "typescript";
|
|
18184
18144
|
var PRECONDITIONS_TEXT = "angularCompilerOptions.enableResourceInlining requires all resources to be statically resolvable.";
|
|
18185
18145
|
function getResourceLoader(host, containingFileName) {
|
|
18186
18146
|
return {
|
|
@@ -18207,7 +18167,7 @@ var InlineResourcesMetadataTransformer = class {
|
|
|
18207
18167
|
start(sourceFile) {
|
|
18208
18168
|
const loader = getResourceLoader(this.host, sourceFile.fileName);
|
|
18209
18169
|
return (value, node) => {
|
|
18210
|
-
if (isClassMetadata(value) &&
|
|
18170
|
+
if (isClassMetadata(value) && ts78.isClassDeclaration(node) && value.decorators) {
|
|
18211
18171
|
value.decorators.forEach((d) => {
|
|
18212
18172
|
if (isMetadataSymbolicCallExpression(d) && isMetadataImportedSymbolReferenceExpression(d.expression) && d.expression.module === "@angular/core" && d.expression.name === "Component" && d.arguments) {
|
|
18213
18173
|
d.arguments = d.arguments.map(this.updateDecoratorMetadata.bind(this, loader));
|
|
@@ -18240,66 +18200,66 @@ function getInlineResourcesTransformFactory(program, host) {
|
|
|
18240
18200
|
return (context) => (sourceFile) => {
|
|
18241
18201
|
const loader = getResourceLoader(host, sourceFile.fileName);
|
|
18242
18202
|
const visitor = (node) => {
|
|
18243
|
-
if (!
|
|
18203
|
+
if (!ts78.isClassDeclaration(node)) {
|
|
18244
18204
|
return node;
|
|
18245
18205
|
}
|
|
18246
|
-
const newDecorators =
|
|
18247
|
-
if (
|
|
18206
|
+
const newDecorators = ts78.visitNodes(node.decorators, (node2) => {
|
|
18207
|
+
if (ts78.isDecorator(node2) && isComponentDecorator(node2, program.getTypeChecker())) {
|
|
18248
18208
|
return updateDecorator(node2, loader);
|
|
18249
18209
|
}
|
|
18250
18210
|
return node2;
|
|
18251
18211
|
});
|
|
18252
|
-
const newMembers =
|
|
18253
|
-
if (
|
|
18212
|
+
const newMembers = ts78.visitNodes(node.members, (node2) => {
|
|
18213
|
+
if (ts78.isClassElement(node2)) {
|
|
18254
18214
|
return updateAnnotations(node2, loader, program.getTypeChecker());
|
|
18255
18215
|
} else {
|
|
18256
18216
|
return node2;
|
|
18257
18217
|
}
|
|
18258
18218
|
});
|
|
18259
|
-
return
|
|
18219
|
+
return ts78.updateClassDeclaration(node, newDecorators, node.modifiers, node.name, node.typeParameters, node.heritageClauses || [], newMembers);
|
|
18260
18220
|
};
|
|
18261
|
-
return
|
|
18221
|
+
return ts78.visitEachChild(sourceFile, visitor, context);
|
|
18262
18222
|
};
|
|
18263
18223
|
}
|
|
18264
18224
|
function updateDecorator(node, loader) {
|
|
18265
|
-
if (!
|
|
18225
|
+
if (!ts78.isCallExpression(node.expression)) {
|
|
18266
18226
|
return node;
|
|
18267
18227
|
}
|
|
18268
18228
|
const expr = node.expression;
|
|
18269
18229
|
const newArguments = updateComponentProperties(expr.arguments, loader);
|
|
18270
|
-
return
|
|
18230
|
+
return ts78.updateDecorator(node, ts78.updateCall(expr, expr.expression, expr.typeArguments, newArguments));
|
|
18271
18231
|
}
|
|
18272
18232
|
function updateAnnotations(node, loader, typeChecker) {
|
|
18273
|
-
if (!
|
|
18233
|
+
if (!ts78.isPropertyDeclaration(node) || !ts78.isIdentifier(node.name) || node.name.text !== "decorators" || !node.initializer || !ts78.isArrayLiteralExpression(node.initializer)) {
|
|
18274
18234
|
return node;
|
|
18275
18235
|
}
|
|
18276
18236
|
const newAnnotations = node.initializer.elements.map((annotation) => {
|
|
18277
|
-
if (!
|
|
18237
|
+
if (!ts78.isObjectLiteralExpression(annotation))
|
|
18278
18238
|
return annotation;
|
|
18279
18239
|
const decoratorType = annotation.properties.find((p2) => isIdentifierNamed(p2, "type"));
|
|
18280
|
-
if (!decoratorType || !
|
|
18240
|
+
if (!decoratorType || !ts78.isPropertyAssignment(decoratorType) || !ts78.isIdentifier(decoratorType.initializer) || !isComponentSymbol(decoratorType.initializer, typeChecker)) {
|
|
18281
18241
|
return annotation;
|
|
18282
18242
|
}
|
|
18283
18243
|
const newAnnotation = annotation.properties.map((prop) => {
|
|
18284
|
-
if (!isIdentifierNamed(prop, "args") || !
|
|
18244
|
+
if (!isIdentifierNamed(prop, "args") || !ts78.isPropertyAssignment(prop) || !ts78.isArrayLiteralExpression(prop.initializer))
|
|
18285
18245
|
return prop;
|
|
18286
|
-
const newDecoratorArgs =
|
|
18246
|
+
const newDecoratorArgs = ts78.updatePropertyAssignment(prop, prop.name, ts78.createArrayLiteral(updateComponentProperties(prop.initializer.elements, loader)));
|
|
18287
18247
|
return newDecoratorArgs;
|
|
18288
18248
|
});
|
|
18289
|
-
return
|
|
18249
|
+
return ts78.updateObjectLiteral(annotation, newAnnotation);
|
|
18290
18250
|
});
|
|
18291
|
-
return
|
|
18251
|
+
return ts78.updateProperty(node, node.decorators, node.modifiers, node.name, node.questionToken, node.type, ts78.updateArrayLiteral(node.initializer, newAnnotations));
|
|
18292
18252
|
}
|
|
18293
18253
|
function isIdentifierNamed(p2, name) {
|
|
18294
|
-
return !!p2.name &&
|
|
18254
|
+
return !!p2.name && ts78.isIdentifier(p2.name) && p2.name.text === name;
|
|
18295
18255
|
}
|
|
18296
18256
|
function isComponentDecorator(node, typeChecker) {
|
|
18297
|
-
if (!
|
|
18257
|
+
if (!ts78.isCallExpression(node.expression)) {
|
|
18298
18258
|
return false;
|
|
18299
18259
|
}
|
|
18300
18260
|
const callExpr = node.expression;
|
|
18301
18261
|
let identifier;
|
|
18302
|
-
if (
|
|
18262
|
+
if (ts78.isIdentifier(callExpr.expression)) {
|
|
18303
18263
|
identifier = callExpr.expression;
|
|
18304
18264
|
} else {
|
|
18305
18265
|
return false;
|
|
@@ -18307,7 +18267,7 @@ function isComponentDecorator(node, typeChecker) {
|
|
|
18307
18267
|
return isComponentSymbol(identifier, typeChecker);
|
|
18308
18268
|
}
|
|
18309
18269
|
function isComponentSymbol(identifier, typeChecker) {
|
|
18310
|
-
if (!
|
|
18270
|
+
if (!ts78.isIdentifier(identifier))
|
|
18311
18271
|
return false;
|
|
18312
18272
|
const symbol = typeChecker.getSymbolAtLocation(identifier);
|
|
18313
18273
|
if (!symbol || !symbol.declarations || !symbol.declarations.length) {
|
|
@@ -18315,7 +18275,7 @@ function isComponentSymbol(identifier, typeChecker) {
|
|
|
18315
18275
|
return false;
|
|
18316
18276
|
}
|
|
18317
18277
|
const declaration = symbol.declarations[0];
|
|
18318
|
-
if (!declaration || !
|
|
18278
|
+
if (!declaration || !ts78.isImportSpecifier(declaration)) {
|
|
18319
18279
|
return false;
|
|
18320
18280
|
}
|
|
18321
18281
|
const name = (declaration.propertyName || declaration.name).text;
|
|
@@ -18327,69 +18287,69 @@ function updateComponentProperties(args, loader) {
|
|
|
18327
18287
|
return args;
|
|
18328
18288
|
}
|
|
18329
18289
|
const componentArg = args[0];
|
|
18330
|
-
if (!
|
|
18290
|
+
if (!ts78.isObjectLiteralExpression(componentArg)) {
|
|
18331
18291
|
return args;
|
|
18332
18292
|
}
|
|
18333
18293
|
const newProperties = [];
|
|
18334
18294
|
const newStyleExprs = [];
|
|
18335
18295
|
componentArg.properties.forEach((prop) => {
|
|
18336
|
-
if (!
|
|
18296
|
+
if (!ts78.isPropertyAssignment(prop) || ts78.isComputedPropertyName(prop.name)) {
|
|
18337
18297
|
newProperties.push(prop);
|
|
18338
18298
|
return;
|
|
18339
18299
|
}
|
|
18340
18300
|
switch (prop.name.text) {
|
|
18341
18301
|
case "styles":
|
|
18342
|
-
if (!
|
|
18302
|
+
if (!ts78.isArrayLiteralExpression(prop.initializer)) {
|
|
18343
18303
|
throw new Error("styles takes an array argument");
|
|
18344
18304
|
}
|
|
18345
18305
|
newStyleExprs.push(...prop.initializer.elements);
|
|
18346
18306
|
break;
|
|
18347
18307
|
case "styleUrls":
|
|
18348
|
-
if (!
|
|
18308
|
+
if (!ts78.isArrayLiteralExpression(prop.initializer)) {
|
|
18349
18309
|
throw new Error("styleUrls takes an array argument");
|
|
18350
18310
|
}
|
|
18351
18311
|
newStyleExprs.push(...prop.initializer.elements.map((expr) => {
|
|
18352
|
-
if (!
|
|
18312
|
+
if (!ts78.isStringLiteral(expr) && !ts78.isNoSubstitutionTemplateLiteral(expr)) {
|
|
18353
18313
|
throw new Error("Can only accept string literal arguments to styleUrls. " + PRECONDITIONS_TEXT);
|
|
18354
18314
|
}
|
|
18355
18315
|
const styles = loader.get(expr.text);
|
|
18356
|
-
return
|
|
18316
|
+
return ts78.createLiteral(styles);
|
|
18357
18317
|
}));
|
|
18358
18318
|
break;
|
|
18359
18319
|
case "templateUrl":
|
|
18360
|
-
if (!
|
|
18320
|
+
if (!ts78.isStringLiteral(prop.initializer) && !ts78.isNoSubstitutionTemplateLiteral(prop.initializer)) {
|
|
18361
18321
|
throw new Error("Can only accept a string literal argument to templateUrl. " + PRECONDITIONS_TEXT);
|
|
18362
18322
|
}
|
|
18363
18323
|
const template = loader.get(prop.initializer.text);
|
|
18364
|
-
newProperties.push(
|
|
18324
|
+
newProperties.push(ts78.updatePropertyAssignment(prop, ts78.createIdentifier("template"), ts78.createLiteral(template)));
|
|
18365
18325
|
break;
|
|
18366
18326
|
default:
|
|
18367
18327
|
newProperties.push(prop);
|
|
18368
18328
|
}
|
|
18369
18329
|
});
|
|
18370
18330
|
if (newStyleExprs.length > 0) {
|
|
18371
|
-
const newStyles =
|
|
18331
|
+
const newStyles = ts78.createPropertyAssignment(ts78.createIdentifier("styles"), ts78.createArrayLiteral(newStyleExprs));
|
|
18372
18332
|
newProperties.push(newStyles);
|
|
18373
18333
|
}
|
|
18374
|
-
return
|
|
18334
|
+
return ts78.createNodeArray([ts78.updateObjectLiteral(componentArg, newProperties)]);
|
|
18375
18335
|
}
|
|
18376
18336
|
|
|
18377
|
-
// bazel-out/
|
|
18337
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/lower_expressions.mjs
|
|
18378
18338
|
import { createLoweredSymbol, isLoweredSymbol } from "@angular/compiler";
|
|
18379
|
-
import
|
|
18339
|
+
import ts79 from "typescript";
|
|
18380
18340
|
function toMap(items, select) {
|
|
18381
18341
|
return new Map(items.map((i) => [select(i), i]));
|
|
18382
18342
|
}
|
|
18383
18343
|
function isLexicalScope(node) {
|
|
18384
18344
|
switch (node.kind) {
|
|
18385
|
-
case
|
|
18386
|
-
case
|
|
18387
|
-
case
|
|
18388
|
-
case
|
|
18389
|
-
case
|
|
18390
|
-
case
|
|
18391
|
-
case
|
|
18392
|
-
case
|
|
18345
|
+
case ts79.SyntaxKind.ArrowFunction:
|
|
18346
|
+
case ts79.SyntaxKind.FunctionExpression:
|
|
18347
|
+
case ts79.SyntaxKind.FunctionDeclaration:
|
|
18348
|
+
case ts79.SyntaxKind.ClassExpression:
|
|
18349
|
+
case ts79.SyntaxKind.ClassDeclaration:
|
|
18350
|
+
case ts79.SyntaxKind.FunctionType:
|
|
18351
|
+
case ts79.SyntaxKind.TypeLiteral:
|
|
18352
|
+
case ts79.SyntaxKind.ArrayType:
|
|
18393
18353
|
return true;
|
|
18394
18354
|
}
|
|
18395
18355
|
return false;
|
|
@@ -18406,17 +18366,17 @@ function transformSourceFile(sourceFile, requests, context) {
|
|
|
18406
18366
|
function topLevelStatement(node) {
|
|
18407
18367
|
const declarations = [];
|
|
18408
18368
|
function visitNode(node2) {
|
|
18409
|
-
const { pos: pos2, end: end2, kind, parent: originalParent } =
|
|
18369
|
+
const { pos: pos2, end: end2, kind, parent: originalParent } = ts79.getOriginalNode(node2);
|
|
18410
18370
|
const nodeRequest = requests.get(pos2);
|
|
18411
18371
|
if (nodeRequest && nodeRequest.kind == kind && nodeRequest.end == end2) {
|
|
18412
|
-
if (originalParent && originalParent.kind ===
|
|
18372
|
+
if (originalParent && originalParent.kind === ts79.SyntaxKind.VariableDeclaration) {
|
|
18413
18373
|
const varParent = originalParent;
|
|
18414
|
-
if (varParent.name.kind ===
|
|
18374
|
+
if (varParent.name.kind === ts79.SyntaxKind.Identifier) {
|
|
18415
18375
|
const varName = varParent.name.text;
|
|
18416
18376
|
const exportName2 = nodeRequest.name;
|
|
18417
18377
|
declarations.push({
|
|
18418
18378
|
name: exportName2,
|
|
18419
|
-
node:
|
|
18379
|
+
node: ts79.createIdentifier(varName),
|
|
18420
18380
|
order: 1
|
|
18421
18381
|
});
|
|
18422
18382
|
return node2;
|
|
@@ -18424,18 +18384,18 @@ function transformSourceFile(sourceFile, requests, context) {
|
|
|
18424
18384
|
}
|
|
18425
18385
|
const exportName = nodeRequest.name;
|
|
18426
18386
|
declarations.push({ name: exportName, node: node2, order: 0 });
|
|
18427
|
-
return
|
|
18387
|
+
return ts79.createIdentifier(exportName);
|
|
18428
18388
|
}
|
|
18429
18389
|
let result = node2;
|
|
18430
18390
|
if (shouldVisit(pos2, end2) && !isLexicalScope(node2)) {
|
|
18431
|
-
result =
|
|
18391
|
+
result = ts79.visitEachChild(node2, visitNode, context);
|
|
18432
18392
|
}
|
|
18433
18393
|
return result;
|
|
18434
18394
|
}
|
|
18435
|
-
const { pos, end } =
|
|
18395
|
+
const { pos, end } = ts79.getOriginalNode(node);
|
|
18436
18396
|
let resultStmt;
|
|
18437
18397
|
if (shouldVisit(pos, end)) {
|
|
18438
|
-
resultStmt =
|
|
18398
|
+
resultStmt = ts79.visitEachChild(node, visitNode, context);
|
|
18439
18399
|
} else {
|
|
18440
18400
|
resultStmt = node;
|
|
18441
18401
|
}
|
|
@@ -18464,20 +18424,20 @@ function transformSourceFile(sourceFile, requests, context) {
|
|
|
18464
18424
|
tmpStatements.push(statement);
|
|
18465
18425
|
}
|
|
18466
18426
|
});
|
|
18467
|
-
tmpStatements.push(
|
|
18427
|
+
tmpStatements.push(ts79.createExportDeclaration(void 0, void 0, ts79.createNamedExports(inserts.reduce((accumulator, insert) => [...accumulator, ...insert.declarations], []).map((declaration) => ts79.createExportSpecifier(void 0, declaration.name)))));
|
|
18468
18428
|
newStatements = tmpStatements;
|
|
18469
18429
|
}
|
|
18470
|
-
const newSf =
|
|
18471
|
-
if (!(sourceFile2.flags &
|
|
18472
|
-
newSf.flags &= ~
|
|
18430
|
+
const newSf = ts79.updateSourceFileNode(sourceFile2, ts79.setTextRange(ts79.createNodeArray(newStatements), sourceFile2.statements));
|
|
18431
|
+
if (!(sourceFile2.flags & ts79.NodeFlags.Synthesized)) {
|
|
18432
|
+
newSf.flags &= ~ts79.NodeFlags.Synthesized;
|
|
18473
18433
|
}
|
|
18474
18434
|
return newSf;
|
|
18475
18435
|
}
|
|
18476
18436
|
return visitSourceFile(sourceFile);
|
|
18477
18437
|
}
|
|
18478
18438
|
function createVariableStatementForDeclarations(declarations) {
|
|
18479
|
-
const varDecls = declarations.map((i) =>
|
|
18480
|
-
return
|
|
18439
|
+
const varDecls = declarations.map((i) => ts79.createVariableDeclaration(i.name, void 0, i.node));
|
|
18440
|
+
return ts79.createVariableStatement(void 0, ts79.createVariableDeclarationList(varDecls, ts79.NodeFlags.Const));
|
|
18481
18441
|
}
|
|
18482
18442
|
function getExpressionLoweringTransformFactory(requestsMap, program) {
|
|
18483
18443
|
return (context) => (sourceFile) => {
|
|
@@ -18494,18 +18454,18 @@ function getExpressionLoweringTransformFactory(requestsMap, program) {
|
|
|
18494
18454
|
function isEligibleForLowering(node) {
|
|
18495
18455
|
if (node) {
|
|
18496
18456
|
switch (node.kind) {
|
|
18497
|
-
case
|
|
18498
|
-
case
|
|
18457
|
+
case ts79.SyntaxKind.SourceFile:
|
|
18458
|
+
case ts79.SyntaxKind.Decorator:
|
|
18499
18459
|
return true;
|
|
18500
|
-
case
|
|
18501
|
-
case
|
|
18502
|
-
case
|
|
18503
|
-
case
|
|
18460
|
+
case ts79.SyntaxKind.ClassDeclaration:
|
|
18461
|
+
case ts79.SyntaxKind.InterfaceDeclaration:
|
|
18462
|
+
case ts79.SyntaxKind.EnumDeclaration:
|
|
18463
|
+
case ts79.SyntaxKind.FunctionDeclaration:
|
|
18504
18464
|
return false;
|
|
18505
|
-
case
|
|
18506
|
-
const isExported3 = (
|
|
18465
|
+
case ts79.SyntaxKind.VariableDeclaration:
|
|
18466
|
+
const isExported3 = (ts79.getCombinedModifierFlags(node) & ts79.ModifierFlags.Export) == 0;
|
|
18507
18467
|
const varNode = node;
|
|
18508
|
-
return isExported3 || varNode.initializer !== void 0 && (
|
|
18468
|
+
return isExported3 || varNode.initializer !== void 0 && (ts79.isObjectLiteralExpression(varNode.initializer) || ts79.isArrayLiteralExpression(varNode.initializer) || ts79.isCallExpression(varNode.initializer));
|
|
18509
18469
|
}
|
|
18510
18470
|
return isEligibleForLowering(node.parent);
|
|
18511
18471
|
}
|
|
@@ -18518,9 +18478,9 @@ function isRewritten(value) {
|
|
|
18518
18478
|
return isMetadataGlobalReferenceExpression(value) && isLoweredSymbol(value.name);
|
|
18519
18479
|
}
|
|
18520
18480
|
function isLiteralFieldNamed(node, names) {
|
|
18521
|
-
if (node.parent && node.parent.kind ==
|
|
18481
|
+
if (node.parent && node.parent.kind == ts79.SyntaxKind.PropertyAssignment) {
|
|
18522
18482
|
const property = node.parent;
|
|
18523
|
-
if (property.parent && property.parent.kind ==
|
|
18483
|
+
if (property.parent && property.parent.kind == ts79.SyntaxKind.ObjectLiteralExpression && property.name && property.name.kind == ts79.SyntaxKind.Identifier) {
|
|
18524
18484
|
const propertyName = property.name;
|
|
18525
18485
|
return names.has(propertyName.text);
|
|
18526
18486
|
}
|
|
@@ -18556,7 +18516,7 @@ var LowerMetadataTransform = class {
|
|
|
18556
18516
|
const isExportedSymbol = (() => {
|
|
18557
18517
|
let exportTable;
|
|
18558
18518
|
return (node) => {
|
|
18559
|
-
if (node.kind ==
|
|
18519
|
+
if (node.kind == ts79.SyntaxKind.Identifier) {
|
|
18560
18520
|
const ident = node;
|
|
18561
18521
|
if (!exportTable) {
|
|
18562
18522
|
exportTable = createExportTableFor(sourceFile);
|
|
@@ -18567,7 +18527,7 @@ var LowerMetadataTransform = class {
|
|
|
18567
18527
|
};
|
|
18568
18528
|
})();
|
|
18569
18529
|
const isExportedPropertyAccess = (node) => {
|
|
18570
|
-
if (node.kind ===
|
|
18530
|
+
if (node.kind === ts79.SyntaxKind.PropertyAccessExpression) {
|
|
18571
18531
|
const pae = node;
|
|
18572
18532
|
if (isExportedSymbol(pae.expression)) {
|
|
18573
18533
|
return true;
|
|
@@ -18581,7 +18541,7 @@ var LowerMetadataTransform = class {
|
|
|
18581
18541
|
return false;
|
|
18582
18542
|
}
|
|
18583
18543
|
let lowerable = false;
|
|
18584
|
-
if ((node.kind ===
|
|
18544
|
+
if ((node.kind === ts79.SyntaxKind.ArrowFunction || node.kind === ts79.SyntaxKind.FunctionExpression) && isEligibleForLowering(node)) {
|
|
18585
18545
|
lowerable = true;
|
|
18586
18546
|
} else if (isLiteralFieldNamed(node, this.lowerableFieldNames) && isEligibleForLowering(node) && !isExportedSymbol(node) && !isExportedPropertyAccess(node)) {
|
|
18587
18547
|
lowerable = true;
|
|
@@ -18613,35 +18573,35 @@ var LowerMetadataTransform = class {
|
|
|
18613
18573
|
};
|
|
18614
18574
|
function createExportTableFor(sourceFile) {
|
|
18615
18575
|
const exportTable = new Set();
|
|
18616
|
-
|
|
18576
|
+
ts79.forEachChild(sourceFile, function scan(node) {
|
|
18617
18577
|
switch (node.kind) {
|
|
18618
|
-
case
|
|
18619
|
-
case
|
|
18620
|
-
case
|
|
18621
|
-
if ((
|
|
18578
|
+
case ts79.SyntaxKind.ClassDeclaration:
|
|
18579
|
+
case ts79.SyntaxKind.FunctionDeclaration:
|
|
18580
|
+
case ts79.SyntaxKind.InterfaceDeclaration:
|
|
18581
|
+
if ((ts79.getCombinedModifierFlags(node) & ts79.ModifierFlags.Export) != 0) {
|
|
18622
18582
|
const classDeclaration = node;
|
|
18623
18583
|
const name = classDeclaration.name;
|
|
18624
18584
|
if (name)
|
|
18625
18585
|
exportTable.add(name.text);
|
|
18626
18586
|
}
|
|
18627
18587
|
break;
|
|
18628
|
-
case
|
|
18588
|
+
case ts79.SyntaxKind.VariableStatement:
|
|
18629
18589
|
const variableStatement = node;
|
|
18630
18590
|
for (const declaration of variableStatement.declarationList.declarations) {
|
|
18631
18591
|
scan(declaration);
|
|
18632
18592
|
}
|
|
18633
18593
|
break;
|
|
18634
|
-
case
|
|
18594
|
+
case ts79.SyntaxKind.VariableDeclaration:
|
|
18635
18595
|
const variableDeclaration = node;
|
|
18636
|
-
if ((
|
|
18596
|
+
if ((ts79.getCombinedModifierFlags(variableDeclaration) & ts79.ModifierFlags.Export) != 0 && variableDeclaration.name.kind == ts79.SyntaxKind.Identifier) {
|
|
18637
18597
|
const name = variableDeclaration.name;
|
|
18638
18598
|
exportTable.add(name.text);
|
|
18639
18599
|
}
|
|
18640
18600
|
break;
|
|
18641
|
-
case
|
|
18601
|
+
case ts79.SyntaxKind.ExportDeclaration:
|
|
18642
18602
|
const exportDeclaration = node;
|
|
18643
18603
|
const { moduleSpecifier, exportClause } = exportDeclaration;
|
|
18644
|
-
if (!moduleSpecifier && exportClause &&
|
|
18604
|
+
if (!moduleSpecifier && exportClause && ts79.isNamedExports(exportClause)) {
|
|
18645
18605
|
exportClause.elements.forEach((spec) => {
|
|
18646
18606
|
exportTable.add(spec.name.text);
|
|
18647
18607
|
});
|
|
@@ -18651,8 +18611,8 @@ function createExportTableFor(sourceFile) {
|
|
|
18651
18611
|
return exportTable;
|
|
18652
18612
|
}
|
|
18653
18613
|
|
|
18654
|
-
// bazel-out/
|
|
18655
|
-
import
|
|
18614
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/metadata_cache.mjs
|
|
18615
|
+
import ts80 from "typescript";
|
|
18656
18616
|
var MetadataCache = class {
|
|
18657
18617
|
constructor(collector, strict, transformers) {
|
|
18658
18618
|
this.collector = collector;
|
|
@@ -18671,7 +18631,7 @@ var MetadataCache = class {
|
|
|
18671
18631
|
}
|
|
18672
18632
|
let substitute = void 0;
|
|
18673
18633
|
const declarationFile = sourceFile.isDeclarationFile;
|
|
18674
|
-
const moduleFile =
|
|
18634
|
+
const moduleFile = ts80.isExternalModule(sourceFile);
|
|
18675
18635
|
if (!declarationFile && moduleFile) {
|
|
18676
18636
|
for (let transform of this.transformers) {
|
|
18677
18637
|
const transformSubstitute = transform.start(sourceFile);
|
|
@@ -18692,12 +18652,12 @@ var MetadataCache = class {
|
|
|
18692
18652
|
}
|
|
18693
18653
|
};
|
|
18694
18654
|
|
|
18695
|
-
// bazel-out/
|
|
18696
|
-
import
|
|
18655
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/node_emitter_transform.mjs
|
|
18656
|
+
import ts82 from "typescript";
|
|
18697
18657
|
|
|
18698
|
-
// bazel-out/
|
|
18658
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/node_emitter.mjs
|
|
18699
18659
|
import { BinaryOperator as BinaryOperator2, BuiltinMethod, BuiltinVar, ClassStmt, ExternalExpr as ExternalExpr10, Statement, StmtModifier as StmtModifier2, UnaryOperator as UnaryOperator2 } from "@angular/compiler";
|
|
18700
|
-
import
|
|
18660
|
+
import ts81 from "typescript";
|
|
18701
18661
|
var METHOD_THIS_NAME = "this";
|
|
18702
18662
|
var CATCH_ERROR_NAME = "error";
|
|
18703
18663
|
var CATCH_STACK_NAME = "stack";
|
|
@@ -18711,12 +18671,12 @@ var TypeScriptNodeEmitter = class {
|
|
|
18711
18671
|
const statements = [].concat(...stmts.map((stmt) => stmt.visitStatement(converter, null)).filter((stmt) => stmt != null));
|
|
18712
18672
|
const sourceStatements = [...converter.getReexports(), ...converter.getImports(), ...statements];
|
|
18713
18673
|
if (preamble) {
|
|
18714
|
-
const preambleCommentHolder =
|
|
18715
|
-
|
|
18674
|
+
const preambleCommentHolder = ts81.createNotEmittedStatement(sourceFile);
|
|
18675
|
+
ts81.addSyntheticLeadingComment(preambleCommentHolder, ts81.SyntaxKind.MultiLineCommentTrivia, preamble, true);
|
|
18716
18676
|
sourceStatements.unshift(preambleCommentHolder);
|
|
18717
18677
|
}
|
|
18718
18678
|
converter.updateSourceMap(sourceStatements);
|
|
18719
|
-
const newSourceFile =
|
|
18679
|
+
const newSourceFile = ts81.updateSourceFileNode(sourceFile, sourceStatements);
|
|
18720
18680
|
return [newSourceFile, converter.getNodeMap()];
|
|
18721
18681
|
}
|
|
18722
18682
|
};
|
|
@@ -18729,7 +18689,7 @@ function updateSourceFile(sourceFile, module2, annotateForClosureCompiler) {
|
|
|
18729
18689
|
const classNames = new Set(classes.map((classStatement) => classStatement.name));
|
|
18730
18690
|
const prefix = prefixStatements.map((statement) => statement.visitStatement(converter, sourceFile));
|
|
18731
18691
|
let newStatements = sourceFile.statements.map((node) => {
|
|
18732
|
-
if (node.kind ==
|
|
18692
|
+
if (node.kind == ts81.SyntaxKind.ClassDeclaration) {
|
|
18733
18693
|
const classDeclaration = node;
|
|
18734
18694
|
const name = classDeclaration.name;
|
|
18735
18695
|
if (name) {
|
|
@@ -18737,9 +18697,9 @@ function updateSourceFile(sourceFile, module2, annotateForClosureCompiler) {
|
|
|
18737
18697
|
if (classStatement) {
|
|
18738
18698
|
classNames.delete(name.text);
|
|
18739
18699
|
const classMemberHolder = converter.visitDeclareClassStmt(classStatement);
|
|
18740
|
-
const newMethods = classMemberHolder.members.filter((member) => member.kind !==
|
|
18700
|
+
const newMethods = classMemberHolder.members.filter((member) => member.kind !== ts81.SyntaxKind.Constructor);
|
|
18741
18701
|
const newMembers = [...classDeclaration.members, ...newMethods];
|
|
18742
|
-
return
|
|
18702
|
+
return ts81.updateClassDeclaration(classDeclaration, classDeclaration.decorators, classDeclaration.modifiers, classDeclaration.name, classDeclaration.typeParameters, classDeclaration.heritageClauses || [], newMembers);
|
|
18743
18703
|
}
|
|
18744
18704
|
}
|
|
18745
18705
|
}
|
|
@@ -18748,13 +18708,13 @@ function updateSourceFile(sourceFile, module2, annotateForClosureCompiler) {
|
|
|
18748
18708
|
classNames.size == 0 || error(`${classNames.size == 1 ? "Class" : "Classes"} "${Array.from(classNames.keys()).join(", ")}" not generated`);
|
|
18749
18709
|
const imports = converter.getImports();
|
|
18750
18710
|
if (imports && imports.length) {
|
|
18751
|
-
const index = firstAfter(newStatements, (statement) => statement.kind ===
|
|
18711
|
+
const index = firstAfter(newStatements, (statement) => statement.kind === ts81.SyntaxKind.ImportDeclaration || statement.kind === ts81.SyntaxKind.ImportEqualsDeclaration);
|
|
18752
18712
|
newStatements = [...newStatements.slice(0, index), ...imports, ...prefix, ...newStatements.slice(index)];
|
|
18753
18713
|
} else {
|
|
18754
18714
|
newStatements = [...prefix, ...newStatements];
|
|
18755
18715
|
}
|
|
18756
18716
|
converter.updateSourceMap(newStatements);
|
|
18757
|
-
const newSourceFile =
|
|
18717
|
+
const newSourceFile = ts81.updateSourceFileNode(sourceFile, newStatements);
|
|
18758
18718
|
return [newSourceFile, converter.getNodeMap()];
|
|
18759
18719
|
}
|
|
18760
18720
|
function firstAfter(a, predicate) {
|
|
@@ -18781,20 +18741,20 @@ function escapeLiteral(value) {
|
|
|
18781
18741
|
}
|
|
18782
18742
|
function createLiteral(value) {
|
|
18783
18743
|
if (value === null) {
|
|
18784
|
-
return
|
|
18744
|
+
return ts81.createNull();
|
|
18785
18745
|
} else if (value === void 0) {
|
|
18786
|
-
return
|
|
18746
|
+
return ts81.createIdentifier("undefined");
|
|
18787
18747
|
} else {
|
|
18788
|
-
const result =
|
|
18789
|
-
if (
|
|
18790
|
-
result.kind =
|
|
18748
|
+
const result = ts81.createLiteral(value);
|
|
18749
|
+
if (ts81.isStringLiteral(result) && result.text.indexOf("\\") >= 0) {
|
|
18750
|
+
result.kind = ts81.SyntaxKind.NumericLiteral;
|
|
18791
18751
|
result.text = `"${escapeLiteral(result.text)}"`;
|
|
18792
18752
|
}
|
|
18793
18753
|
return result;
|
|
18794
18754
|
}
|
|
18795
18755
|
}
|
|
18796
18756
|
function isExportTypeStatement(statement) {
|
|
18797
|
-
return !!statement.modifiers && statement.modifiers.some((mod) => mod.kind ===
|
|
18757
|
+
return !!statement.modifiers && statement.modifiers.some((mod) => mod.kind === ts81.SyntaxKind.ExportKeyword);
|
|
18798
18758
|
}
|
|
18799
18759
|
var NodeEmitterVisitor = class {
|
|
18800
18760
|
constructor(annotateForClosureCompiler) {
|
|
@@ -18807,9 +18767,9 @@ var NodeEmitterVisitor = class {
|
|
|
18807
18767
|
}
|
|
18808
18768
|
loadExportedVariableIdentifiers(sourceFile) {
|
|
18809
18769
|
sourceFile.statements.forEach((statement) => {
|
|
18810
|
-
if (
|
|
18770
|
+
if (ts81.isVariableStatement(statement) && isExportTypeStatement(statement)) {
|
|
18811
18771
|
statement.declarationList.declarations.forEach((declaration) => {
|
|
18812
|
-
if (
|
|
18772
|
+
if (ts81.isIdentifier(declaration.name)) {
|
|
18813
18773
|
this._exportedVariableIdentifiers.set(declaration.name.text, declaration.name);
|
|
18814
18774
|
}
|
|
18815
18775
|
});
|
|
@@ -18817,10 +18777,10 @@ var NodeEmitterVisitor = class {
|
|
|
18817
18777
|
});
|
|
18818
18778
|
}
|
|
18819
18779
|
getReexports() {
|
|
18820
|
-
return Array.from(this._reexports.entries()).map(([exportedFilePath, reexports]) =>
|
|
18780
|
+
return Array.from(this._reexports.entries()).map(([exportedFilePath, reexports]) => ts81.createExportDeclaration(void 0, void 0, ts81.createNamedExports(reexports.map(({ name, as }) => ts81.createExportSpecifier(name, as))), createLiteral(exportedFilePath)));
|
|
18821
18781
|
}
|
|
18822
18782
|
getImports() {
|
|
18823
|
-
return Array.from(this._importsWithPrefixes.entries()).map(([namespace, prefix]) =>
|
|
18783
|
+
return Array.from(this._importsWithPrefixes.entries()).map(([namespace, prefix]) => ts81.createImportDeclaration(void 0, void 0, ts81.createImportClause(void 0, ts81.createNamespaceImport(ts81.createIdentifier(prefix))), createLiteral(namespace)));
|
|
18824
18784
|
}
|
|
18825
18785
|
getNodeMap() {
|
|
18826
18786
|
return this._nodeMap;
|
|
@@ -18832,12 +18792,12 @@ var NodeEmitterVisitor = class {
|
|
|
18832
18792
|
const recordLastSourceRange = () => {
|
|
18833
18793
|
if (lastRange && lastRangeStartNode && lastRangeEndNode) {
|
|
18834
18794
|
if (lastRangeStartNode == lastRangeEndNode) {
|
|
18835
|
-
|
|
18795
|
+
ts81.setSourceMapRange(lastRangeEndNode, lastRange);
|
|
18836
18796
|
} else {
|
|
18837
|
-
|
|
18838
|
-
|
|
18839
|
-
|
|
18840
|
-
|
|
18797
|
+
ts81.setSourceMapRange(lastRangeStartNode, lastRange);
|
|
18798
|
+
ts81.setEmitFlags(lastRangeStartNode, ts81.EmitFlags.NoTrailingSourceMap);
|
|
18799
|
+
ts81.setSourceMapRange(lastRangeEndNode, lastRange);
|
|
18800
|
+
ts81.setEmitFlags(lastRangeEndNode, ts81.EmitFlags.NoLeadingSourceMap);
|
|
18841
18801
|
}
|
|
18842
18802
|
}
|
|
18843
18803
|
};
|
|
@@ -18854,7 +18814,7 @@ var NodeEmitterVisitor = class {
|
|
|
18854
18814
|
lastRangeEndNode = tsNode;
|
|
18855
18815
|
}
|
|
18856
18816
|
}
|
|
18857
|
-
|
|
18817
|
+
ts81.forEachChild(tsNode, visitNode);
|
|
18858
18818
|
};
|
|
18859
18819
|
statements.forEach(visitNode);
|
|
18860
18820
|
recordLastSourceRange();
|
|
@@ -18876,7 +18836,7 @@ var NodeEmitterVisitor = class {
|
|
|
18876
18836
|
if (file.url) {
|
|
18877
18837
|
let source = this._templateSources.get(file);
|
|
18878
18838
|
if (!source) {
|
|
18879
|
-
source =
|
|
18839
|
+
source = ts81.createSourceMapSource(file.url, file.content, (pos) => pos);
|
|
18880
18840
|
this._templateSources.set(file, source);
|
|
18881
18841
|
}
|
|
18882
18842
|
return { pos: span.start.offset, end: span.end.offset, source };
|
|
@@ -18888,7 +18848,7 @@ var NodeEmitterVisitor = class {
|
|
|
18888
18848
|
getModifiers(stmt) {
|
|
18889
18849
|
let modifiers = [];
|
|
18890
18850
|
if (stmt.hasModifier(StmtModifier2.Exported)) {
|
|
18891
|
-
modifiers.push(
|
|
18851
|
+
modifiers.push(ts81.createToken(ts81.SyntaxKind.ExportKeyword));
|
|
18892
18852
|
}
|
|
18893
18853
|
return modifiers;
|
|
18894
18854
|
}
|
|
@@ -18905,86 +18865,86 @@ var NodeEmitterVisitor = class {
|
|
|
18905
18865
|
return null;
|
|
18906
18866
|
}
|
|
18907
18867
|
}
|
|
18908
|
-
const varDeclList =
|
|
18868
|
+
const varDeclList = ts81.createVariableDeclarationList([ts81.createVariableDeclaration(ts81.createIdentifier(stmt.name), void 0, stmt.value && stmt.value.visitExpression(this, null) || void 0)]);
|
|
18909
18869
|
if (stmt.hasModifier(StmtModifier2.Exported)) {
|
|
18910
|
-
const tsVarStmt = this.postProcess(stmt,
|
|
18911
|
-
const exportStmt = this.postProcess(stmt,
|
|
18870
|
+
const tsVarStmt = this.postProcess(stmt, ts81.createVariableStatement([], varDeclList));
|
|
18871
|
+
const exportStmt = this.postProcess(stmt, ts81.createExportDeclaration(void 0, void 0, ts81.createNamedExports([ts81.createExportSpecifier(stmt.name, stmt.name)])));
|
|
18912
18872
|
return [tsVarStmt, exportStmt];
|
|
18913
18873
|
}
|
|
18914
|
-
return this.postProcess(stmt,
|
|
18874
|
+
return this.postProcess(stmt, ts81.createVariableStatement(this.getModifiers(stmt), varDeclList));
|
|
18915
18875
|
}
|
|
18916
18876
|
visitDeclareFunctionStmt(stmt) {
|
|
18917
|
-
return this.postProcess(stmt,
|
|
18877
|
+
return this.postProcess(stmt, ts81.createFunctionDeclaration(void 0, this.getModifiers(stmt), void 0, stmt.name, void 0, stmt.params.map((p2) => ts81.createParameter(void 0, void 0, void 0, p2.name)), void 0, this._visitStatements(stmt.statements)));
|
|
18918
18878
|
}
|
|
18919
18879
|
visitExpressionStmt(stmt) {
|
|
18920
|
-
return this.postProcess(stmt,
|
|
18880
|
+
return this.postProcess(stmt, ts81.createStatement(stmt.expr.visitExpression(this, null)));
|
|
18921
18881
|
}
|
|
18922
18882
|
visitReturnStmt(stmt) {
|
|
18923
|
-
return this.postProcess(stmt,
|
|
18883
|
+
return this.postProcess(stmt, ts81.createReturn(stmt.value ? stmt.value.visitExpression(this, null) : void 0));
|
|
18924
18884
|
}
|
|
18925
18885
|
visitDeclareClassStmt(stmt) {
|
|
18926
18886
|
const modifiers = this.getModifiers(stmt);
|
|
18927
18887
|
const fields = stmt.fields.map((field) => {
|
|
18928
|
-
const property =
|
|
18888
|
+
const property = ts81.createProperty(void 0, translateModifiers(field.modifiers), field.name, void 0, void 0, field.initializer == null ? ts81.createNull() : field.initializer.visitExpression(this, null));
|
|
18929
18889
|
if (this.annotateForClosureCompiler) {
|
|
18930
|
-
|
|
18890
|
+
ts81.addSyntheticLeadingComment(property, ts81.SyntaxKind.MultiLineCommentTrivia, "* @nocollapse ", false);
|
|
18931
18891
|
}
|
|
18932
18892
|
return property;
|
|
18933
18893
|
});
|
|
18934
|
-
const getters = stmt.getters.map((getter) =>
|
|
18935
|
-
const constructor = stmt.constructorMethod && [
|
|
18936
|
-
const methods = stmt.methods.filter((method) => method.name).map((method) =>
|
|
18937
|
-
return this.postProcess(stmt,
|
|
18894
|
+
const getters = stmt.getters.map((getter) => ts81.createGetAccessor(void 0, void 0, getter.name, [], void 0, this._visitStatements(getter.body)));
|
|
18895
|
+
const constructor = stmt.constructorMethod && [ts81.createConstructor(void 0, void 0, stmt.constructorMethod.params.map((p2) => ts81.createParameter(void 0, void 0, void 0, p2.name)), this._visitStatements(stmt.constructorMethod.body))] || [];
|
|
18896
|
+
const methods = stmt.methods.filter((method) => method.name).map((method) => ts81.createMethod(void 0, translateModifiers(method.modifiers), void 0, method.name, void 0, void 0, method.params.map((p2) => ts81.createParameter(void 0, void 0, void 0, p2.name)), void 0, this._visitStatements(method.body)));
|
|
18897
|
+
return this.postProcess(stmt, ts81.createClassDeclaration(void 0, modifiers, stmt.name, void 0, stmt.parent && [ts81.createHeritageClause(ts81.SyntaxKind.ExtendsKeyword, [stmt.parent.visitExpression(this, null)])] || [], [...fields, ...getters, ...constructor, ...methods]));
|
|
18938
18898
|
}
|
|
18939
18899
|
visitIfStmt(stmt) {
|
|
18940
|
-
return this.postProcess(stmt,
|
|
18900
|
+
return this.postProcess(stmt, ts81.createIf(stmt.condition.visitExpression(this, null), this._visitStatements(stmt.trueCase), stmt.falseCase && stmt.falseCase.length && this._visitStatements(stmt.falseCase) || void 0));
|
|
18941
18901
|
}
|
|
18942
18902
|
visitTryCatchStmt(stmt) {
|
|
18943
|
-
return this.postProcess(stmt,
|
|
18903
|
+
return this.postProcess(stmt, ts81.createTry(this._visitStatements(stmt.bodyStmts), ts81.createCatchClause(CATCH_ERROR_NAME, this._visitStatementsPrefix([ts81.createVariableStatement(void 0, [ts81.createVariableDeclaration(CATCH_STACK_NAME, void 0, ts81.createPropertyAccess(ts81.createIdentifier(CATCH_ERROR_NAME), ts81.createIdentifier(CATCH_STACK_NAME)))])], stmt.catchStmts)), void 0));
|
|
18944
18904
|
}
|
|
18945
18905
|
visitThrowStmt(stmt) {
|
|
18946
|
-
return this.postProcess(stmt,
|
|
18906
|
+
return this.postProcess(stmt, ts81.createThrow(stmt.error.visitExpression(this, null)));
|
|
18947
18907
|
}
|
|
18948
18908
|
visitWrappedNodeExpr(expr) {
|
|
18949
18909
|
return this.postProcess(expr, expr.node);
|
|
18950
18910
|
}
|
|
18951
18911
|
visitTypeofExpr(expr) {
|
|
18952
|
-
const typeOf =
|
|
18912
|
+
const typeOf = ts81.createTypeOf(expr.expr.visitExpression(this, null));
|
|
18953
18913
|
return this.postProcess(expr, typeOf);
|
|
18954
18914
|
}
|
|
18955
18915
|
visitReadVarExpr(expr) {
|
|
18956
18916
|
switch (expr.builtin) {
|
|
18957
18917
|
case BuiltinVar.This:
|
|
18958
|
-
return this.postProcess(expr,
|
|
18918
|
+
return this.postProcess(expr, ts81.createIdentifier(METHOD_THIS_NAME));
|
|
18959
18919
|
case BuiltinVar.CatchError:
|
|
18960
|
-
return this.postProcess(expr,
|
|
18920
|
+
return this.postProcess(expr, ts81.createIdentifier(CATCH_ERROR_NAME));
|
|
18961
18921
|
case BuiltinVar.CatchStack:
|
|
18962
|
-
return this.postProcess(expr,
|
|
18922
|
+
return this.postProcess(expr, ts81.createIdentifier(CATCH_STACK_NAME));
|
|
18963
18923
|
case BuiltinVar.Super:
|
|
18964
|
-
return this.postProcess(expr,
|
|
18924
|
+
return this.postProcess(expr, ts81.createSuper());
|
|
18965
18925
|
}
|
|
18966
18926
|
if (expr.name) {
|
|
18967
|
-
return this.postProcess(expr,
|
|
18927
|
+
return this.postProcess(expr, ts81.createIdentifier(expr.name));
|
|
18968
18928
|
}
|
|
18969
18929
|
throw Error(`Unexpected ReadVarExpr form`);
|
|
18970
18930
|
}
|
|
18971
18931
|
visitWriteVarExpr(expr) {
|
|
18972
|
-
return this.postProcess(expr,
|
|
18932
|
+
return this.postProcess(expr, ts81.createAssignment(ts81.createIdentifier(expr.name), expr.value.visitExpression(this, null)));
|
|
18973
18933
|
}
|
|
18974
18934
|
visitWriteKeyExpr(expr) {
|
|
18975
|
-
return this.postProcess(expr,
|
|
18935
|
+
return this.postProcess(expr, ts81.createAssignment(ts81.createElementAccess(expr.receiver.visitExpression(this, null), expr.index.visitExpression(this, null)), expr.value.visitExpression(this, null)));
|
|
18976
18936
|
}
|
|
18977
18937
|
visitWritePropExpr(expr) {
|
|
18978
|
-
return this.postProcess(expr,
|
|
18938
|
+
return this.postProcess(expr, ts81.createAssignment(ts81.createPropertyAccess(expr.receiver.visitExpression(this, null), expr.name), expr.value.visitExpression(this, null)));
|
|
18979
18939
|
}
|
|
18980
18940
|
visitInvokeFunctionExpr(expr) {
|
|
18981
|
-
return this.postProcess(expr,
|
|
18941
|
+
return this.postProcess(expr, ts81.createCall(expr.fn.visitExpression(this, null), void 0, expr.args.map((arg) => arg.visitExpression(this, null))));
|
|
18982
18942
|
}
|
|
18983
18943
|
visitTaggedTemplateExpr(expr) {
|
|
18984
18944
|
throw new Error("tagged templates are not supported in pre-ivy mode.");
|
|
18985
18945
|
}
|
|
18986
18946
|
visitInstantiateExpr(expr) {
|
|
18987
|
-
return this.postProcess(expr,
|
|
18947
|
+
return this.postProcess(expr, ts81.createNew(expr.classExpr.visitExpression(this, null), void 0, expr.args.map((arg) => arg.visitExpression(this, null))));
|
|
18988
18948
|
}
|
|
18989
18949
|
visitLiteralExpr(expr) {
|
|
18990
18950
|
return this.postProcess(expr, createLiteral(expr.value));
|
|
@@ -18996,10 +18956,10 @@ var NodeEmitterVisitor = class {
|
|
|
18996
18956
|
return this.postProcess(expr, this._visitIdentifier(expr.value));
|
|
18997
18957
|
}
|
|
18998
18958
|
visitConditionalExpr(expr) {
|
|
18999
|
-
return this.postProcess(expr,
|
|
18959
|
+
return this.postProcess(expr, ts81.createParen(ts81.createConditional(expr.condition.visitExpression(this, null), expr.trueCase.visitExpression(this, null), expr.falseCase.visitExpression(this, null))));
|
|
19000
18960
|
}
|
|
19001
18961
|
visitNotExpr(expr) {
|
|
19002
|
-
return this.postProcess(expr,
|
|
18962
|
+
return this.postProcess(expr, ts81.createPrefix(ts81.SyntaxKind.ExclamationToken, expr.condition.visitExpression(this, null)));
|
|
19003
18963
|
}
|
|
19004
18964
|
visitAssertNotNullExpr(expr) {
|
|
19005
18965
|
return expr.condition.visitExpression(this, null);
|
|
@@ -19008,103 +18968,103 @@ var NodeEmitterVisitor = class {
|
|
|
19008
18968
|
return expr.value.visitExpression(this, null);
|
|
19009
18969
|
}
|
|
19010
18970
|
visitFunctionExpr(expr) {
|
|
19011
|
-
return this.postProcess(expr,
|
|
18971
|
+
return this.postProcess(expr, ts81.createFunctionExpression(void 0, void 0, expr.name || void 0, void 0, expr.params.map((p2) => ts81.createParameter(void 0, void 0, void 0, p2.name)), void 0, this._visitStatements(expr.statements)));
|
|
19012
18972
|
}
|
|
19013
18973
|
visitUnaryOperatorExpr(expr) {
|
|
19014
18974
|
let unaryOperator;
|
|
19015
18975
|
switch (expr.operator) {
|
|
19016
18976
|
case UnaryOperator2.Minus:
|
|
19017
|
-
unaryOperator =
|
|
18977
|
+
unaryOperator = ts81.SyntaxKind.MinusToken;
|
|
19018
18978
|
break;
|
|
19019
18979
|
case UnaryOperator2.Plus:
|
|
19020
|
-
unaryOperator =
|
|
18980
|
+
unaryOperator = ts81.SyntaxKind.PlusToken;
|
|
19021
18981
|
break;
|
|
19022
18982
|
default:
|
|
19023
18983
|
throw new Error(`Unknown operator: ${expr.operator}`);
|
|
19024
18984
|
}
|
|
19025
|
-
const binary =
|
|
19026
|
-
return this.postProcess(expr, expr.parens ?
|
|
18985
|
+
const binary = ts81.createPrefix(unaryOperator, expr.expr.visitExpression(this, null));
|
|
18986
|
+
return this.postProcess(expr, expr.parens ? ts81.createParen(binary) : binary);
|
|
19027
18987
|
}
|
|
19028
18988
|
visitBinaryOperatorExpr(expr) {
|
|
19029
18989
|
let binaryOperator;
|
|
19030
18990
|
switch (expr.operator) {
|
|
19031
18991
|
case BinaryOperator2.And:
|
|
19032
|
-
binaryOperator =
|
|
18992
|
+
binaryOperator = ts81.SyntaxKind.AmpersandAmpersandToken;
|
|
19033
18993
|
break;
|
|
19034
18994
|
case BinaryOperator2.BitwiseAnd:
|
|
19035
|
-
binaryOperator =
|
|
18995
|
+
binaryOperator = ts81.SyntaxKind.AmpersandToken;
|
|
19036
18996
|
break;
|
|
19037
18997
|
case BinaryOperator2.Bigger:
|
|
19038
|
-
binaryOperator =
|
|
18998
|
+
binaryOperator = ts81.SyntaxKind.GreaterThanToken;
|
|
19039
18999
|
break;
|
|
19040
19000
|
case BinaryOperator2.BiggerEquals:
|
|
19041
|
-
binaryOperator =
|
|
19001
|
+
binaryOperator = ts81.SyntaxKind.GreaterThanEqualsToken;
|
|
19042
19002
|
break;
|
|
19043
19003
|
case BinaryOperator2.Divide:
|
|
19044
|
-
binaryOperator =
|
|
19004
|
+
binaryOperator = ts81.SyntaxKind.SlashToken;
|
|
19045
19005
|
break;
|
|
19046
19006
|
case BinaryOperator2.Equals:
|
|
19047
|
-
binaryOperator =
|
|
19007
|
+
binaryOperator = ts81.SyntaxKind.EqualsEqualsToken;
|
|
19048
19008
|
break;
|
|
19049
19009
|
case BinaryOperator2.Identical:
|
|
19050
|
-
binaryOperator =
|
|
19010
|
+
binaryOperator = ts81.SyntaxKind.EqualsEqualsEqualsToken;
|
|
19051
19011
|
break;
|
|
19052
19012
|
case BinaryOperator2.Lower:
|
|
19053
|
-
binaryOperator =
|
|
19013
|
+
binaryOperator = ts81.SyntaxKind.LessThanToken;
|
|
19054
19014
|
break;
|
|
19055
19015
|
case BinaryOperator2.LowerEquals:
|
|
19056
|
-
binaryOperator =
|
|
19016
|
+
binaryOperator = ts81.SyntaxKind.LessThanEqualsToken;
|
|
19057
19017
|
break;
|
|
19058
19018
|
case BinaryOperator2.Minus:
|
|
19059
|
-
binaryOperator =
|
|
19019
|
+
binaryOperator = ts81.SyntaxKind.MinusToken;
|
|
19060
19020
|
break;
|
|
19061
19021
|
case BinaryOperator2.Modulo:
|
|
19062
|
-
binaryOperator =
|
|
19022
|
+
binaryOperator = ts81.SyntaxKind.PercentToken;
|
|
19063
19023
|
break;
|
|
19064
19024
|
case BinaryOperator2.Multiply:
|
|
19065
|
-
binaryOperator =
|
|
19025
|
+
binaryOperator = ts81.SyntaxKind.AsteriskToken;
|
|
19066
19026
|
break;
|
|
19067
19027
|
case BinaryOperator2.NotEquals:
|
|
19068
|
-
binaryOperator =
|
|
19028
|
+
binaryOperator = ts81.SyntaxKind.ExclamationEqualsToken;
|
|
19069
19029
|
break;
|
|
19070
19030
|
case BinaryOperator2.NotIdentical:
|
|
19071
|
-
binaryOperator =
|
|
19031
|
+
binaryOperator = ts81.SyntaxKind.ExclamationEqualsEqualsToken;
|
|
19072
19032
|
break;
|
|
19073
19033
|
case BinaryOperator2.Or:
|
|
19074
|
-
binaryOperator =
|
|
19034
|
+
binaryOperator = ts81.SyntaxKind.BarBarToken;
|
|
19075
19035
|
break;
|
|
19076
19036
|
case BinaryOperator2.NullishCoalesce:
|
|
19077
|
-
binaryOperator =
|
|
19037
|
+
binaryOperator = ts81.SyntaxKind.QuestionQuestionToken;
|
|
19078
19038
|
break;
|
|
19079
19039
|
case BinaryOperator2.Plus:
|
|
19080
|
-
binaryOperator =
|
|
19040
|
+
binaryOperator = ts81.SyntaxKind.PlusToken;
|
|
19081
19041
|
break;
|
|
19082
19042
|
default:
|
|
19083
19043
|
throw new Error(`Unknown operator: ${expr.operator}`);
|
|
19084
19044
|
}
|
|
19085
|
-
const binary =
|
|
19086
|
-
return this.postProcess(expr, expr.parens ?
|
|
19045
|
+
const binary = ts81.createBinary(expr.lhs.visitExpression(this, null), binaryOperator, expr.rhs.visitExpression(this, null));
|
|
19046
|
+
return this.postProcess(expr, expr.parens ? ts81.createParen(binary) : binary);
|
|
19087
19047
|
}
|
|
19088
19048
|
visitReadPropExpr(expr) {
|
|
19089
|
-
return this.postProcess(expr,
|
|
19049
|
+
return this.postProcess(expr, ts81.createPropertyAccess(expr.receiver.visitExpression(this, null), expr.name));
|
|
19090
19050
|
}
|
|
19091
19051
|
visitReadKeyExpr(expr) {
|
|
19092
|
-
return this.postProcess(expr,
|
|
19052
|
+
return this.postProcess(expr, ts81.createElementAccess(expr.receiver.visitExpression(this, null), expr.index.visitExpression(this, null)));
|
|
19093
19053
|
}
|
|
19094
19054
|
visitLiteralArrayExpr(expr) {
|
|
19095
|
-
return this.postProcess(expr,
|
|
19055
|
+
return this.postProcess(expr, ts81.createArrayLiteral(expr.entries.map((entry) => entry.visitExpression(this, null))));
|
|
19096
19056
|
}
|
|
19097
19057
|
visitLiteralMapExpr(expr) {
|
|
19098
|
-
return this.postProcess(expr,
|
|
19058
|
+
return this.postProcess(expr, ts81.createObjectLiteral(expr.entries.map((entry) => ts81.createPropertyAssignment(entry.quoted || !_VALID_IDENTIFIER_RE.test(entry.key) ? ts81.createLiteral(entry.key) : entry.key, entry.value.visitExpression(this, null)))));
|
|
19099
19059
|
}
|
|
19100
19060
|
visitCommaExpr(expr) {
|
|
19101
|
-
return this.postProcess(expr, expr.parts.map((e) => e.visitExpression(this, null)).reduce((left, right) => left ?
|
|
19061
|
+
return this.postProcess(expr, expr.parts.map((e) => e.visitExpression(this, null)).reduce((left, right) => left ? ts81.createBinary(left, ts81.SyntaxKind.CommaToken, right) : right, null));
|
|
19102
19062
|
}
|
|
19103
19063
|
_visitStatements(statements) {
|
|
19104
19064
|
return this._visitStatementsPrefix([], statements);
|
|
19105
19065
|
}
|
|
19106
19066
|
_visitStatementsPrefix(prefix, statements) {
|
|
19107
|
-
return
|
|
19067
|
+
return ts81.createBlock([
|
|
19108
19068
|
...prefix,
|
|
19109
19069
|
...statements.map((stmt) => stmt.visitStatement(this, null)).filter((f) => f != null)
|
|
19110
19070
|
]);
|
|
@@ -19118,14 +19078,14 @@ var NodeEmitterVisitor = class {
|
|
|
19118
19078
|
prefix = `i${this._importsWithPrefixes.size}`;
|
|
19119
19079
|
this._importsWithPrefixes.set(moduleName, prefix);
|
|
19120
19080
|
}
|
|
19121
|
-
prefixIdent =
|
|
19081
|
+
prefixIdent = ts81.createIdentifier(prefix);
|
|
19122
19082
|
}
|
|
19123
19083
|
if (prefixIdent) {
|
|
19124
|
-
return
|
|
19084
|
+
return ts81.createPropertyAccess(prefixIdent, name);
|
|
19125
19085
|
} else {
|
|
19126
|
-
const id =
|
|
19086
|
+
const id = ts81.createIdentifier(name);
|
|
19127
19087
|
if (this._exportedVariableIdentifiers.has(name)) {
|
|
19128
|
-
|
|
19088
|
+
ts81.setOriginalNode(id, this._exportedVariableIdentifiers.get(name));
|
|
19129
19089
|
}
|
|
19130
19090
|
return id;
|
|
19131
19091
|
}
|
|
@@ -19134,20 +19094,20 @@ var NodeEmitterVisitor = class {
|
|
|
19134
19094
|
function modifierFromModifier(modifier) {
|
|
19135
19095
|
switch (modifier) {
|
|
19136
19096
|
case StmtModifier2.Exported:
|
|
19137
|
-
return
|
|
19097
|
+
return ts81.createToken(ts81.SyntaxKind.ExportKeyword);
|
|
19138
19098
|
case StmtModifier2.Final:
|
|
19139
|
-
return
|
|
19099
|
+
return ts81.createToken(ts81.SyntaxKind.ConstKeyword);
|
|
19140
19100
|
case StmtModifier2.Private:
|
|
19141
|
-
return
|
|
19101
|
+
return ts81.createToken(ts81.SyntaxKind.PrivateKeyword);
|
|
19142
19102
|
case StmtModifier2.Static:
|
|
19143
|
-
return
|
|
19103
|
+
return ts81.createToken(ts81.SyntaxKind.StaticKeyword);
|
|
19144
19104
|
}
|
|
19145
19105
|
}
|
|
19146
19106
|
function translateModifiers(modifiers) {
|
|
19147
19107
|
return modifiers == null ? void 0 : modifiers.map(modifierFromModifier);
|
|
19148
19108
|
}
|
|
19149
19109
|
|
|
19150
|
-
// bazel-out/
|
|
19110
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/node_emitter_transform.mjs
|
|
19151
19111
|
function getPreamble(original) {
|
|
19152
19112
|
return `*
|
|
19153
19113
|
* @fileoverview This file was generated by the Angular template compiler. Do not edit.
|
|
@@ -19170,9 +19130,9 @@ function getAngularEmitterTransformFactory(generatedFiles, program, annotateForC
|
|
|
19170
19130
|
const [newSourceFile] = emitter.updateSourceFile(sourceFile, g.stmts, preamble);
|
|
19171
19131
|
return newSourceFile;
|
|
19172
19132
|
} else if (GENERATED_FILES.test(sourceFile.fileName)) {
|
|
19173
|
-
const commentStmt =
|
|
19174
|
-
|
|
19175
|
-
return
|
|
19133
|
+
const commentStmt = ts82.createNotEmittedStatement(sourceFile);
|
|
19134
|
+
ts82.addSyntheticLeadingComment(commentStmt, ts82.SyntaxKind.MultiLineCommentTrivia, preamble, true);
|
|
19135
|
+
return ts82.updateSourceFileNode(sourceFile, [commentStmt]);
|
|
19176
19136
|
}
|
|
19177
19137
|
return sourceFile;
|
|
19178
19138
|
};
|
|
@@ -19180,11 +19140,11 @@ function getAngularEmitterTransformFactory(generatedFiles, program, annotateForC
|
|
|
19180
19140
|
}
|
|
19181
19141
|
function getFileoverviewComment2(sourceFile) {
|
|
19182
19142
|
const trivia = sourceFile.getFullText().substring(0, sourceFile.getStart());
|
|
19183
|
-
const leadingComments =
|
|
19143
|
+
const leadingComments = ts82.getLeadingCommentRanges(trivia, 0);
|
|
19184
19144
|
if (!leadingComments || leadingComments.length === 0)
|
|
19185
19145
|
return "";
|
|
19186
19146
|
const comment = leadingComments[0];
|
|
19187
|
-
if (comment.kind !==
|
|
19147
|
+
if (comment.kind !== ts82.SyntaxKind.MultiLineCommentTrivia)
|
|
19188
19148
|
return "";
|
|
19189
19149
|
if (sourceFile.getFullText().substring(comment.end, comment.end + 2) !== "\n\n")
|
|
19190
19150
|
return "";
|
|
@@ -19194,9 +19154,9 @@ function getFileoverviewComment2(sourceFile) {
|
|
|
19194
19154
|
return stripComment(commentText).replace(/^\*\s+/, "");
|
|
19195
19155
|
}
|
|
19196
19156
|
|
|
19197
|
-
// bazel-out/
|
|
19157
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/r3_metadata_transform.mjs
|
|
19198
19158
|
import { ClassStmt as ClassStmt2, StmtModifier as StmtModifier3 } from "@angular/compiler";
|
|
19199
|
-
import
|
|
19159
|
+
import ts83 from "typescript";
|
|
19200
19160
|
var PartialModuleMetadataTransformer = class {
|
|
19201
19161
|
constructor(modules) {
|
|
19202
19162
|
this.moduleMap = new Map(modules.map((m) => [m.fileName, m]));
|
|
@@ -19207,7 +19167,7 @@ var PartialModuleMetadataTransformer = class {
|
|
|
19207
19167
|
const classMap = new Map(partialModule.statements.filter(isClassStmt).map((s) => [s.name, s]));
|
|
19208
19168
|
if (classMap.size > 0) {
|
|
19209
19169
|
return (value, node) => {
|
|
19210
|
-
if (isClassMetadata(value) && node.kind ===
|
|
19170
|
+
if (isClassMetadata(value) && node.kind === ts83.SyntaxKind.ClassDeclaration) {
|
|
19211
19171
|
const classDeclaration = node;
|
|
19212
19172
|
if (classDeclaration.name) {
|
|
19213
19173
|
const partialClass = classMap.get(classDeclaration.name.text);
|
|
@@ -19230,7 +19190,7 @@ function isClassStmt(v) {
|
|
|
19230
19190
|
return v instanceof ClassStmt2;
|
|
19231
19191
|
}
|
|
19232
19192
|
|
|
19233
|
-
// bazel-out/
|
|
19193
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/r3_transform.mjs
|
|
19234
19194
|
function getAngularClassTransformerFactory(modules, annotateForClosureCompiler) {
|
|
19235
19195
|
if (modules.length === 0) {
|
|
19236
19196
|
return () => (sf) => sf;
|
|
@@ -19248,7 +19208,7 @@ function getAngularClassTransformerFactory(modules, annotateForClosureCompiler)
|
|
|
19248
19208
|
};
|
|
19249
19209
|
}
|
|
19250
19210
|
|
|
19251
|
-
// bazel-out/
|
|
19211
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/program.mjs
|
|
19252
19212
|
var MAX_FILE_COUNT_FOR_SINGLE_FILE_EMIT = 20;
|
|
19253
19213
|
var VE_DISABLED_MESSAGE = `
|
|
19254
19214
|
This compilation is using the View Engine compiler which is no longer supported by the Angular team
|
|
@@ -19656,7 +19616,7 @@ var AngularCompilerProgram = class {
|
|
|
19656
19616
|
}
|
|
19657
19617
|
});
|
|
19658
19618
|
}
|
|
19659
|
-
const tmpProgram =
|
|
19619
|
+
const tmpProgram = ts84.createProgram(rootNames, this.options, this.hostAdapter, oldTsProgram);
|
|
19660
19620
|
if (tempProgramHandlerForTest !== null) {
|
|
19661
19621
|
tempProgramHandlerForTest(tmpProgram);
|
|
19662
19622
|
}
|
|
@@ -19686,7 +19646,7 @@ var AngularCompilerProgram = class {
|
|
|
19686
19646
|
}
|
|
19687
19647
|
}
|
|
19688
19648
|
});
|
|
19689
|
-
this._tsProgram =
|
|
19649
|
+
this._tsProgram = ts84.createProgram(rootNames, this.options, this.hostAdapter, tmpProgram);
|
|
19690
19650
|
if (tsStructureIsReused(this._tsProgram) !== 2) {
|
|
19691
19651
|
throw new Error(`Internal Error: The structure of the program changed during codegen.`);
|
|
19692
19652
|
}
|
|
@@ -19695,7 +19655,7 @@ var AngularCompilerProgram = class {
|
|
|
19695
19655
|
this._analyzedModules = emptyModules;
|
|
19696
19656
|
this.oldTsProgram = void 0;
|
|
19697
19657
|
this._hostAdapter.isSourceFile = () => false;
|
|
19698
|
-
this._tsProgram =
|
|
19658
|
+
this._tsProgram = ts84.createProgram(this.rootNames, this.options, this.hostAdapter);
|
|
19699
19659
|
if (isSyntaxError(e)) {
|
|
19700
19660
|
this._addStructuralDiagnostics(e);
|
|
19701
19661
|
return;
|
|
@@ -19709,7 +19669,7 @@ var AngularCompilerProgram = class {
|
|
|
19709
19669
|
} else {
|
|
19710
19670
|
diagnostics.push({
|
|
19711
19671
|
messageText: error2.toString(),
|
|
19712
|
-
category:
|
|
19672
|
+
category: ts84.DiagnosticCategory.Error,
|
|
19713
19673
|
source: SOURCE,
|
|
19714
19674
|
code: DEFAULT_ERROR_CODE
|
|
19715
19675
|
});
|
|
@@ -19736,7 +19696,7 @@ var AngularCompilerProgram = class {
|
|
|
19736
19696
|
start: void 0,
|
|
19737
19697
|
length: void 0,
|
|
19738
19698
|
messageText: e.message,
|
|
19739
|
-
category:
|
|
19699
|
+
category: ts84.DiagnosticCategory.Error,
|
|
19740
19700
|
source: SOURCE,
|
|
19741
19701
|
code: DEFAULT_ERROR_CODE
|
|
19742
19702
|
}];
|
|
@@ -19841,7 +19801,7 @@ function getNgOptionDiagnostics(options) {
|
|
|
19841
19801
|
default:
|
|
19842
19802
|
return [{
|
|
19843
19803
|
messageText: 'Angular compiler options "annotationsAs" only supports "static fields" and "decorators"',
|
|
19844
|
-
category:
|
|
19804
|
+
category: ts84.DiagnosticCategory.Error,
|
|
19845
19805
|
source: SOURCE,
|
|
19846
19806
|
code: DEFAULT_ERROR_CODE
|
|
19847
19807
|
}];
|
|
@@ -19905,7 +19865,7 @@ function syntaxErrorToDiagnostics(error2, program) {
|
|
|
19905
19865
|
file: diagnosticSourceOfSpan(e.span),
|
|
19906
19866
|
start: e.span.start.offset,
|
|
19907
19867
|
length: e.span.end.offset - e.span.start.offset,
|
|
19908
|
-
category:
|
|
19868
|
+
category: ts84.DiagnosticCategory.Error,
|
|
19909
19869
|
source: SOURCE,
|
|
19910
19870
|
code: DEFAULT_ERROR_CODE
|
|
19911
19871
|
}));
|
|
@@ -19913,7 +19873,7 @@ function syntaxErrorToDiagnostics(error2, program) {
|
|
|
19913
19873
|
return [{
|
|
19914
19874
|
messageText: error2.message,
|
|
19915
19875
|
chain: error2.chain && diagnosticChainFromFormattedDiagnosticChain(error2.chain),
|
|
19916
|
-
category:
|
|
19876
|
+
category: ts84.DiagnosticCategory.Error,
|
|
19917
19877
|
source: SOURCE,
|
|
19918
19878
|
code: DEFAULT_ERROR_CODE,
|
|
19919
19879
|
position: error2.position
|
|
@@ -19932,7 +19892,7 @@ function syntaxErrorToDiagnostics(error2, program) {
|
|
|
19932
19892
|
|
|
19933
19893
|
See https://angular.io/errors/NG6999 for more information.
|
|
19934
19894
|
`,
|
|
19935
|
-
category:
|
|
19895
|
+
category: ts84.DiagnosticCategory.Error,
|
|
19936
19896
|
code: DEFAULT_ERROR_CODE,
|
|
19937
19897
|
source: SOURCE
|
|
19938
19898
|
}];
|
|
@@ -19940,7 +19900,7 @@ See https://angular.io/errors/NG6999 for more information.
|
|
|
19940
19900
|
}
|
|
19941
19901
|
return [{
|
|
19942
19902
|
messageText: error2.message,
|
|
19943
|
-
category:
|
|
19903
|
+
category: ts84.DiagnosticCategory.Error,
|
|
19944
19904
|
code: DEFAULT_ERROR_CODE,
|
|
19945
19905
|
source: SOURCE
|
|
19946
19906
|
}];
|
|
@@ -19951,7 +19911,7 @@ function getDtsClass(program, fileName, className) {
|
|
|
19951
19911
|
return null;
|
|
19952
19912
|
}
|
|
19953
19913
|
for (const stmt of sf.statements) {
|
|
19954
|
-
if (!
|
|
19914
|
+
if (!ts84.isClassDeclaration(stmt)) {
|
|
19955
19915
|
continue;
|
|
19956
19916
|
}
|
|
19957
19917
|
if (stmt.name === void 0 || stmt.name.text !== className) {
|
|
@@ -19963,23 +19923,23 @@ function getDtsClass(program, fileName, className) {
|
|
|
19963
19923
|
}
|
|
19964
19924
|
function isIvyNgModule(clazz) {
|
|
19965
19925
|
for (const member of clazz.members) {
|
|
19966
|
-
if (!
|
|
19926
|
+
if (!ts84.isPropertyDeclaration(member)) {
|
|
19967
19927
|
continue;
|
|
19968
19928
|
}
|
|
19969
|
-
if (
|
|
19929
|
+
if (ts84.isIdentifier(member.name) && member.name.text === "\u0275mod") {
|
|
19970
19930
|
return true;
|
|
19971
19931
|
}
|
|
19972
19932
|
}
|
|
19973
19933
|
return false;
|
|
19974
19934
|
}
|
|
19975
19935
|
|
|
19976
|
-
// bazel-out/
|
|
19936
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
19977
19937
|
import { isSyntaxError as isSyntaxError2 } from "@angular/compiler";
|
|
19978
|
-
import
|
|
19938
|
+
import ts85 from "typescript";
|
|
19979
19939
|
var defaultFormatHost = {
|
|
19980
|
-
getCurrentDirectory: () =>
|
|
19940
|
+
getCurrentDirectory: () => ts85.sys.getCurrentDirectory(),
|
|
19981
19941
|
getCanonicalFileName: (fileName) => fileName,
|
|
19982
|
-
getNewLine: () =>
|
|
19942
|
+
getNewLine: () => ts85.sys.newLine
|
|
19983
19943
|
};
|
|
19984
19944
|
function displayFileName(fileName, host) {
|
|
19985
19945
|
return relative(resolve(host.getCurrentDirectory()), resolve(host.getCanonicalFileName(fileName)));
|
|
@@ -20031,7 +19991,7 @@ function formatDiagnostics(diags, host = defaultFormatHost) {
|
|
|
20031
19991
|
if (diags && diags.length) {
|
|
20032
19992
|
return diags.map((diagnostic) => {
|
|
20033
19993
|
if (isTsDiagnostic(diagnostic)) {
|
|
20034
|
-
return replaceTsWithNgInErrors(
|
|
19994
|
+
return replaceTsWithNgInErrors(ts85.formatDiagnosticsWithColorAndContext([diagnostic], host));
|
|
20035
19995
|
} else {
|
|
20036
19996
|
return formatDiagnostic(diagnostic, host);
|
|
20037
19997
|
}
|
|
@@ -20052,7 +20012,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
20052
20012
|
var _a;
|
|
20053
20013
|
try {
|
|
20054
20014
|
const fs5 = getFileSystem();
|
|
20055
|
-
const readConfigFile = (configFile) =>
|
|
20015
|
+
const readConfigFile = (configFile) => ts85.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
|
|
20056
20016
|
const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
|
|
20057
20017
|
const { config: config2, error: error3 } = readConfigFile(configFile);
|
|
20058
20018
|
if (error3) {
|
|
@@ -20084,7 +20044,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
20084
20044
|
basePath
|
|
20085
20045
|
}, readAngularCompilerOptions(configFileName)), existingOptions);
|
|
20086
20046
|
const parseConfigHost = createParseConfigHost(host, fs5);
|
|
20087
|
-
const { options, errors, fileNames: rootNames, projectReferences } =
|
|
20047
|
+
const { options, errors, fileNames: rootNames, projectReferences } = ts85.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
|
|
20088
20048
|
options.enableIvy = !!((_a = options.enableIvy) != null ? _a : true);
|
|
20089
20049
|
let emitFlags = EmitFlags.Default;
|
|
20090
20050
|
if (!(options.skipMetadataEmit || options.flatModuleOutFile)) {
|
|
@@ -20096,7 +20056,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
20096
20056
|
return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
|
|
20097
20057
|
} catch (e) {
|
|
20098
20058
|
const errors = [{
|
|
20099
|
-
category:
|
|
20059
|
+
category: ts85.DiagnosticCategory.Error,
|
|
20100
20060
|
messageText: e.stack,
|
|
20101
20061
|
file: void 0,
|
|
20102
20062
|
start: void 0,
|
|
@@ -20110,7 +20070,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
|
|
|
20110
20070
|
function createParseConfigHost(host, fs5 = getFileSystem()) {
|
|
20111
20071
|
return {
|
|
20112
20072
|
fileExists: host.exists.bind(host),
|
|
20113
|
-
readDirectory:
|
|
20073
|
+
readDirectory: ts85.sys.readDirectory,
|
|
20114
20074
|
readFile: host.readFile.bind(host),
|
|
20115
20075
|
useCaseSensitiveFileNames: fs5.isCaseSensitive()
|
|
20116
20076
|
};
|
|
@@ -20130,7 +20090,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs5) {
|
|
|
20130
20090
|
}
|
|
20131
20091
|
} else {
|
|
20132
20092
|
const parseConfigHost = createParseConfigHost(host, fs5);
|
|
20133
|
-
const { resolvedModule } =
|
|
20093
|
+
const { resolvedModule } = ts85.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts85.ModuleResolutionKind.NodeJs, resolveJsonModule: true }, parseConfigHost);
|
|
20134
20094
|
if (resolvedModule) {
|
|
20135
20095
|
return absoluteFrom(resolvedModule.resolvedFileName);
|
|
20136
20096
|
}
|
|
@@ -20140,7 +20100,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs5) {
|
|
|
20140
20100
|
function exitCodeFromResult(diags) {
|
|
20141
20101
|
if (!diags)
|
|
20142
20102
|
return 0;
|
|
20143
|
-
if (diags.every((diag) => diag.category !==
|
|
20103
|
+
if (diags.every((diag) => diag.category !== ts85.DiagnosticCategory.Error)) {
|
|
20144
20104
|
return 0;
|
|
20145
20105
|
}
|
|
20146
20106
|
return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
|
|
@@ -20180,7 +20140,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
|
|
|
20180
20140
|
program = void 0;
|
|
20181
20141
|
code = UNKNOWN_ERROR_CODE;
|
|
20182
20142
|
}
|
|
20183
|
-
allDiagnostics.push({ category:
|
|
20143
|
+
allDiagnostics.push({ category: ts85.DiagnosticCategory.Error, messageText: errMsg, code, source: SOURCE });
|
|
20184
20144
|
return { diagnostics: allDiagnostics, program };
|
|
20185
20145
|
}
|
|
20186
20146
|
}
|
|
@@ -20201,10 +20161,10 @@ function defaultGatherDiagnostics(program) {
|
|
|
20201
20161
|
return allDiagnostics;
|
|
20202
20162
|
}
|
|
20203
20163
|
function hasErrors(diags) {
|
|
20204
|
-
return diags.some((d) => d.category ===
|
|
20164
|
+
return diags.some((d) => d.category === ts85.DiagnosticCategory.Error);
|
|
20205
20165
|
}
|
|
20206
20166
|
|
|
20207
|
-
// bazel-out/
|
|
20167
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/private/tooling.mjs
|
|
20208
20168
|
var GLOBAL_DEFS_FOR_TERSER = {
|
|
20209
20169
|
ngDevMode: false,
|
|
20210
20170
|
ngI18nClosureMode: false
|
|
@@ -20218,7 +20178,7 @@ function constructorParametersDownlevelTransform(program) {
|
|
|
20218
20178
|
return getDownlevelDecoratorsTransform(typeChecker, reflectionHost, [], false, false, true);
|
|
20219
20179
|
}
|
|
20220
20180
|
|
|
20221
|
-
// bazel-out/
|
|
20181
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/logger.mjs
|
|
20222
20182
|
var LogLevel;
|
|
20223
20183
|
(function(LogLevel2) {
|
|
20224
20184
|
LogLevel2[LogLevel2["debug"] = 0] = "debug";
|
|
@@ -20227,7 +20187,7 @@ var LogLevel;
|
|
|
20227
20187
|
LogLevel2[LogLevel2["error"] = 3] = "error";
|
|
20228
20188
|
})(LogLevel || (LogLevel = {}));
|
|
20229
20189
|
|
|
20230
|
-
// bazel-out/
|
|
20190
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/logging/src/console_logger.mjs
|
|
20231
20191
|
var RESET = "[0m";
|
|
20232
20192
|
var RED = "[31m";
|
|
20233
20193
|
var YELLOW = "[33m";
|
|
@@ -20257,7 +20217,7 @@ var ConsoleLogger = class {
|
|
|
20257
20217
|
}
|
|
20258
20218
|
};
|
|
20259
20219
|
|
|
20260
|
-
// bazel-out/
|
|
20220
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/tsc_plugin.mjs
|
|
20261
20221
|
var NgTscPlugin = class {
|
|
20262
20222
|
constructor(ngOptions) {
|
|
20263
20223
|
this.ngOptions = ngOptions;
|
|
@@ -20326,7 +20286,7 @@ var NgTscPlugin = class {
|
|
|
20326
20286
|
}
|
|
20327
20287
|
};
|
|
20328
20288
|
|
|
20329
|
-
// bazel-out/
|
|
20289
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/index.mjs
|
|
20330
20290
|
setFileSystem(new NodeJSFileSystem());
|
|
20331
20291
|
export {
|
|
20332
20292
|
ConsoleLogger,
|