@angular/core 17.0.0-rc.0 → 17.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/application_init.mjs +3 -2
- package/esm2022/src/application_ref.mjs +3 -3
- package/esm2022/src/application_tokens.mjs +1 -11
- package/esm2022/src/core.mjs +2 -2
- package/esm2022/src/core_private_export.mjs +2 -2
- package/esm2022/src/defer/cleanup.mjs +23 -53
- package/esm2022/src/defer/dom_triggers.mjs +15 -15
- package/esm2022/src/defer/idle_scheduler.mjs +20 -17
- package/esm2022/src/defer/instructions.mjs +66 -45
- package/esm2022/src/defer/interfaces.mjs +3 -1
- package/esm2022/src/defer/timer_scheduler.mjs +43 -34
- package/esm2022/src/defer/utils.mjs +2 -14
- package/esm2022/src/di/r3_injector.mjs +6 -1
- package/esm2022/src/errors.mjs +1 -1
- package/esm2022/src/hydration/api.mjs +2 -3
- package/esm2022/src/hydration/skip_hydration.mjs +7 -7
- package/esm2022/src/linker/view_container_ref.mjs +4 -6
- package/esm2022/src/metadata/directives.mjs +1 -1
- package/esm2022/src/render3/after_render_hooks.mjs +25 -21
- package/esm2022/src/render3/debug/injector_profiler.mjs +26 -8
- package/esm2022/src/render3/instructions/change_detection.mjs +24 -3
- package/esm2022/src/render3/util/injector_discovery_utils.mjs +26 -2
- package/esm2022/src/render3/util/view_utils.mjs +1 -4
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/defer.mjs +6 -3
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +376 -329
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +6 -3
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +12 -13
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +788 -370
- package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
- package/schematics/migrations/compiler-options/bundle.js +13 -13
- package/schematics/migrations/transfer-state/bundle.js +13 -13
- package/schematics/ng-generate/control-flow-migration/bundle.js +988 -528
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
- package/schematics/ng-generate/standalone-migration/bundle.js +1047 -628
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
// bazel-out/
|
|
66
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
|
|
67
67
|
var control_flow_migration_exports = {};
|
|
68
68
|
__export(control_flow_migration_exports, {
|
|
69
69
|
default: () => control_flow_migration_default
|
|
@@ -72,7 +72,7 @@ module.exports = __toCommonJS(control_flow_migration_exports);
|
|
|
72
72
|
var import_schematics = require("@angular-devkit/schematics");
|
|
73
73
|
var import_path3 = require("path");
|
|
74
74
|
|
|
75
|
-
// bazel-out/
|
|
75
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
|
|
76
76
|
var import_core = require("@angular-devkit/core");
|
|
77
77
|
function getProjectTsConfigPaths(tree) {
|
|
78
78
|
return __async(this, null, function* () {
|
|
@@ -152,11 +152,11 @@ function getWorkspace(tree) {
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
// bazel-out/
|
|
155
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
156
156
|
var import_path = require("path");
|
|
157
157
|
var import_typescript2 = __toESM(require("typescript"), 1);
|
|
158
158
|
|
|
159
|
-
// bazel-out/
|
|
159
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
|
|
160
160
|
var path = __toESM(require("path"), 1);
|
|
161
161
|
var import_typescript = __toESM(require("typescript"), 1);
|
|
162
162
|
function parseTsconfigFile(tsconfigPath, basePath) {
|
|
@@ -173,7 +173,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
|
|
|
173
173
|
return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
// bazel-out/
|
|
176
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
177
177
|
function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
|
|
178
178
|
const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
|
|
179
179
|
return import_typescript2.default.createProgram(rootNames, options, host);
|
|
@@ -206,7 +206,7 @@ function canMigrateFile(basePath, sourceFile, program) {
|
|
|
206
206
|
return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
// bazel-out/
|
|
209
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
|
|
210
210
|
var _SELECTOR_REGEXP = new RegExp(
|
|
211
211
|
`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
|
|
212
212
|
"g"
|
|
@@ -514,7 +514,7 @@ var SelectorContext = class {
|
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
516
|
|
|
517
|
-
// bazel-out/
|
|
517
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
|
|
518
518
|
var ViewEncapsulation;
|
|
519
519
|
(function(ViewEncapsulation2) {
|
|
520
520
|
ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
|
|
@@ -576,7 +576,7 @@ function parseSelectorToR3Selector(selector) {
|
|
|
576
576
|
return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
|
|
577
577
|
}
|
|
578
578
|
|
|
579
|
-
// bazel-out/
|
|
579
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
|
|
580
580
|
var textEncoder;
|
|
581
581
|
function computeDigest(message) {
|
|
582
582
|
return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
|
|
@@ -813,7 +813,7 @@ function wordAt(bytes, index, endian) {
|
|
|
813
813
|
return word;
|
|
814
814
|
}
|
|
815
815
|
|
|
816
|
-
// bazel-out/
|
|
816
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
|
|
817
817
|
var TypeModifier;
|
|
818
818
|
(function(TypeModifier2) {
|
|
819
819
|
TypeModifier2[TypeModifier2["None"] = 0] = "None";
|
|
@@ -1768,7 +1768,7 @@ function serializeTags(tags) {
|
|
|
1768
1768
|
return out;
|
|
1769
1769
|
}
|
|
1770
1770
|
|
|
1771
|
-
// bazel-out/
|
|
1771
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
|
|
1772
1772
|
var CONSTANT_PREFIX = "_c";
|
|
1773
1773
|
var UNKNOWN_VALUE_KEY = variable("<unknown>");
|
|
1774
1774
|
var KEY_CONTEXT = {};
|
|
@@ -1951,7 +1951,7 @@ function isLongStringLiteral(expr) {
|
|
|
1951
1951
|
return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
|
|
1952
1952
|
}
|
|
1953
1953
|
|
|
1954
|
-
// bazel-out/
|
|
1954
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
|
|
1955
1955
|
var CORE = "@angular/core";
|
|
1956
1956
|
var _Identifiers = class {
|
|
1957
1957
|
};
|
|
@@ -2584,7 +2584,7 @@ var Identifiers = _Identifiers;
|
|
|
2584
2584
|
_Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
|
|
2585
2585
|
})();
|
|
2586
2586
|
|
|
2587
|
-
// bazel-out/
|
|
2587
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
|
|
2588
2588
|
var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
|
|
2589
2589
|
function dashCaseToCamelCase(input) {
|
|
2590
2590
|
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
|
@@ -2672,7 +2672,7 @@ function partitionArray(arr, conditionFn) {
|
|
|
2672
2672
|
return [truthy, falsy];
|
|
2673
2673
|
}
|
|
2674
2674
|
|
|
2675
|
-
// bazel-out/
|
|
2675
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
|
|
2676
2676
|
var VERSION = 3;
|
|
2677
2677
|
var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
|
|
2678
2678
|
var SourceMapGenerator = class {
|
|
@@ -2801,7 +2801,7 @@ function toBase64Digit(value) {
|
|
|
2801
2801
|
return B64_DIGITS[value];
|
|
2802
2802
|
}
|
|
2803
2803
|
|
|
2804
|
-
// bazel-out/
|
|
2804
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
|
|
2805
2805
|
var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
|
|
2806
2806
|
var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
|
|
2807
2807
|
var _INDENT_WITH = " ";
|
|
@@ -3286,7 +3286,7 @@ function _createIndent(count) {
|
|
|
3286
3286
|
return res;
|
|
3287
3287
|
}
|
|
3288
3288
|
|
|
3289
|
-
// bazel-out/
|
|
3289
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
|
|
3290
3290
|
function typeWithParameters(type, numParams) {
|
|
3291
3291
|
if (numParams === 0) {
|
|
3292
3292
|
return expressionType(type);
|
|
@@ -3351,7 +3351,7 @@ function generateForwardRef(expr) {
|
|
|
3351
3351
|
return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
|
|
3352
3352
|
}
|
|
3353
3353
|
|
|
3354
|
-
// bazel-out/
|
|
3354
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
|
|
3355
3355
|
var R3FactoryDelegateType;
|
|
3356
3356
|
(function(R3FactoryDelegateType2) {
|
|
3357
3357
|
R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
|
|
@@ -3496,7 +3496,7 @@ function getInjectFn(target) {
|
|
|
3496
3496
|
}
|
|
3497
3497
|
}
|
|
3498
3498
|
|
|
3499
|
-
// bazel-out/
|
|
3499
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
|
|
3500
3500
|
var Comment = class {
|
|
3501
3501
|
constructor(value, sourceSpan) {
|
|
3502
3502
|
this.value = value;
|
|
@@ -3785,9 +3785,10 @@ var IfBlockBranch = class {
|
|
|
3785
3785
|
}
|
|
3786
3786
|
};
|
|
3787
3787
|
var UnknownBlock = class {
|
|
3788
|
-
constructor(name, sourceSpan) {
|
|
3788
|
+
constructor(name, sourceSpan, nameSpan) {
|
|
3789
3789
|
this.name = name;
|
|
3790
3790
|
this.sourceSpan = sourceSpan;
|
|
3791
|
+
this.nameSpan = nameSpan;
|
|
3791
3792
|
}
|
|
3792
3793
|
visit(visitor) {
|
|
3793
3794
|
return visitor.visitUnknownBlock(this);
|
|
@@ -3876,7 +3877,7 @@ function visitAll(visitor, nodes) {
|
|
|
3876
3877
|
return result;
|
|
3877
3878
|
}
|
|
3878
3879
|
|
|
3879
|
-
// bazel-out/
|
|
3880
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
|
|
3880
3881
|
var Message = class {
|
|
3881
3882
|
constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
|
|
3882
3883
|
this.nodes = nodes;
|
|
@@ -3995,7 +3996,7 @@ var LocalizeMessageStringVisitor = class {
|
|
|
3995
3996
|
}
|
|
3996
3997
|
};
|
|
3997
3998
|
|
|
3998
|
-
// bazel-out/
|
|
3999
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
|
|
3999
4000
|
var _Visitor = class {
|
|
4000
4001
|
visitTag(tag) {
|
|
4001
4002
|
const strAttrs = this._serializeAttributes(tag.attrs);
|
|
@@ -4023,12 +4024,12 @@ ${doctype.dtd}
|
|
|
4023
4024
|
};
|
|
4024
4025
|
var _visitor = new _Visitor();
|
|
4025
4026
|
|
|
4026
|
-
// bazel-out/
|
|
4027
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
|
|
4027
4028
|
function toPublicName(internalName) {
|
|
4028
4029
|
return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
|
|
4029
4030
|
}
|
|
4030
4031
|
|
|
4031
|
-
// bazel-out/
|
|
4032
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
|
|
4032
4033
|
var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
|
|
4033
4034
|
var TRANSLATION_VAR_PREFIX = "i18n_";
|
|
4034
4035
|
var I18N_ATTR = "i18n";
|
|
@@ -4130,7 +4131,7 @@ function declareI18nVariable(variable2) {
|
|
|
4130
4131
|
return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
|
|
4131
4132
|
}
|
|
4132
4133
|
|
|
4133
|
-
// bazel-out/
|
|
4134
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
|
|
4134
4135
|
var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
|
|
4135
4136
|
var TEMPORARY_NAME = "_t";
|
|
4136
4137
|
var CONTEXT_NAME = "ctx";
|
|
@@ -4353,7 +4354,7 @@ function getInstructionStatements(instructions) {
|
|
|
4353
4354
|
return statements;
|
|
4354
4355
|
}
|
|
4355
4356
|
|
|
4356
|
-
// bazel-out/
|
|
4357
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
|
|
4357
4358
|
function compileInjectable(meta, resolveForwardRefs) {
|
|
4358
4359
|
let result = null;
|
|
4359
4360
|
const factoryMeta = {
|
|
@@ -4438,7 +4439,7 @@ function createFactoryFunction(type) {
|
|
|
4438
4439
|
return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
|
|
4439
4440
|
}
|
|
4440
4441
|
|
|
4441
|
-
// bazel-out/
|
|
4442
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
|
|
4442
4443
|
var UNUSABLE_INTERPOLATION_REGEXPS = [
|
|
4443
4444
|
/^\s*$/,
|
|
4444
4445
|
/[<>]/,
|
|
@@ -4460,7 +4461,7 @@ function assertInterpolationSymbols(identifier, value) {
|
|
|
4460
4461
|
}
|
|
4461
4462
|
}
|
|
4462
4463
|
|
|
4463
|
-
// bazel-out/
|
|
4464
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/interpolation_config.mjs
|
|
4464
4465
|
var InterpolationConfig = class {
|
|
4465
4466
|
static fromArray(markers) {
|
|
4466
4467
|
if (!markers) {
|
|
@@ -4476,7 +4477,7 @@ var InterpolationConfig = class {
|
|
|
4476
4477
|
};
|
|
4477
4478
|
var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
|
|
4478
4479
|
|
|
4479
|
-
// bazel-out/
|
|
4480
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
|
|
4480
4481
|
var $EOF = 0;
|
|
4481
4482
|
var $BSPACE = 8;
|
|
4482
4483
|
var $TAB = 9;
|
|
@@ -4558,7 +4559,7 @@ function isQuote(code) {
|
|
|
4558
4559
|
return code === $SQ || code === $DQ || code === $BT;
|
|
4559
4560
|
}
|
|
4560
4561
|
|
|
4561
|
-
// bazel-out/
|
|
4562
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
|
|
4562
4563
|
var ParseLocation = class {
|
|
4563
4564
|
constructor(file, offset, line, col) {
|
|
4564
4565
|
this.file = file;
|
|
@@ -4705,7 +4706,7 @@ function sanitizeIdentifier(name) {
|
|
|
4705
4706
|
return name.replace(/\W/g, "_");
|
|
4706
4707
|
}
|
|
4707
4708
|
|
|
4708
|
-
// bazel-out/
|
|
4709
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
|
|
4709
4710
|
var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
|
|
4710
4711
|
var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
|
|
4711
4712
|
constructor() {
|
|
@@ -4798,7 +4799,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
|
|
|
4798
4799
|
}
|
|
4799
4800
|
};
|
|
4800
4801
|
|
|
4801
|
-
// bazel-out/
|
|
4802
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
|
|
4802
4803
|
var policy;
|
|
4803
4804
|
function getPolicy() {
|
|
4804
4805
|
if (policy === void 0) {
|
|
@@ -4836,7 +4837,7 @@ function newTrustedFunctionForJIT(...args) {
|
|
|
4836
4837
|
return fn2.bind(_global);
|
|
4837
4838
|
}
|
|
4838
4839
|
|
|
4839
|
-
// bazel-out/
|
|
4840
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
|
|
4840
4841
|
var JitEvaluator = class {
|
|
4841
4842
|
evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
|
|
4842
4843
|
const converter = new JitEmitterVisitor(refResolver);
|
|
@@ -4927,7 +4928,7 @@ function isUseStrictStatement(statement) {
|
|
|
4927
4928
|
return statement.isEquivalent(literal("use strict").toStmt());
|
|
4928
4929
|
}
|
|
4929
4930
|
|
|
4930
|
-
// bazel-out/
|
|
4931
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
|
|
4931
4932
|
function compileInjector(meta) {
|
|
4932
4933
|
const definitionMap = new DefinitionMap();
|
|
4933
4934
|
if (meta.providers !== null) {
|
|
@@ -4944,7 +4945,7 @@ function createInjectorType(meta) {
|
|
|
4944
4945
|
return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
|
|
4945
4946
|
}
|
|
4946
4947
|
|
|
4947
|
-
// bazel-out/
|
|
4948
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
|
|
4948
4949
|
var R3JitReflector = class {
|
|
4949
4950
|
constructor(context) {
|
|
4950
4951
|
this.context = context;
|
|
@@ -4960,7 +4961,7 @@ var R3JitReflector = class {
|
|
|
4960
4961
|
}
|
|
4961
4962
|
};
|
|
4962
4963
|
|
|
4963
|
-
// bazel-out/
|
|
4964
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
|
|
4964
4965
|
var R3SelectorScopeMode;
|
|
4965
4966
|
(function(R3SelectorScopeMode2) {
|
|
4966
4967
|
R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
|
|
@@ -5101,7 +5102,7 @@ function tupleOfTypes(types) {
|
|
|
5101
5102
|
return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
|
|
5102
5103
|
}
|
|
5103
5104
|
|
|
5104
|
-
// bazel-out/
|
|
5105
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
|
|
5105
5106
|
function compilePipeFromMetadata(metadata) {
|
|
5106
5107
|
const definitionMapValues = [];
|
|
5107
5108
|
definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
|
|
@@ -5122,7 +5123,7 @@ function createPipeType(metadata) {
|
|
|
5122
5123
|
]));
|
|
5123
5124
|
}
|
|
5124
5125
|
|
|
5125
|
-
// bazel-out/
|
|
5126
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
|
|
5126
5127
|
var R3TemplateDependencyKind;
|
|
5127
5128
|
(function(R3TemplateDependencyKind2) {
|
|
5128
5129
|
R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
|
|
@@ -5130,7 +5131,7 @@ var R3TemplateDependencyKind;
|
|
|
5130
5131
|
R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
|
|
5131
5132
|
})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
|
|
5132
5133
|
|
|
5133
|
-
// bazel-out/
|
|
5134
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
|
|
5134
5135
|
var ParserError = class {
|
|
5135
5136
|
constructor(message, input, errLocation, ctxLocation) {
|
|
5136
5137
|
this.input = input;
|
|
@@ -5796,7 +5797,7 @@ var BoundElementProperty = class {
|
|
|
5796
5797
|
}
|
|
5797
5798
|
};
|
|
5798
5799
|
|
|
5799
|
-
// bazel-out/
|
|
5800
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
|
|
5800
5801
|
var _EventHandlerVars = class {
|
|
5801
5802
|
};
|
|
5802
5803
|
var EventHandlerVars = _EventHandlerVars;
|
|
@@ -6437,7 +6438,7 @@ var BuiltinFunctionCall = class extends Call {
|
|
|
6437
6438
|
}
|
|
6438
6439
|
};
|
|
6439
6440
|
|
|
6440
|
-
// bazel-out/
|
|
6441
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
|
|
6441
6442
|
var _SECURITY_SCHEMA;
|
|
6442
6443
|
function SECURITY_SCHEMA() {
|
|
6443
6444
|
if (!_SECURITY_SCHEMA) {
|
|
@@ -6495,7 +6496,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
|
|
|
6495
6496
|
return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
|
|
6496
6497
|
}
|
|
6497
6498
|
|
|
6498
|
-
// bazel-out/
|
|
6499
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
|
|
6499
6500
|
var animationKeywords = /* @__PURE__ */ new Set([
|
|
6500
6501
|
"inherit",
|
|
6501
6502
|
"initial",
|
|
@@ -6966,7 +6967,7 @@ function repeatGroups(groups, multiples) {
|
|
|
6966
6967
|
}
|
|
6967
6968
|
}
|
|
6968
6969
|
|
|
6969
|
-
// bazel-out/
|
|
6970
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
|
|
6970
6971
|
var OpKind;
|
|
6971
6972
|
(function(OpKind2) {
|
|
6972
6973
|
OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
|
|
@@ -7003,44 +7004,54 @@ var OpKind;
|
|
|
7003
7004
|
OpKind2[OpKind2["Namespace"] = 31] = "Namespace";
|
|
7004
7005
|
OpKind2[OpKind2["ProjectionDef"] = 32] = "ProjectionDef";
|
|
7005
7006
|
OpKind2[OpKind2["Projection"] = 33] = "Projection";
|
|
7006
|
-
OpKind2[OpKind2["
|
|
7007
|
-
OpKind2[OpKind2["
|
|
7008
|
-
OpKind2[OpKind2["
|
|
7009
|
-
OpKind2[OpKind2["
|
|
7010
|
-
OpKind2[OpKind2["
|
|
7011
|
-
OpKind2[OpKind2["
|
|
7012
|
-
OpKind2[OpKind2["
|
|
7007
|
+
OpKind2[OpKind2["RepeaterCreate"] = 34] = "RepeaterCreate";
|
|
7008
|
+
OpKind2[OpKind2["Repeater"] = 35] = "Repeater";
|
|
7009
|
+
OpKind2[OpKind2["I18nStart"] = 36] = "I18nStart";
|
|
7010
|
+
OpKind2[OpKind2["I18n"] = 37] = "I18n";
|
|
7011
|
+
OpKind2[OpKind2["I18nEnd"] = 38] = "I18nEnd";
|
|
7012
|
+
OpKind2[OpKind2["I18nExpression"] = 39] = "I18nExpression";
|
|
7013
|
+
OpKind2[OpKind2["I18nApply"] = 40] = "I18nApply";
|
|
7014
|
+
OpKind2[OpKind2["Icu"] = 41] = "Icu";
|
|
7015
|
+
OpKind2[OpKind2["IcuUpdate"] = 42] = "IcuUpdate";
|
|
7013
7016
|
})(OpKind || (OpKind = {}));
|
|
7014
7017
|
var ExpressionKind;
|
|
7015
7018
|
(function(ExpressionKind2) {
|
|
7016
7019
|
ExpressionKind2[ExpressionKind2["LexicalRead"] = 0] = "LexicalRead";
|
|
7017
7020
|
ExpressionKind2[ExpressionKind2["Context"] = 1] = "Context";
|
|
7018
|
-
ExpressionKind2[ExpressionKind2["
|
|
7019
|
-
ExpressionKind2[ExpressionKind2["
|
|
7020
|
-
ExpressionKind2[ExpressionKind2["
|
|
7021
|
-
ExpressionKind2[ExpressionKind2["
|
|
7022
|
-
ExpressionKind2[ExpressionKind2["
|
|
7023
|
-
ExpressionKind2[ExpressionKind2["
|
|
7024
|
-
ExpressionKind2[ExpressionKind2["
|
|
7025
|
-
ExpressionKind2[ExpressionKind2["
|
|
7026
|
-
ExpressionKind2[ExpressionKind2["
|
|
7027
|
-
ExpressionKind2[ExpressionKind2["
|
|
7028
|
-
ExpressionKind2[ExpressionKind2["
|
|
7029
|
-
ExpressionKind2[ExpressionKind2["
|
|
7030
|
-
ExpressionKind2[ExpressionKind2["
|
|
7031
|
-
ExpressionKind2[ExpressionKind2["
|
|
7032
|
-
ExpressionKind2[ExpressionKind2["
|
|
7033
|
-
ExpressionKind2[ExpressionKind2["
|
|
7034
|
-
ExpressionKind2[ExpressionKind2["
|
|
7035
|
-
ExpressionKind2[ExpressionKind2["
|
|
7036
|
-
ExpressionKind2[ExpressionKind2["
|
|
7037
|
-
ExpressionKind2[ExpressionKind2["
|
|
7021
|
+
ExpressionKind2[ExpressionKind2["TrackContext"] = 2] = "TrackContext";
|
|
7022
|
+
ExpressionKind2[ExpressionKind2["ReadVariable"] = 3] = "ReadVariable";
|
|
7023
|
+
ExpressionKind2[ExpressionKind2["NextContext"] = 4] = "NextContext";
|
|
7024
|
+
ExpressionKind2[ExpressionKind2["Reference"] = 5] = "Reference";
|
|
7025
|
+
ExpressionKind2[ExpressionKind2["GetCurrentView"] = 6] = "GetCurrentView";
|
|
7026
|
+
ExpressionKind2[ExpressionKind2["RestoreView"] = 7] = "RestoreView";
|
|
7027
|
+
ExpressionKind2[ExpressionKind2["ResetView"] = 8] = "ResetView";
|
|
7028
|
+
ExpressionKind2[ExpressionKind2["PureFunctionExpr"] = 9] = "PureFunctionExpr";
|
|
7029
|
+
ExpressionKind2[ExpressionKind2["PureFunctionParameterExpr"] = 10] = "PureFunctionParameterExpr";
|
|
7030
|
+
ExpressionKind2[ExpressionKind2["PipeBinding"] = 11] = "PipeBinding";
|
|
7031
|
+
ExpressionKind2[ExpressionKind2["PipeBindingVariadic"] = 12] = "PipeBindingVariadic";
|
|
7032
|
+
ExpressionKind2[ExpressionKind2["SafePropertyRead"] = 13] = "SafePropertyRead";
|
|
7033
|
+
ExpressionKind2[ExpressionKind2["SafeKeyedRead"] = 14] = "SafeKeyedRead";
|
|
7034
|
+
ExpressionKind2[ExpressionKind2["SafeInvokeFunction"] = 15] = "SafeInvokeFunction";
|
|
7035
|
+
ExpressionKind2[ExpressionKind2["SafeTernaryExpr"] = 16] = "SafeTernaryExpr";
|
|
7036
|
+
ExpressionKind2[ExpressionKind2["EmptyExpr"] = 17] = "EmptyExpr";
|
|
7037
|
+
ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
|
|
7038
|
+
ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
|
|
7039
|
+
ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 20] = "SanitizerExpr";
|
|
7040
|
+
ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 21] = "SlotLiteralExpr";
|
|
7041
|
+
ExpressionKind2[ExpressionKind2["ConditionalCase"] = 22] = "ConditionalCase";
|
|
7042
|
+
ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 23] = "DerivedRepeaterVar";
|
|
7038
7043
|
})(ExpressionKind || (ExpressionKind = {}));
|
|
7044
|
+
var VariableFlags;
|
|
7045
|
+
(function(VariableFlags2) {
|
|
7046
|
+
VariableFlags2[VariableFlags2["None"] = 0] = "None";
|
|
7047
|
+
VariableFlags2[VariableFlags2["AlwaysInline"] = 1] = "AlwaysInline";
|
|
7048
|
+
})(VariableFlags || (VariableFlags = {}));
|
|
7039
7049
|
var SemanticVariableKind;
|
|
7040
7050
|
(function(SemanticVariableKind2) {
|
|
7041
7051
|
SemanticVariableKind2[SemanticVariableKind2["Context"] = 0] = "Context";
|
|
7042
7052
|
SemanticVariableKind2[SemanticVariableKind2["Identifier"] = 1] = "Identifier";
|
|
7043
7053
|
SemanticVariableKind2[SemanticVariableKind2["SavedView"] = 2] = "SavedView";
|
|
7054
|
+
SemanticVariableKind2[SemanticVariableKind2["Alias"] = 3] = "Alias";
|
|
7044
7055
|
})(SemanticVariableKind || (SemanticVariableKind = {}));
|
|
7045
7056
|
var CompatibilityMode;
|
|
7046
7057
|
(function(CompatibilityMode2) {
|
|
@@ -7078,7 +7089,7 @@ var I18nParamResolutionTime;
|
|
|
7078
7089
|
I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
|
|
7079
7090
|
})(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
|
|
7080
7091
|
|
|
7081
|
-
// bazel-out/
|
|
7092
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
|
|
7082
7093
|
var ConsumesSlot = Symbol("ConsumesSlot");
|
|
7083
7094
|
var DependsOnSlotContext = Symbol("DependsOnSlotContext");
|
|
7084
7095
|
var UsesSlotIndex = Symbol("UsesSlotIndex");
|
|
@@ -7127,19 +7138,20 @@ function hasConstTrait(value) {
|
|
|
7127
7138
|
return value[HasConst] === true;
|
|
7128
7139
|
}
|
|
7129
7140
|
|
|
7130
|
-
// bazel-out/
|
|
7141
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
|
|
7131
7142
|
function createStatementOp(statement) {
|
|
7132
7143
|
return __spreadValues({
|
|
7133
7144
|
kind: OpKind.Statement,
|
|
7134
7145
|
statement
|
|
7135
7146
|
}, NEW_OP);
|
|
7136
7147
|
}
|
|
7137
|
-
function createVariableOp(xref, variable2, initializer) {
|
|
7148
|
+
function createVariableOp(xref, variable2, initializer, flags) {
|
|
7138
7149
|
return __spreadValues({
|
|
7139
7150
|
kind: OpKind.Variable,
|
|
7140
7151
|
xref,
|
|
7141
7152
|
variable: variable2,
|
|
7142
|
-
initializer
|
|
7153
|
+
initializer,
|
|
7154
|
+
flags
|
|
7143
7155
|
}, NEW_OP);
|
|
7144
7156
|
}
|
|
7145
7157
|
var NEW_OP = {
|
|
@@ -7148,7 +7160,7 @@ var NEW_OP = {
|
|
|
7148
7160
|
next: null
|
|
7149
7161
|
};
|
|
7150
7162
|
|
|
7151
|
-
// bazel-out/
|
|
7163
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
|
|
7152
7164
|
function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
|
|
7153
7165
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7154
7166
|
kind: OpKind.InterpolateText,
|
|
@@ -7257,6 +7269,14 @@ function createConditionalOp(target, test, conditions, sourceSpan) {
|
|
|
7257
7269
|
contextValue: null
|
|
7258
7270
|
}, NEW_OP), TRAIT_USES_SLOT_INDEX), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
|
|
7259
7271
|
}
|
|
7272
|
+
function createRepeaterOp(repeaterCreate2, collection, sourceSpan) {
|
|
7273
|
+
return __spreadValues(__spreadValues({
|
|
7274
|
+
kind: OpKind.Repeater,
|
|
7275
|
+
target: repeaterCreate2,
|
|
7276
|
+
collection,
|
|
7277
|
+
sourceSpan
|
|
7278
|
+
}, NEW_OP), TRAIT_USES_SLOT_INDEX);
|
|
7279
|
+
}
|
|
7260
7280
|
function createI18nExpressionOp(owner, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
|
|
7261
7281
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7262
7282
|
kind: OpKind.I18nExpression,
|
|
@@ -7283,7 +7303,7 @@ function createIcuUpdateOp(xref, sourceSpan) {
|
|
|
7283
7303
|
}, NEW_OP);
|
|
7284
7304
|
}
|
|
7285
7305
|
|
|
7286
|
-
// bazel-out/
|
|
7306
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
|
|
7287
7307
|
var _a;
|
|
7288
7308
|
var _b;
|
|
7289
7309
|
var _c;
|
|
@@ -7310,8 +7330,8 @@ var LexicalReadExpr = class extends ExpressionBase {
|
|
|
7310
7330
|
}
|
|
7311
7331
|
visitExpression(visitor, context) {
|
|
7312
7332
|
}
|
|
7313
|
-
isEquivalent() {
|
|
7314
|
-
return
|
|
7333
|
+
isEquivalent(other) {
|
|
7334
|
+
return this.name === other.name;
|
|
7315
7335
|
}
|
|
7316
7336
|
isConstant() {
|
|
7317
7337
|
return false;
|
|
@@ -7371,6 +7391,26 @@ var ContextExpr = class extends ExpressionBase {
|
|
|
7371
7391
|
return new ContextExpr(this.view);
|
|
7372
7392
|
}
|
|
7373
7393
|
};
|
|
7394
|
+
var TrackContextExpr = class extends ExpressionBase {
|
|
7395
|
+
constructor(view) {
|
|
7396
|
+
super();
|
|
7397
|
+
this.view = view;
|
|
7398
|
+
this.kind = ExpressionKind.TrackContext;
|
|
7399
|
+
}
|
|
7400
|
+
visitExpression() {
|
|
7401
|
+
}
|
|
7402
|
+
isEquivalent(e) {
|
|
7403
|
+
return e instanceof TrackContextExpr && e.view === this.view;
|
|
7404
|
+
}
|
|
7405
|
+
isConstant() {
|
|
7406
|
+
return false;
|
|
7407
|
+
}
|
|
7408
|
+
transformInternalExpressions() {
|
|
7409
|
+
}
|
|
7410
|
+
clone() {
|
|
7411
|
+
return new TrackContextExpr(this.view);
|
|
7412
|
+
}
|
|
7413
|
+
};
|
|
7374
7414
|
var NextContextExpr = class extends ExpressionBase {
|
|
7375
7415
|
constructor() {
|
|
7376
7416
|
super();
|
|
@@ -7885,6 +7925,34 @@ var ConditionalCaseExpr = class extends ExpressionBase {
|
|
|
7885
7925
|
}
|
|
7886
7926
|
}
|
|
7887
7927
|
};
|
|
7928
|
+
var DerivedRepeaterVarIdentity;
|
|
7929
|
+
(function(DerivedRepeaterVarIdentity2) {
|
|
7930
|
+
DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["First"] = 0] = "First";
|
|
7931
|
+
DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Last"] = 1] = "Last";
|
|
7932
|
+
DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Even"] = 2] = "Even";
|
|
7933
|
+
DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Odd"] = 3] = "Odd";
|
|
7934
|
+
})(DerivedRepeaterVarIdentity || (DerivedRepeaterVarIdentity = {}));
|
|
7935
|
+
var DerivedRepeaterVarExpr = class extends ExpressionBase {
|
|
7936
|
+
constructor(xref, identity) {
|
|
7937
|
+
super();
|
|
7938
|
+
this.xref = xref;
|
|
7939
|
+
this.identity = identity;
|
|
7940
|
+
this.kind = ExpressionKind.DerivedRepeaterVar;
|
|
7941
|
+
}
|
|
7942
|
+
transformInternalExpressions(transform2, flags) {
|
|
7943
|
+
}
|
|
7944
|
+
visitExpression(visitor, context) {
|
|
7945
|
+
}
|
|
7946
|
+
isEquivalent(e) {
|
|
7947
|
+
return e instanceof DerivedRepeaterVarExpr && e.identity === this.identity && e.xref === this.xref;
|
|
7948
|
+
}
|
|
7949
|
+
isConstant() {
|
|
7950
|
+
return false;
|
|
7951
|
+
}
|
|
7952
|
+
clone() {
|
|
7953
|
+
return new DerivedRepeaterVarExpr(this.xref, this.identity);
|
|
7954
|
+
}
|
|
7955
|
+
};
|
|
7888
7956
|
function visitExpressionsInOp(op, visitor) {
|
|
7889
7957
|
transformExpressionsInOp(op, (expr, flags) => {
|
|
7890
7958
|
visitor(expr, flags);
|
|
@@ -7964,6 +8032,15 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
7964
8032
|
transformExpressionsInStatement(statement, transform2, flags);
|
|
7965
8033
|
}
|
|
7966
8034
|
break;
|
|
8035
|
+
case OpKind.RepeaterCreate:
|
|
8036
|
+
op.track = transformExpressionsInExpression(op.track, transform2, flags);
|
|
8037
|
+
if (op.trackByFn !== null) {
|
|
8038
|
+
op.trackByFn = transformExpressionsInExpression(op.trackByFn, transform2, flags);
|
|
8039
|
+
}
|
|
8040
|
+
break;
|
|
8041
|
+
case OpKind.Repeater:
|
|
8042
|
+
op.collection = transformExpressionsInExpression(op.collection, transform2, flags);
|
|
8043
|
+
break;
|
|
7967
8044
|
case OpKind.I18n:
|
|
7968
8045
|
case OpKind.I18nStart:
|
|
7969
8046
|
for (const [placeholder, expression] of op.params) {
|
|
@@ -8073,7 +8150,7 @@ function isStringLiteral(expr) {
|
|
|
8073
8150
|
return expr instanceof LiteralExpr && typeof expr.value === "string";
|
|
8074
8151
|
}
|
|
8075
8152
|
|
|
8076
|
-
// bazel-out/
|
|
8153
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
|
|
8077
8154
|
var _OpList = class {
|
|
8078
8155
|
constructor() {
|
|
8079
8156
|
this.debugListId = _OpList.nextListId++;
|
|
@@ -8264,14 +8341,14 @@ var OpList = _OpList;
|
|
|
8264
8341
|
_OpList.nextListId = 0;
|
|
8265
8342
|
})();
|
|
8266
8343
|
|
|
8267
|
-
// bazel-out/
|
|
8344
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
|
|
8268
8345
|
var elementContainerOpKinds = /* @__PURE__ */ new Set([
|
|
8269
8346
|
OpKind.Element,
|
|
8270
8347
|
OpKind.ElementStart,
|
|
8271
8348
|
OpKind.Container,
|
|
8272
8349
|
OpKind.ContainerStart,
|
|
8273
8350
|
OpKind.Template,
|
|
8274
|
-
OpKind.
|
|
8351
|
+
OpKind.RepeaterCreate
|
|
8275
8352
|
]);
|
|
8276
8353
|
function isElementOrContainerOp(op) {
|
|
8277
8354
|
return elementContainerOpKinds.has(op.kind);
|
|
@@ -8305,6 +8382,27 @@ function createTemplateOp(xref, tag, namespace, generatedInBlock, i18nPlaceholde
|
|
|
8305
8382
|
sourceSpan
|
|
8306
8383
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
8307
8384
|
}
|
|
8385
|
+
function createRepeaterCreateOp(primaryView, emptyView, track, varNames, sourceSpan) {
|
|
8386
|
+
return __spreadProps(__spreadValues(__spreadValues({
|
|
8387
|
+
kind: OpKind.RepeaterCreate,
|
|
8388
|
+
attributes: null,
|
|
8389
|
+
xref: primaryView,
|
|
8390
|
+
emptyView,
|
|
8391
|
+
track,
|
|
8392
|
+
trackByFn: null,
|
|
8393
|
+
tag: "For",
|
|
8394
|
+
namespace: Namespace.HTML,
|
|
8395
|
+
nonBindable: false,
|
|
8396
|
+
localRefs: [],
|
|
8397
|
+
decls: null,
|
|
8398
|
+
vars: null,
|
|
8399
|
+
varNames,
|
|
8400
|
+
usesComponentInstance: false,
|
|
8401
|
+
sourceSpan
|
|
8402
|
+
}, TRAIT_CONSUMES_SLOT), NEW_OP), {
|
|
8403
|
+
numSlotsUsed: emptyView === null ? 2 : 3
|
|
8404
|
+
});
|
|
8405
|
+
}
|
|
8308
8406
|
function createElementEndOp(xref, sourceSpan) {
|
|
8309
8407
|
return __spreadValues({
|
|
8310
8408
|
kind: OpKind.ElementEnd,
|
|
@@ -8372,16 +8470,15 @@ function createProjectionDefOp(def) {
|
|
|
8372
8470
|
def
|
|
8373
8471
|
}, NEW_OP);
|
|
8374
8472
|
}
|
|
8375
|
-
function createProjectionOp(xref, selector) {
|
|
8473
|
+
function createProjectionOp(xref, selector, sourceSpan) {
|
|
8376
8474
|
return __spreadValues(__spreadValues({
|
|
8377
8475
|
kind: OpKind.Projection,
|
|
8378
8476
|
xref,
|
|
8379
8477
|
selector,
|
|
8380
8478
|
projectionSlotIndex: 0,
|
|
8381
|
-
attributes:
|
|
8479
|
+
attributes: [],
|
|
8382
8480
|
localRefs: [],
|
|
8383
|
-
|
|
8384
|
-
sourceSpan: null
|
|
8481
|
+
sourceSpan
|
|
8385
8482
|
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
8386
8483
|
}
|
|
8387
8484
|
function createExtractedAttributeOp(target, bindingKind, name, expression) {
|
|
@@ -8463,7 +8560,7 @@ function literalOrArrayLiteral(value) {
|
|
|
8463
8560
|
return literal(value, INFERRED_TYPE);
|
|
8464
8561
|
}
|
|
8465
8562
|
|
|
8466
|
-
// bazel-out/
|
|
8563
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
|
|
8467
8564
|
function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
|
|
8468
8565
|
return __spreadValues(__spreadValues({
|
|
8469
8566
|
kind: OpKind.HostProperty,
|
|
@@ -8474,10 +8571,10 @@ function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan)
|
|
|
8474
8571
|
}, TRAIT_CONSUMES_VARS), NEW_OP);
|
|
8475
8572
|
}
|
|
8476
8573
|
|
|
8477
|
-
// bazel-out/
|
|
8574
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
|
|
8478
8575
|
var CTX_REF = "CTX_REF_MARKER";
|
|
8479
8576
|
|
|
8480
|
-
// bazel-out/
|
|
8577
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
|
|
8481
8578
|
var CompilationJobKind;
|
|
8482
8579
|
(function(CompilationJobKind2) {
|
|
8483
8580
|
CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
|
|
@@ -8560,6 +8657,7 @@ var ViewCompilationUnit = class extends CompilationUnit {
|
|
|
8560
8657
|
this.job = job;
|
|
8561
8658
|
this.parent = parent;
|
|
8562
8659
|
this.contextVariables = /* @__PURE__ */ new Map();
|
|
8660
|
+
this.aliases = /* @__PURE__ */ new Set();
|
|
8563
8661
|
this.decls = null;
|
|
8564
8662
|
}
|
|
8565
8663
|
};
|
|
@@ -8582,107 +8680,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
|
|
|
8582
8680
|
}
|
|
8583
8681
|
};
|
|
8584
8682
|
|
|
8585
|
-
// bazel-out/
|
|
8586
|
-
function phaseVarCounting(job) {
|
|
8587
|
-
for (const unit of job.units) {
|
|
8588
|
-
let varCount = 0;
|
|
8589
|
-
for (const op of unit.ops()) {
|
|
8590
|
-
if (hasConsumesVarsTrait(op)) {
|
|
8591
|
-
varCount += varsUsedByOp(op);
|
|
8592
|
-
}
|
|
8593
|
-
}
|
|
8594
|
-
for (const op of unit.ops()) {
|
|
8595
|
-
visitExpressionsInOp(op, (expr) => {
|
|
8596
|
-
if (!isIrExpression(expr)) {
|
|
8597
|
-
return;
|
|
8598
|
-
}
|
|
8599
|
-
if (hasUsesVarOffsetTrait(expr)) {
|
|
8600
|
-
expr.varOffset = varCount;
|
|
8601
|
-
}
|
|
8602
|
-
if (hasConsumesVarsTrait(expr)) {
|
|
8603
|
-
varCount += varsUsedByIrExpression(expr);
|
|
8604
|
-
}
|
|
8605
|
-
});
|
|
8606
|
-
}
|
|
8607
|
-
unit.vars = varCount;
|
|
8608
|
-
}
|
|
8609
|
-
if (job instanceof ComponentCompilationJob) {
|
|
8610
|
-
for (const unit of job.units) {
|
|
8611
|
-
for (const op of unit.create) {
|
|
8612
|
-
if (op.kind !== OpKind.Template) {
|
|
8613
|
-
continue;
|
|
8614
|
-
}
|
|
8615
|
-
const childView = job.views.get(op.xref);
|
|
8616
|
-
op.vars = childView.vars;
|
|
8617
|
-
}
|
|
8618
|
-
}
|
|
8619
|
-
}
|
|
8620
|
-
}
|
|
8621
|
-
function varsUsedByOp(op) {
|
|
8622
|
-
let slots;
|
|
8623
|
-
switch (op.kind) {
|
|
8624
|
-
case OpKind.Property:
|
|
8625
|
-
case OpKind.HostProperty:
|
|
8626
|
-
case OpKind.Attribute:
|
|
8627
|
-
slots = 1;
|
|
8628
|
-
if (op.expression instanceof Interpolation2) {
|
|
8629
|
-
slots += op.expression.expressions.length;
|
|
8630
|
-
}
|
|
8631
|
-
return slots;
|
|
8632
|
-
case OpKind.StyleProp:
|
|
8633
|
-
case OpKind.ClassProp:
|
|
8634
|
-
case OpKind.StyleMap:
|
|
8635
|
-
case OpKind.ClassMap:
|
|
8636
|
-
slots = 2;
|
|
8637
|
-
if (op.expression instanceof Interpolation2) {
|
|
8638
|
-
slots += op.expression.expressions.length;
|
|
8639
|
-
}
|
|
8640
|
-
return slots;
|
|
8641
|
-
case OpKind.InterpolateText:
|
|
8642
|
-
return op.interpolation.expressions.length;
|
|
8643
|
-
case OpKind.I18nExpression:
|
|
8644
|
-
case OpKind.Conditional:
|
|
8645
|
-
return 1;
|
|
8646
|
-
default:
|
|
8647
|
-
throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
|
|
8648
|
-
}
|
|
8649
|
-
}
|
|
8650
|
-
function varsUsedByIrExpression(expr) {
|
|
8651
|
-
switch (expr.kind) {
|
|
8652
|
-
case ExpressionKind.PureFunctionExpr:
|
|
8653
|
-
return 1 + expr.args.length;
|
|
8654
|
-
case ExpressionKind.PipeBinding:
|
|
8655
|
-
return 1 + expr.args.length;
|
|
8656
|
-
case ExpressionKind.PipeBindingVariadic:
|
|
8657
|
-
return 1 + expr.numArgs;
|
|
8658
|
-
default:
|
|
8659
|
-
throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
|
|
8660
|
-
}
|
|
8661
|
-
}
|
|
8662
|
-
|
|
8663
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/align_pipe_variadic_var_offset.mjs
|
|
8664
|
-
function phaseAlignPipeVariadicVarOffset(job) {
|
|
8665
|
-
for (const unit of job.units) {
|
|
8666
|
-
for (const op of unit.update) {
|
|
8667
|
-
visitExpressionsInOp(op, (expr) => {
|
|
8668
|
-
if (!(expr instanceof PipeBindingVariadicExpr)) {
|
|
8669
|
-
return expr;
|
|
8670
|
-
}
|
|
8671
|
-
if (!(expr.args instanceof PureFunctionExpr)) {
|
|
8672
|
-
return expr;
|
|
8673
|
-
}
|
|
8674
|
-
if (expr.varOffset === null || expr.args.varOffset === null) {
|
|
8675
|
-
throw new Error(`Must run after variable counting`);
|
|
8676
|
-
}
|
|
8677
|
-
expr.varOffset = expr.args.varOffset;
|
|
8678
|
-
expr.args.varOffset = expr.varOffset + varsUsedByIrExpression(expr);
|
|
8679
|
-
return void 0;
|
|
8680
|
-
});
|
|
8681
|
-
}
|
|
8682
|
-
}
|
|
8683
|
-
}
|
|
8684
|
-
|
|
8685
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
|
|
8683
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
|
|
8686
8684
|
function phaseFindAnyCasts(job) {
|
|
8687
8685
|
for (const unit of job.units) {
|
|
8688
8686
|
for (const op of unit.ops()) {
|
|
@@ -8700,7 +8698,7 @@ function removeAnys(e) {
|
|
|
8700
8698
|
return e;
|
|
8701
8699
|
}
|
|
8702
8700
|
|
|
8703
|
-
// bazel-out/
|
|
8701
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
|
|
8704
8702
|
function phaseApplyI18nExpressions(job) {
|
|
8705
8703
|
for (const unit of job.units) {
|
|
8706
8704
|
for (const op of unit.update) {
|
|
@@ -8721,7 +8719,7 @@ function needsApplication(op) {
|
|
|
8721
8719
|
return false;
|
|
8722
8720
|
}
|
|
8723
8721
|
|
|
8724
|
-
// bazel-out/
|
|
8722
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
|
|
8725
8723
|
function phaseAssignI18nSlotDependencies(job) {
|
|
8726
8724
|
const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
|
|
8727
8725
|
let lastSlotConsumer = null;
|
|
@@ -8742,22 +8740,34 @@ function phaseAssignI18nSlotDependencies(job) {
|
|
|
8742
8740
|
}
|
|
8743
8741
|
}
|
|
8744
8742
|
|
|
8745
|
-
// bazel-out/
|
|
8746
|
-
function
|
|
8747
|
-
const
|
|
8743
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
|
|
8744
|
+
function phaseCollapseSingletonInterpolations(job) {
|
|
8745
|
+
for (const unit of job.units) {
|
|
8746
|
+
for (const op of unit.update) {
|
|
8747
|
+
const eligibleOpKind = op.kind === OpKind.Attribute;
|
|
8748
|
+
if (eligibleOpKind && op.expression instanceof Interpolation2 && op.expression.strings.length === 2 && op.expression.strings.every((s) => s === "")) {
|
|
8749
|
+
op.expression = op.expression.expressions[0];
|
|
8750
|
+
}
|
|
8751
|
+
}
|
|
8752
|
+
}
|
|
8753
|
+
}
|
|
8754
|
+
|
|
8755
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
|
|
8756
|
+
function createOpXrefMap(unit) {
|
|
8757
|
+
const map = /* @__PURE__ */ new Map();
|
|
8748
8758
|
for (const op of unit.create) {
|
|
8749
|
-
if (!
|
|
8759
|
+
if (!hasConsumesSlotTrait(op)) {
|
|
8750
8760
|
continue;
|
|
8751
8761
|
}
|
|
8752
|
-
|
|
8762
|
+
map.set(op.xref, op);
|
|
8753
8763
|
}
|
|
8754
|
-
return
|
|
8764
|
+
return map;
|
|
8755
8765
|
}
|
|
8756
8766
|
|
|
8757
|
-
// bazel-out/
|
|
8767
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
|
|
8758
8768
|
function phaseAttributeExtraction(job) {
|
|
8759
8769
|
for (const unit of job.units) {
|
|
8760
|
-
const elements =
|
|
8770
|
+
const elements = createOpXrefMap(unit);
|
|
8761
8771
|
for (const op of unit.ops()) {
|
|
8762
8772
|
switch (op.kind) {
|
|
8763
8773
|
case OpKind.Attribute:
|
|
@@ -8821,7 +8831,7 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
8821
8831
|
}
|
|
8822
8832
|
}
|
|
8823
8833
|
|
|
8824
|
-
// bazel-out/
|
|
8834
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
|
|
8825
8835
|
function lookupElement2(elements, xref) {
|
|
8826
8836
|
const el = elements.get(xref);
|
|
8827
8837
|
if (el === void 0) {
|
|
@@ -8871,7 +8881,7 @@ function phaseBindingSpecialization(job) {
|
|
|
8871
8881
|
}
|
|
8872
8882
|
}
|
|
8873
8883
|
|
|
8874
|
-
// bazel-out/
|
|
8884
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
|
|
8875
8885
|
var CHAINABLE = /* @__PURE__ */ new Set([
|
|
8876
8886
|
Identifiers.attribute,
|
|
8877
8887
|
Identifiers.classProp,
|
|
@@ -8937,7 +8947,7 @@ function chainOperationsInList(opList) {
|
|
|
8937
8947
|
}
|
|
8938
8948
|
}
|
|
8939
8949
|
|
|
8940
|
-
// bazel-out/
|
|
8950
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
|
|
8941
8951
|
function phaseConditionals(job) {
|
|
8942
8952
|
for (const unit of job.units) {
|
|
8943
8953
|
for (const op of unit.ops()) {
|
|
@@ -8969,11 +8979,12 @@ function phaseConditionals(job) {
|
|
|
8969
8979
|
test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.target), test);
|
|
8970
8980
|
}
|
|
8971
8981
|
op.processed = test;
|
|
8982
|
+
op.conditions = [];
|
|
8972
8983
|
}
|
|
8973
8984
|
}
|
|
8974
8985
|
}
|
|
8975
8986
|
|
|
8976
|
-
// bazel-out/
|
|
8987
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
|
|
8977
8988
|
var TagContentType;
|
|
8978
8989
|
(function(TagContentType2) {
|
|
8979
8990
|
TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
|
|
@@ -9006,7 +9017,7 @@ function mergeNsAndName(prefix, localName) {
|
|
|
9006
9017
|
return prefix ? `:${prefix}:${localName}` : localName;
|
|
9007
9018
|
}
|
|
9008
9019
|
|
|
9009
|
-
// bazel-out/
|
|
9020
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
|
|
9010
9021
|
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
9011
9022
|
["&&", BinaryOperator.And],
|
|
9012
9023
|
[">", BinaryOperator.Bigger],
|
|
@@ -9056,7 +9067,7 @@ function literalOrArrayLiteral2(value) {
|
|
|
9056
9067
|
return literal(value, INFERRED_TYPE);
|
|
9057
9068
|
}
|
|
9058
9069
|
|
|
9059
|
-
// bazel-out/
|
|
9070
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
|
|
9060
9071
|
function phaseConstCollection(job) {
|
|
9061
9072
|
const allElementAttributes = /* @__PURE__ */ new Map();
|
|
9062
9073
|
for (const unit of job.units) {
|
|
@@ -9190,7 +9201,7 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
|
|
|
9190
9201
|
return literalArr(attrArray);
|
|
9191
9202
|
}
|
|
9192
9203
|
|
|
9193
|
-
// bazel-out/
|
|
9204
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
|
|
9194
9205
|
var REPLACEMENTS = /* @__PURE__ */ new Map([
|
|
9195
9206
|
[OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
|
|
9196
9207
|
[OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
|
|
@@ -9217,7 +9228,7 @@ function phaseEmptyElements(job) {
|
|
|
9217
9228
|
}
|
|
9218
9229
|
}
|
|
9219
9230
|
|
|
9220
|
-
// bazel-out/
|
|
9231
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
|
|
9221
9232
|
function phaseExpandSafeReads(job) {
|
|
9222
9233
|
for (const unit of job.units) {
|
|
9223
9234
|
for (const op of unit.ops()) {
|
|
@@ -9353,7 +9364,39 @@ function ternaryTransform(e) {
|
|
|
9353
9364
|
return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
|
|
9354
9365
|
}
|
|
9355
9366
|
|
|
9356
|
-
// bazel-out/
|
|
9367
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
|
|
9368
|
+
function phaseRepeaterDerivedVars(job) {
|
|
9369
|
+
const repeaters = /* @__PURE__ */ new Map();
|
|
9370
|
+
for (const unit of job.units) {
|
|
9371
|
+
for (const op of unit.ops()) {
|
|
9372
|
+
if (op.kind === OpKind.RepeaterCreate) {
|
|
9373
|
+
repeaters.set(op.xref, op);
|
|
9374
|
+
}
|
|
9375
|
+
}
|
|
9376
|
+
}
|
|
9377
|
+
for (const unit of job.units) {
|
|
9378
|
+
for (const op of unit.ops()) {
|
|
9379
|
+
transformExpressionsInOp(op, (expr) => {
|
|
9380
|
+
if (!(expr instanceof DerivedRepeaterVarExpr)) {
|
|
9381
|
+
return expr;
|
|
9382
|
+
}
|
|
9383
|
+
const repeaterOp = repeaters.get(expr.xref);
|
|
9384
|
+
switch (expr.identity) {
|
|
9385
|
+
case DerivedRepeaterVarIdentity.First:
|
|
9386
|
+
return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), literal(0));
|
|
9387
|
+
case DerivedRepeaterVarIdentity.Last:
|
|
9388
|
+
return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), new BinaryOperatorExpr(BinaryOperator.Minus, new LexicalReadExpr(repeaterOp.varNames.$count), literal(1)));
|
|
9389
|
+
case DerivedRepeaterVarIdentity.Even:
|
|
9390
|
+
return new BinaryOperatorExpr(BinaryOperator.Identical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
|
|
9391
|
+
case DerivedRepeaterVarIdentity.Odd:
|
|
9392
|
+
return new BinaryOperatorExpr(BinaryOperator.NotIdentical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
|
|
9393
|
+
}
|
|
9394
|
+
}, VisitorContextFlag.None);
|
|
9395
|
+
}
|
|
9396
|
+
}
|
|
9397
|
+
}
|
|
9398
|
+
|
|
9399
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
|
|
9357
9400
|
function phaseGenerateAdvance(job) {
|
|
9358
9401
|
for (const unit of job.units) {
|
|
9359
9402
|
const slotMap = /* @__PURE__ */ new Map();
|
|
@@ -9385,7 +9428,7 @@ function phaseGenerateAdvance(job) {
|
|
|
9385
9428
|
}
|
|
9386
9429
|
}
|
|
9387
9430
|
|
|
9388
|
-
// bazel-out/
|
|
9431
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
|
|
9389
9432
|
function phaseGenerateProjectionDef(job) {
|
|
9390
9433
|
const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
|
|
9391
9434
|
const selectors = [];
|
|
@@ -9409,7 +9452,7 @@ function phaseGenerateProjectionDef(job) {
|
|
|
9409
9452
|
}
|
|
9410
9453
|
}
|
|
9411
9454
|
|
|
9412
|
-
// bazel-out/
|
|
9455
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
|
|
9413
9456
|
function phaseGenerateVariables(job) {
|
|
9414
9457
|
recursivelyProcessView(job.root, null);
|
|
9415
9458
|
}
|
|
@@ -9418,6 +9461,7 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
9418
9461
|
for (const op of view.create) {
|
|
9419
9462
|
switch (op.kind) {
|
|
9420
9463
|
case OpKind.Template:
|
|
9464
|
+
case OpKind.RepeaterCreate:
|
|
9421
9465
|
recursivelyProcessView(view.job.views.get(op.xref), scope);
|
|
9422
9466
|
break;
|
|
9423
9467
|
case OpKind.Listener:
|
|
@@ -9437,6 +9481,7 @@ function getScopeForView(view, parent) {
|
|
|
9437
9481
|
view: view.xref
|
|
9438
9482
|
},
|
|
9439
9483
|
contextVariables: /* @__PURE__ */ new Map(),
|
|
9484
|
+
aliases: view.aliases,
|
|
9440
9485
|
references: [],
|
|
9441
9486
|
parent
|
|
9442
9487
|
};
|
|
@@ -9474,15 +9519,19 @@ function getScopeForView(view, parent) {
|
|
|
9474
9519
|
function generateVariablesInScopeForView(view, scope) {
|
|
9475
9520
|
const newOps = [];
|
|
9476
9521
|
if (scope.view !== view.xref) {
|
|
9477
|
-
newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr()));
|
|
9522
|
+
newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr(), VariableFlags.None));
|
|
9478
9523
|
}
|
|
9479
|
-
|
|
9524
|
+
const scopeView = view.job.views.get(scope.view);
|
|
9525
|
+
for (const [name, value] of scopeView.contextVariables) {
|
|
9480
9526
|
const context = new ContextExpr(scope.view);
|
|
9481
9527
|
const variable2 = value === CTX_REF ? context : new ReadPropExpr(context, value);
|
|
9482
|
-
newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable2));
|
|
9528
|
+
newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable2, VariableFlags.None));
|
|
9529
|
+
}
|
|
9530
|
+
for (const alias of scopeView.aliases) {
|
|
9531
|
+
newOps.push(createVariableOp(view.job.allocateXrefId(), alias, alias.expression.clone(), VariableFlags.AlwaysInline));
|
|
9483
9532
|
}
|
|
9484
9533
|
for (const ref of scope.references) {
|
|
9485
|
-
newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.offset)));
|
|
9534
|
+
newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.offset), VariableFlags.None));
|
|
9486
9535
|
}
|
|
9487
9536
|
if (scope.parent !== null) {
|
|
9488
9537
|
newOps.push(...generateVariablesInScopeForView(view, scope.parent));
|
|
@@ -9490,7 +9539,7 @@ function generateVariablesInScopeForView(view, scope) {
|
|
|
9490
9539
|
return newOps;
|
|
9491
9540
|
}
|
|
9492
9541
|
|
|
9493
|
-
// bazel-out/
|
|
9542
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_trait_collection.mjs
|
|
9494
9543
|
function phaseConstTraitCollection(job) {
|
|
9495
9544
|
const collectGlobalConsts = (e) => {
|
|
9496
9545
|
if (e instanceof ExpressionBase && hasConstTrait(e)) {
|
|
@@ -9511,7 +9560,7 @@ function phaseConstTraitCollection(job) {
|
|
|
9511
9560
|
}
|
|
9512
9561
|
}
|
|
9513
9562
|
|
|
9514
|
-
// bazel-out/
|
|
9563
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
|
|
9515
9564
|
var STYLE_DOT = "style.";
|
|
9516
9565
|
var CLASS_DOT = "class.";
|
|
9517
9566
|
var STYLE_BANG = "style!";
|
|
@@ -9569,7 +9618,7 @@ function parseProperty(name) {
|
|
|
9569
9618
|
return { property: property2, suffix };
|
|
9570
9619
|
}
|
|
9571
9620
|
|
|
9572
|
-
// bazel-out/
|
|
9621
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
|
|
9573
9622
|
function phaseI18nConstCollection(job) {
|
|
9574
9623
|
const messageConstIndices = {};
|
|
9575
9624
|
for (const unit of job.units) {
|
|
@@ -9589,7 +9638,7 @@ function phaseI18nConstCollection(job) {
|
|
|
9589
9638
|
}
|
|
9590
9639
|
}
|
|
9591
9640
|
|
|
9592
|
-
// bazel-out/
|
|
9641
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
|
|
9593
9642
|
function mapLiteral(obj, quoted = false) {
|
|
9594
9643
|
return literalMap(Object.keys(obj).map((key) => ({
|
|
9595
9644
|
key,
|
|
@@ -9598,7 +9647,7 @@ function mapLiteral(obj, quoted = false) {
|
|
|
9598
9647
|
})));
|
|
9599
9648
|
}
|
|
9600
9649
|
|
|
9601
|
-
// bazel-out/
|
|
9650
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
|
|
9602
9651
|
var IcuSerializerVisitor = class {
|
|
9603
9652
|
visitText(text2) {
|
|
9604
9653
|
return text2.value;
|
|
@@ -9629,7 +9678,7 @@ function serializeIcuNode(icu) {
|
|
|
9629
9678
|
return icu.visit(serializer);
|
|
9630
9679
|
}
|
|
9631
9680
|
|
|
9632
|
-
// bazel-out/
|
|
9681
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
|
|
9633
9682
|
var TokenType;
|
|
9634
9683
|
(function(TokenType2) {
|
|
9635
9684
|
TokenType2[TokenType2["Character"] = 0] = "Character";
|
|
@@ -9990,7 +10039,7 @@ function parseIntAutoRadix(text2) {
|
|
|
9990
10039
|
return result;
|
|
9991
10040
|
}
|
|
9992
10041
|
|
|
9993
|
-
// bazel-out/
|
|
10042
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
|
|
9994
10043
|
var SplitInterpolation = class {
|
|
9995
10044
|
constructor(strings, expressions, offsets) {
|
|
9996
10045
|
this.strings = strings;
|
|
@@ -10884,7 +10933,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
|
|
|
10884
10933
|
return offsetMap;
|
|
10885
10934
|
}
|
|
10886
10935
|
|
|
10887
|
-
// bazel-out/
|
|
10936
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
|
|
10888
10937
|
var NodeWithI18n = class {
|
|
10889
10938
|
constructor(sourceSpan, i18n2) {
|
|
10890
10939
|
this.sourceSpan = sourceSpan;
|
|
@@ -10961,11 +11010,12 @@ var Comment2 = class {
|
|
|
10961
11010
|
}
|
|
10962
11011
|
};
|
|
10963
11012
|
var Block = class {
|
|
10964
|
-
constructor(name, parameters, children, sourceSpan, startSourceSpan, endSourceSpan = null) {
|
|
11013
|
+
constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null) {
|
|
10965
11014
|
this.name = name;
|
|
10966
11015
|
this.parameters = parameters;
|
|
10967
11016
|
this.children = children;
|
|
10968
11017
|
this.sourceSpan = sourceSpan;
|
|
11018
|
+
this.nameSpan = nameSpan;
|
|
10969
11019
|
this.startSourceSpan = startSourceSpan;
|
|
10970
11020
|
this.endSourceSpan = endSourceSpan;
|
|
10971
11021
|
}
|
|
@@ -11035,11 +11085,11 @@ var RecursiveVisitor = class {
|
|
|
11035
11085
|
}
|
|
11036
11086
|
};
|
|
11037
11087
|
|
|
11038
|
-
// bazel-out/
|
|
11088
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
|
|
11039
11089
|
var ElementSchemaRegistry = class {
|
|
11040
11090
|
};
|
|
11041
11091
|
|
|
11042
|
-
// bazel-out/
|
|
11092
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
|
|
11043
11093
|
var BOOLEAN = "boolean";
|
|
11044
11094
|
var NUMBER = "number";
|
|
11045
11095
|
var STRING = "string";
|
|
@@ -11392,7 +11442,7 @@ function _isPixelDimensionStyle(prop) {
|
|
|
11392
11442
|
}
|
|
11393
11443
|
}
|
|
11394
11444
|
|
|
11395
|
-
// bazel-out/
|
|
11445
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
|
|
11396
11446
|
var HtmlTagDefinition = class {
|
|
11397
11447
|
constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
|
|
11398
11448
|
this.closedByChildren = {};
|
|
@@ -11510,7 +11560,7 @@ function getHtmlTagDefinition(tagName) {
|
|
|
11510
11560
|
return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
|
|
11511
11561
|
}
|
|
11512
11562
|
|
|
11513
|
-
// bazel-out/
|
|
11563
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
|
|
11514
11564
|
var TAG_TO_PLACEHOLDER_NAMES = {
|
|
11515
11565
|
"A": "LINK",
|
|
11516
11566
|
"B": "BOLD_TEXT",
|
|
@@ -11604,7 +11654,7 @@ var PlaceholderRegistry = class {
|
|
|
11604
11654
|
}
|
|
11605
11655
|
};
|
|
11606
11656
|
|
|
11607
|
-
// bazel-out/
|
|
11657
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
|
|
11608
11658
|
var _expParser = new Parser(new Lexer());
|
|
11609
11659
|
function createI18nMessageFactory(interpolationConfig) {
|
|
11610
11660
|
const visitor = new _I18nVisitor(_expParser, interpolationConfig);
|
|
@@ -11766,14 +11816,14 @@ function extractPlaceholderName(input) {
|
|
|
11766
11816
|
return input.split(_CUSTOM_PH_EXP)[2];
|
|
11767
11817
|
}
|
|
11768
11818
|
|
|
11769
|
-
// bazel-out/
|
|
11819
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
|
|
11770
11820
|
var I18nError = class extends ParseError {
|
|
11771
11821
|
constructor(span, msg) {
|
|
11772
11822
|
super(span, msg);
|
|
11773
11823
|
}
|
|
11774
11824
|
};
|
|
11775
11825
|
|
|
11776
|
-
// bazel-out/
|
|
11826
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
|
|
11777
11827
|
var NAMED_ENTITIES = {
|
|
11778
11828
|
"AElig": "\xC6",
|
|
11779
11829
|
"AMP": "&",
|
|
@@ -13904,7 +13954,7 @@ var NAMED_ENTITIES = {
|
|
|
13904
13954
|
var NGSP_UNICODE = "\uE500";
|
|
13905
13955
|
NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
|
|
13906
13956
|
|
|
13907
|
-
// bazel-out/
|
|
13957
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
|
|
13908
13958
|
var TokenError = class extends ParseError {
|
|
13909
13959
|
constructor(errorMsg, tokenType, span) {
|
|
13910
13960
|
super(span, errorMsg);
|
|
@@ -14538,7 +14588,7 @@ var _Tokenizer = class {
|
|
|
14538
14588
|
return true;
|
|
14539
14589
|
}
|
|
14540
14590
|
}
|
|
14541
|
-
if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this.
|
|
14591
|
+
if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this._cursor.peek() === $AT || this._cursor.peek() === $RBRACE)) {
|
|
14542
14592
|
return true;
|
|
14543
14593
|
}
|
|
14544
14594
|
return false;
|
|
@@ -14554,16 +14604,6 @@ var _Tokenizer = class {
|
|
|
14554
14604
|
}
|
|
14555
14605
|
return false;
|
|
14556
14606
|
}
|
|
14557
|
-
_isBlockStart() {
|
|
14558
|
-
if (this._tokenizeBlocks && this._cursor.peek() === $AT) {
|
|
14559
|
-
const tmp = this._cursor.clone();
|
|
14560
|
-
tmp.advance();
|
|
14561
|
-
if (isBlockNameChar(tmp.peek())) {
|
|
14562
|
-
return true;
|
|
14563
|
-
}
|
|
14564
|
-
}
|
|
14565
|
-
return false;
|
|
14566
|
-
}
|
|
14567
14607
|
_readUntil(char) {
|
|
14568
14608
|
const start = this._cursor.clone();
|
|
14569
14609
|
this._attemptUntilChar(char);
|
|
@@ -14835,7 +14875,7 @@ var CursorError = class {
|
|
|
14835
14875
|
}
|
|
14836
14876
|
};
|
|
14837
14877
|
|
|
14838
|
-
// bazel-out/
|
|
14878
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
|
|
14839
14879
|
var TreeError = class extends ParseError {
|
|
14840
14880
|
static create(elementName, span, msg) {
|
|
14841
14881
|
return new TreeError(elementName, span, msg);
|
|
@@ -15148,7 +15188,7 @@ var _TreeBuilder = class {
|
|
|
15148
15188
|
const end = this._peek.sourceSpan.fullStart;
|
|
15149
15189
|
const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
|
|
15150
15190
|
const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
|
|
15151
|
-
const block = new Block(token.parts[0], parameters, [], span, startSpan);
|
|
15191
|
+
const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
|
|
15152
15192
|
this._pushContainer(block, false);
|
|
15153
15193
|
}
|
|
15154
15194
|
_consumeBlockClose(token) {
|
|
@@ -15165,7 +15205,7 @@ var _TreeBuilder = class {
|
|
|
15165
15205
|
const end = this._peek.sourceSpan.fullStart;
|
|
15166
15206
|
const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
|
|
15167
15207
|
const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
|
|
15168
|
-
const block = new Block(token.parts[0], parameters, [], span, startSpan);
|
|
15208
|
+
const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
|
|
15169
15209
|
this._pushContainer(block, false);
|
|
15170
15210
|
this._popContainer(null, Block, null);
|
|
15171
15211
|
this.errors.push(TreeError.create(token.parts[0], span, `Incomplete block "${token.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`));
|
|
@@ -15219,7 +15259,7 @@ function decodeEntity(match, entity) {
|
|
|
15219
15259
|
return match;
|
|
15220
15260
|
}
|
|
15221
15261
|
|
|
15222
|
-
// bazel-out/
|
|
15262
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
|
|
15223
15263
|
var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
|
|
15224
15264
|
"iframe|srcdoc",
|
|
15225
15265
|
"*|innerhtml",
|
|
@@ -15234,7 +15274,7 @@ function isTrustedTypesSink(tagName, propName) {
|
|
|
15234
15274
|
return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
|
|
15235
15275
|
}
|
|
15236
15276
|
|
|
15237
|
-
// bazel-out/
|
|
15277
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
|
|
15238
15278
|
var setI18nRefs = (htmlNode, i18nNode) => {
|
|
15239
15279
|
if (htmlNode instanceof NodeWithI18n) {
|
|
15240
15280
|
if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
|
|
@@ -15390,7 +15430,7 @@ function i18nMetaToJSDoc(meta) {
|
|
|
15390
15430
|
return jsDocComment(tags);
|
|
15391
15431
|
}
|
|
15392
15432
|
|
|
15393
|
-
// bazel-out/
|
|
15433
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
|
|
15394
15434
|
var GOOG_GET_MSG = "goog.getMsg";
|
|
15395
15435
|
function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
|
|
15396
15436
|
const messageString = serializeI18nMessageForGetMsg(message);
|
|
@@ -15438,7 +15478,7 @@ function serializeI18nMessageForGetMsg(message) {
|
|
|
15438
15478
|
return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
|
|
15439
15479
|
}
|
|
15440
15480
|
|
|
15441
|
-
// bazel-out/
|
|
15481
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
|
|
15442
15482
|
function createLocalizeStatements(variable2, message, params) {
|
|
15443
15483
|
const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
|
|
15444
15484
|
const sourceSpan = getSourceSpan(message);
|
|
@@ -15521,7 +15561,7 @@ function createEmptyMessagePart(location) {
|
|
|
15521
15561
|
return new LiteralPiece("", new ParseSourceSpan(location, location));
|
|
15522
15562
|
}
|
|
15523
15563
|
|
|
15524
|
-
// bazel-out/
|
|
15564
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_message_extraction.mjs
|
|
15525
15565
|
var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
|
|
15526
15566
|
var TRANSLATION_VAR_PREFIX2 = "i18n_";
|
|
15527
15567
|
function phaseI18nMessageExtraction(job) {
|
|
@@ -15576,7 +15616,7 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
|
|
|
15576
15616
|
return variable(name);
|
|
15577
15617
|
}
|
|
15578
15618
|
|
|
15579
|
-
// bazel-out/
|
|
15619
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
|
|
15580
15620
|
function phaseI18nTextExtraction(job) {
|
|
15581
15621
|
var _a2;
|
|
15582
15622
|
for (const unit of job.units) {
|
|
@@ -15620,7 +15660,7 @@ function phaseI18nTextExtraction(job) {
|
|
|
15620
15660
|
}
|
|
15621
15661
|
}
|
|
15622
15662
|
|
|
15623
|
-
// bazel-out/
|
|
15663
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/icu_extraction.mjs
|
|
15624
15664
|
function phaseIcuExtraction(job) {
|
|
15625
15665
|
for (const unit of job.units) {
|
|
15626
15666
|
const icus = /* @__PURE__ */ new Map();
|
|
@@ -15660,7 +15700,7 @@ function phaseIcuExtraction(job) {
|
|
|
15660
15700
|
}
|
|
15661
15701
|
}
|
|
15662
15702
|
|
|
15663
|
-
// bazel-out/
|
|
15703
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
|
|
15664
15704
|
function phaseLocalRefs(job) {
|
|
15665
15705
|
for (const unit of job.units) {
|
|
15666
15706
|
for (const op of unit.create) {
|
|
@@ -15690,7 +15730,7 @@ function serializeLocalRefs(refs) {
|
|
|
15690
15730
|
return literalArr(constRefs);
|
|
15691
15731
|
}
|
|
15692
15732
|
|
|
15693
|
-
// bazel-out/
|
|
15733
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
|
|
15694
15734
|
function phaseNamespace(job) {
|
|
15695
15735
|
for (const unit of job.units) {
|
|
15696
15736
|
let activeNamespace = Namespace.HTML;
|
|
@@ -15706,7 +15746,7 @@ function phaseNamespace(job) {
|
|
|
15706
15746
|
}
|
|
15707
15747
|
}
|
|
15708
15748
|
|
|
15709
|
-
// bazel-out/
|
|
15749
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
|
|
15710
15750
|
function parse(value) {
|
|
15711
15751
|
const styles = [];
|
|
15712
15752
|
let i = 0;
|
|
@@ -15767,7 +15807,7 @@ function hyphenate2(value) {
|
|
|
15767
15807
|
}).toLowerCase();
|
|
15768
15808
|
}
|
|
15769
15809
|
|
|
15770
|
-
// bazel-out/
|
|
15810
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
|
|
15771
15811
|
function phaseNaming(cpl) {
|
|
15772
15812
|
addNamesToView(cpl.root, cpl.componentName, { index: 0 }, cpl.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
|
|
15773
15813
|
}
|
|
@@ -15806,6 +15846,20 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
15806
15846
|
case OpKind.Variable:
|
|
15807
15847
|
varNames.set(op.xref, getVariableName(op.variable, state));
|
|
15808
15848
|
break;
|
|
15849
|
+
case OpKind.RepeaterCreate:
|
|
15850
|
+
if (!(unit instanceof ViewCompilationUnit)) {
|
|
15851
|
+
throw new Error(`AssertionError: must be compiling a component`);
|
|
15852
|
+
}
|
|
15853
|
+
if (op.slot === null) {
|
|
15854
|
+
throw new Error(`Expected slot to be assigned`);
|
|
15855
|
+
}
|
|
15856
|
+
if (op.emptyView !== null) {
|
|
15857
|
+
const emptyView = unit.job.views.get(op.emptyView);
|
|
15858
|
+
addNamesToView(emptyView, `${baseName}_${prefixWithNamespace(`${op.tag}Empty`, op.namespace)}_${op.slot + 2}`, state, compatibility);
|
|
15859
|
+
}
|
|
15860
|
+
const repeaterToken = op.tag === null ? "" : "_" + prefixWithNamespace(op.tag, op.namespace);
|
|
15861
|
+
addNamesToView(unit.job.views.get(op.xref), `${baseName}${repeaterToken}_${op.slot + 1}`, state, compatibility);
|
|
15862
|
+
break;
|
|
15809
15863
|
case OpKind.Template:
|
|
15810
15864
|
if (!(unit instanceof ViewCompilationUnit)) {
|
|
15811
15865
|
throw new Error(`AssertionError: must be compiling a component`);
|
|
@@ -15849,10 +15903,10 @@ function getVariableName(variable2, state) {
|
|
|
15849
15903
|
variable2.name = `ctx_r${state.index++}`;
|
|
15850
15904
|
break;
|
|
15851
15905
|
case SemanticVariableKind.Identifier:
|
|
15852
|
-
variable2.name = `${variable2.identifier}
|
|
15906
|
+
variable2.name = `${variable2.identifier}_r${++state.index}`;
|
|
15853
15907
|
break;
|
|
15854
15908
|
default:
|
|
15855
|
-
variable2.name = `_r${state.index
|
|
15909
|
+
variable2.name = `_r${++state.index}`;
|
|
15856
15910
|
break;
|
|
15857
15911
|
}
|
|
15858
15912
|
}
|
|
@@ -15869,7 +15923,7 @@ function stripImportant(name) {
|
|
|
15869
15923
|
return name;
|
|
15870
15924
|
}
|
|
15871
15925
|
|
|
15872
|
-
// bazel-out/
|
|
15926
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
|
|
15873
15927
|
function phaseMergeNextContext(job) {
|
|
15874
15928
|
for (const unit of job.units) {
|
|
15875
15929
|
for (const op of unit.create) {
|
|
@@ -15915,7 +15969,7 @@ function mergeNextContextsInOps(ops) {
|
|
|
15915
15969
|
}
|
|
15916
15970
|
}
|
|
15917
15971
|
|
|
15918
|
-
// bazel-out/
|
|
15972
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
|
|
15919
15973
|
var CONTAINER_TAG = "ng-container";
|
|
15920
15974
|
function phaseNgContainer(job) {
|
|
15921
15975
|
for (const unit of job.units) {
|
|
@@ -15932,7 +15986,7 @@ function phaseNgContainer(job) {
|
|
|
15932
15986
|
}
|
|
15933
15987
|
}
|
|
15934
15988
|
|
|
15935
|
-
// bazel-out/
|
|
15989
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
|
|
15936
15990
|
function lookupElement3(elements, xref) {
|
|
15937
15991
|
const el = elements.get(xref);
|
|
15938
15992
|
if (el === void 0) {
|
|
@@ -15962,7 +16016,7 @@ function phaseNonbindable(job) {
|
|
|
15962
16016
|
}
|
|
15963
16017
|
}
|
|
15964
16018
|
|
|
15965
|
-
// bazel-out/
|
|
16019
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
|
|
15966
16020
|
function phaseNullishCoalescing(job) {
|
|
15967
16021
|
for (const unit of job.units) {
|
|
15968
16022
|
for (const op of unit.ops()) {
|
|
@@ -15978,24 +16032,30 @@ function phaseNullishCoalescing(job) {
|
|
|
15978
16032
|
}
|
|
15979
16033
|
}
|
|
15980
16034
|
|
|
15981
|
-
// bazel-out/
|
|
16035
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
|
|
15982
16036
|
function kindTest(kind) {
|
|
15983
16037
|
return (op) => op.kind === kind;
|
|
15984
16038
|
}
|
|
16039
|
+
function kindWithInterpolationTest(kind, interpolation) {
|
|
16040
|
+
return (op) => {
|
|
16041
|
+
return op.kind === kind && interpolation === op.expression instanceof Interpolation2;
|
|
16042
|
+
};
|
|
16043
|
+
}
|
|
15985
16044
|
var CREATE_ORDERING = [
|
|
15986
16045
|
{ test: (op) => op.kind === OpKind.Listener && op.hostListener && op.isAnimationListener },
|
|
15987
16046
|
{ test: (op) => op.kind === OpKind.Listener && !(op.hostListener && op.isAnimationListener) }
|
|
15988
16047
|
];
|
|
15989
16048
|
var UPDATE_ORDERING = [
|
|
15990
|
-
{ test: (
|
|
15991
|
-
{ test: (
|
|
16049
|
+
{ test: kindWithInterpolationTest(OpKind.HostProperty, true) },
|
|
16050
|
+
{ test: kindWithInterpolationTest(OpKind.HostProperty, false) },
|
|
15992
16051
|
{ test: kindTest(OpKind.StyleMap), transform: keepLast },
|
|
15993
16052
|
{ test: kindTest(OpKind.ClassMap), transform: keepLast },
|
|
15994
16053
|
{ test: kindTest(OpKind.StyleProp) },
|
|
15995
16054
|
{ test: kindTest(OpKind.ClassProp) },
|
|
15996
|
-
{ test: (
|
|
15997
|
-
{ test: (
|
|
15998
|
-
{ test:
|
|
16055
|
+
{ test: kindWithInterpolationTest(OpKind.Property, true) },
|
|
16056
|
+
{ test: kindWithInterpolationTest(OpKind.Attribute, true) },
|
|
16057
|
+
{ test: kindWithInterpolationTest(OpKind.Property, false) },
|
|
16058
|
+
{ test: kindWithInterpolationTest(OpKind.Attribute, false) }
|
|
15999
16059
|
];
|
|
16000
16060
|
var handledOpKinds = /* @__PURE__ */ new Set([
|
|
16001
16061
|
OpKind.Listener,
|
|
@@ -16009,29 +16069,27 @@ var handledOpKinds = /* @__PURE__ */ new Set([
|
|
|
16009
16069
|
]);
|
|
16010
16070
|
function phaseOrdering(job) {
|
|
16011
16071
|
for (const unit of job.units) {
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16018
|
-
|
|
16019
|
-
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
|
|
16029
|
-
|
|
16030
|
-
opsToOrder = [];
|
|
16031
|
-
}
|
|
16072
|
+
orderWithin(unit.create, CREATE_ORDERING);
|
|
16073
|
+
orderWithin(unit.update, UPDATE_ORDERING);
|
|
16074
|
+
}
|
|
16075
|
+
}
|
|
16076
|
+
function orderWithin(opList, ordering) {
|
|
16077
|
+
let opsToOrder = [];
|
|
16078
|
+
let firstTargetInGroup = null;
|
|
16079
|
+
for (const op of opList) {
|
|
16080
|
+
const currentTarget = hasDependsOnSlotContextTrait(op) ? op.target : null;
|
|
16081
|
+
if (!handledOpKinds.has(op.kind) || currentTarget !== firstTargetInGroup && (firstTargetInGroup !== null && currentTarget !== null)) {
|
|
16082
|
+
OpList.insertBefore(reorder(opsToOrder, ordering), op);
|
|
16083
|
+
opsToOrder = [];
|
|
16084
|
+
firstTargetInGroup = null;
|
|
16085
|
+
}
|
|
16086
|
+
if (handledOpKinds.has(op.kind)) {
|
|
16087
|
+
opsToOrder.push(op);
|
|
16088
|
+
OpList.remove(op);
|
|
16089
|
+
firstTargetInGroup = currentTarget != null ? currentTarget : firstTargetInGroup;
|
|
16032
16090
|
}
|
|
16033
|
-
unit.update.push(reorder(opsToOrder, UPDATE_ORDERING));
|
|
16034
16091
|
}
|
|
16092
|
+
opList.push(reorder(opsToOrder, ordering));
|
|
16035
16093
|
}
|
|
16036
16094
|
function reorder(ops, ordering) {
|
|
16037
16095
|
const groups = Array.from(ordering, () => new Array());
|
|
@@ -16048,7 +16106,7 @@ function keepLast(ops) {
|
|
|
16048
16106
|
return ops.slice(ops.length - 1);
|
|
16049
16107
|
}
|
|
16050
16108
|
|
|
16051
|
-
// bazel-out/
|
|
16109
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
|
|
16052
16110
|
function phaseParseExtractedStyles(cpl) {
|
|
16053
16111
|
for (const unit of cpl.units) {
|
|
16054
16112
|
for (const op of unit.create) {
|
|
@@ -16071,31 +16129,31 @@ function phaseParseExtractedStyles(cpl) {
|
|
|
16071
16129
|
}
|
|
16072
16130
|
}
|
|
16073
16131
|
|
|
16074
|
-
// bazel-out/
|
|
16132
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
|
|
16075
16133
|
function phaseRemoveContentSelectors(job) {
|
|
16076
16134
|
for (const unit of job.units) {
|
|
16077
|
-
const elements =
|
|
16135
|
+
const elements = createOpXrefMap(unit);
|
|
16078
16136
|
for (const op of unit.update) {
|
|
16079
16137
|
switch (op.kind) {
|
|
16080
16138
|
case OpKind.Binding:
|
|
16081
|
-
const target =
|
|
16139
|
+
const target = lookupInXrefMap(elements, op.target);
|
|
16082
16140
|
if (op.name.toLowerCase() === "select" && target.kind === OpKind.Projection) {
|
|
16083
16141
|
OpList.remove(op);
|
|
16084
16142
|
}
|
|
16085
|
-
|
|
16143
|
+
break;
|
|
16086
16144
|
}
|
|
16087
16145
|
}
|
|
16088
16146
|
}
|
|
16089
16147
|
}
|
|
16090
|
-
function
|
|
16091
|
-
const el =
|
|
16148
|
+
function lookupInXrefMap(map, xref) {
|
|
16149
|
+
const el = map.get(xref);
|
|
16092
16150
|
if (el === void 0) {
|
|
16093
|
-
throw new Error("All attributes should have an
|
|
16151
|
+
throw new Error("All attributes should have an slottable target.");
|
|
16094
16152
|
}
|
|
16095
16153
|
return el;
|
|
16096
16154
|
}
|
|
16097
16155
|
|
|
16098
|
-
// bazel-out/
|
|
16156
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
|
|
16099
16157
|
function phasePipeCreation(job) {
|
|
16100
16158
|
for (const unit of job.units) {
|
|
16101
16159
|
processPipeBindingsInView(unit);
|
|
@@ -16113,10 +16171,14 @@ function processPipeBindingsInView(unit) {
|
|
|
16113
16171
|
if (flags & VisitorContextFlag.InChildOperation) {
|
|
16114
16172
|
throw new Error(`AssertionError: pipe bindings should not appear in child expressions`);
|
|
16115
16173
|
}
|
|
16116
|
-
if (!hasDependsOnSlotContextTrait(updateOp)) {
|
|
16174
|
+
if (!hasDependsOnSlotContextTrait(updateOp) && !hasUsesSlotIndexTrait(updateOp)) {
|
|
16117
16175
|
throw new Error(`AssertionError: pipe binding associated with non-slot operation ${OpKind[updateOp.kind]}`);
|
|
16118
16176
|
}
|
|
16119
|
-
|
|
16177
|
+
if (unit.job.compatibility) {
|
|
16178
|
+
addPipeToCreationBlock(unit, updateOp.target, expr);
|
|
16179
|
+
} else {
|
|
16180
|
+
unit.create.push(createPipeOp(expr.target, expr.name));
|
|
16181
|
+
}
|
|
16120
16182
|
});
|
|
16121
16183
|
}
|
|
16122
16184
|
}
|
|
@@ -16138,7 +16200,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
|
|
|
16138
16200
|
throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
|
|
16139
16201
|
}
|
|
16140
16202
|
|
|
16141
|
-
// bazel-out/
|
|
16203
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
|
|
16142
16204
|
function phasePipeVariadic(job) {
|
|
16143
16205
|
for (const unit of job.units) {
|
|
16144
16206
|
for (const op of unit.update) {
|
|
@@ -16155,7 +16217,7 @@ function phasePipeVariadic(job) {
|
|
|
16155
16217
|
}
|
|
16156
16218
|
}
|
|
16157
16219
|
|
|
16158
|
-
// bazel-out/
|
|
16220
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
|
|
16159
16221
|
function phasePropagateI18nBlocks(job) {
|
|
16160
16222
|
propagateI18nBlocksToTemplates(job.root, 0);
|
|
16161
16223
|
}
|
|
@@ -16192,7 +16254,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
|
|
|
16192
16254
|
}
|
|
16193
16255
|
}
|
|
16194
16256
|
|
|
16195
|
-
// bazel-out/
|
|
16257
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
|
|
16196
16258
|
function phasePureFunctionExtraction(job) {
|
|
16197
16259
|
for (const view of job.units) {
|
|
16198
16260
|
for (const op of view.ops()) {
|
|
@@ -16234,7 +16296,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
|
|
|
16234
16296
|
}
|
|
16235
16297
|
};
|
|
16236
16298
|
|
|
16237
|
-
// bazel-out/
|
|
16299
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
|
|
16238
16300
|
function phasePureLiteralStructures(job) {
|
|
16239
16301
|
for (const view of job.units) {
|
|
16240
16302
|
for (const op of view.update) {
|
|
@@ -16281,7 +16343,7 @@ function transformLiteralMap(expr) {
|
|
|
16281
16343
|
return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
|
|
16282
16344
|
}
|
|
16283
16345
|
|
|
16284
|
-
// bazel-out/
|
|
16346
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
|
|
16285
16347
|
function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
|
|
16286
16348
|
return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
|
|
16287
16349
|
}
|
|
@@ -16413,15 +16475,15 @@ function deferOn(sourceSpan) {
|
|
|
16413
16475
|
function projectionDef(def) {
|
|
16414
16476
|
return call(Identifiers.projectionDef, def ? [def] : [], null);
|
|
16415
16477
|
}
|
|
16416
|
-
function projection(slot, projectionSlotIndex, attributes) {
|
|
16478
|
+
function projection(slot, projectionSlotIndex, attributes, sourceSpan) {
|
|
16417
16479
|
const args = [literal(slot)];
|
|
16418
|
-
if (projectionSlotIndex !== 0 || attributes
|
|
16480
|
+
if (projectionSlotIndex !== 0 || attributes.length > 0) {
|
|
16419
16481
|
args.push(literal(projectionSlotIndex));
|
|
16420
|
-
if (attributes
|
|
16421
|
-
args.push(
|
|
16482
|
+
if (attributes.length > 0) {
|
|
16483
|
+
args.push(literalArr(attributes.map((attr) => literal(attr))));
|
|
16422
16484
|
}
|
|
16423
16485
|
}
|
|
16424
|
-
return call(Identifiers.projection, args,
|
|
16486
|
+
return call(Identifiers.projection, args, sourceSpan);
|
|
16425
16487
|
}
|
|
16426
16488
|
function i18nStart(slot, constIndex, subTemplateIndex) {
|
|
16427
16489
|
const args = [literal(slot), literal(constIndex)];
|
|
@@ -16430,6 +16492,27 @@ function i18nStart(slot, constIndex, subTemplateIndex) {
|
|
|
16430
16492
|
}
|
|
16431
16493
|
return call(Identifiers.i18nStart, args, null);
|
|
16432
16494
|
}
|
|
16495
|
+
function repeaterCreate(slot, viewFnName, decls, vars, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, sourceSpan) {
|
|
16496
|
+
let args = [
|
|
16497
|
+
literal(slot),
|
|
16498
|
+
variable(viewFnName),
|
|
16499
|
+
literal(decls),
|
|
16500
|
+
literal(vars),
|
|
16501
|
+
trackByFn
|
|
16502
|
+
];
|
|
16503
|
+
if (trackByUsesComponentInstance || emptyViewFnName !== null) {
|
|
16504
|
+
args.push(literal(trackByUsesComponentInstance));
|
|
16505
|
+
if (emptyViewFnName !== null) {
|
|
16506
|
+
args.push(variable(emptyViewFnName));
|
|
16507
|
+
args.push(literal(emptyDecls));
|
|
16508
|
+
args.push(literal(emptyVars));
|
|
16509
|
+
}
|
|
16510
|
+
}
|
|
16511
|
+
return call(Identifiers.repeaterCreate, args, sourceSpan);
|
|
16512
|
+
}
|
|
16513
|
+
function repeater(metadataSlot, collection, sourceSpan) {
|
|
16514
|
+
return call(Identifiers.repeater, [literal(metadataSlot), collection], sourceSpan);
|
|
16515
|
+
}
|
|
16433
16516
|
function i18n(slot, constIndex, subTemplateIndex) {
|
|
16434
16517
|
const args = [literal(slot), literal(constIndex)];
|
|
16435
16518
|
if (subTemplateIndex) {
|
|
@@ -16736,7 +16819,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
|
|
|
16736
16819
|
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
|
|
16737
16820
|
}
|
|
16738
16821
|
|
|
16739
|
-
// bazel-out/
|
|
16822
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
|
|
16740
16823
|
var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
|
|
16741
16824
|
[SanitizerFn.Html, Identifiers.sanitizeHtml],
|
|
16742
16825
|
[SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
|
|
@@ -16842,7 +16925,35 @@ function reifyCreateOperations(unit, ops) {
|
|
|
16842
16925
|
if (op.slot === null) {
|
|
16843
16926
|
throw new Error("No slot was assigned for project instruction");
|
|
16844
16927
|
}
|
|
16845
|
-
OpList.replace(op, projection(op.slot, op.projectionSlotIndex, op.attributes));
|
|
16928
|
+
OpList.replace(op, projection(op.slot, op.projectionSlotIndex, op.attributes, op.sourceSpan));
|
|
16929
|
+
break;
|
|
16930
|
+
case OpKind.RepeaterCreate:
|
|
16931
|
+
if (op.slot === null) {
|
|
16932
|
+
throw new Error("No slot was assigned for repeater instruction");
|
|
16933
|
+
}
|
|
16934
|
+
if (!(unit instanceof ViewCompilationUnit)) {
|
|
16935
|
+
throw new Error(`AssertionError: must be compiling a component`);
|
|
16936
|
+
}
|
|
16937
|
+
const repeaterView = unit.job.views.get(op.xref);
|
|
16938
|
+
if (repeaterView.fnName === null) {
|
|
16939
|
+
throw new Error(`AssertionError: expected repeater primary view to have been named`);
|
|
16940
|
+
}
|
|
16941
|
+
let emptyViewFnName = null;
|
|
16942
|
+
let emptyDecls = null;
|
|
16943
|
+
let emptyVars = null;
|
|
16944
|
+
if (op.emptyView !== null) {
|
|
16945
|
+
const emptyView = unit.job.views.get(op.emptyView);
|
|
16946
|
+
if (emptyView === void 0) {
|
|
16947
|
+
throw new Error("AssertionError: repeater had empty view xref, but empty view was not found");
|
|
16948
|
+
}
|
|
16949
|
+
if (emptyView.fnName === null || emptyView.decls === null || emptyView.vars === null) {
|
|
16950
|
+
throw new Error(`AssertionError: expected repeater empty view to have been named and counted`);
|
|
16951
|
+
}
|
|
16952
|
+
emptyViewFnName = emptyView.fnName;
|
|
16953
|
+
emptyDecls = emptyView.decls;
|
|
16954
|
+
emptyVars = emptyView.vars;
|
|
16955
|
+
}
|
|
16956
|
+
OpList.replace(op, repeaterCreate(op.slot, repeaterView.fnName, op.decls, op.vars, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.sourceSpan));
|
|
16846
16957
|
break;
|
|
16847
16958
|
case OpKind.Statement:
|
|
16848
16959
|
break;
|
|
@@ -16931,6 +17042,9 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
16931
17042
|
}
|
|
16932
17043
|
OpList.replace(op, conditional(op.targetSlot, op.processed, op.contextValue, op.sourceSpan));
|
|
16933
17044
|
break;
|
|
17045
|
+
case OpKind.Repeater:
|
|
17046
|
+
OpList.replace(op, repeater(op.targetSlot, op.collection, op.sourceSpan));
|
|
17047
|
+
break;
|
|
16934
17048
|
case OpKind.Statement:
|
|
16935
17049
|
break;
|
|
16936
17050
|
default:
|
|
@@ -17008,7 +17122,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
|
|
|
17008
17122
|
return fn(params, handlerStmts, void 0, void 0, name);
|
|
17009
17123
|
}
|
|
17010
17124
|
|
|
17011
|
-
// bazel-out/
|
|
17125
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
|
|
17012
17126
|
function phaseRemoveEmptyBindings(job) {
|
|
17013
17127
|
for (const unit of job.units) {
|
|
17014
17128
|
for (const op of unit.update) {
|
|
@@ -17029,7 +17143,7 @@ function phaseRemoveEmptyBindings(job) {
|
|
|
17029
17143
|
}
|
|
17030
17144
|
}
|
|
17031
17145
|
|
|
17032
|
-
// bazel-out/
|
|
17146
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
|
|
17033
17147
|
function phaseResolveContexts(cpl) {
|
|
17034
17148
|
for (const unit of cpl.units) {
|
|
17035
17149
|
processLexicalScope(unit, unit.create);
|
|
@@ -17053,6 +17167,9 @@ function processLexicalScope(view, ops) {
|
|
|
17053
17167
|
break;
|
|
17054
17168
|
}
|
|
17055
17169
|
}
|
|
17170
|
+
if (view === view.job.root) {
|
|
17171
|
+
scope.set(view.xref, variable("ctx"));
|
|
17172
|
+
}
|
|
17056
17173
|
for (const op of ops) {
|
|
17057
17174
|
transformExpressionsInOp(op, (expr) => {
|
|
17058
17175
|
if (expr instanceof ContextExpr) {
|
|
@@ -17067,7 +17184,7 @@ function processLexicalScope(view, ops) {
|
|
|
17067
17184
|
}
|
|
17068
17185
|
}
|
|
17069
17186
|
|
|
17070
|
-
// bazel-out/
|
|
17187
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
|
|
17071
17188
|
function phaseResolveDollarEvent(job) {
|
|
17072
17189
|
for (const unit of job.units) {
|
|
17073
17190
|
resolveDollarEvent(unit, unit.create);
|
|
@@ -17088,7 +17205,7 @@ function resolveDollarEvent(unit, ops) {
|
|
|
17088
17205
|
}
|
|
17089
17206
|
}
|
|
17090
17207
|
|
|
17091
|
-
// bazel-out/
|
|
17208
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_placeholders.mjs
|
|
17092
17209
|
var ESCAPE = "\uFFFD";
|
|
17093
17210
|
var ELEMENT_MARKER = "#";
|
|
17094
17211
|
var TEMPLATE_MARKER = "*";
|
|
@@ -17274,7 +17391,7 @@ function propagatePlaceholders(params, i18nOps) {
|
|
|
17274
17391
|
}
|
|
17275
17392
|
}
|
|
17276
17393
|
|
|
17277
|
-
// bazel-out/
|
|
17394
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
|
|
17278
17395
|
function phaseResolveNames(cpl) {
|
|
17279
17396
|
for (const unit of cpl.units) {
|
|
17280
17397
|
processLexicalScope2(unit, unit.create, null);
|
|
@@ -17288,6 +17405,7 @@ function processLexicalScope2(unit, ops, savedView) {
|
|
|
17288
17405
|
case OpKind.Variable:
|
|
17289
17406
|
switch (op.variable.kind) {
|
|
17290
17407
|
case SemanticVariableKind.Identifier:
|
|
17408
|
+
case SemanticVariableKind.Alias:
|
|
17291
17409
|
if (scope.has(op.variable.identifier)) {
|
|
17292
17410
|
continue;
|
|
17293
17411
|
}
|
|
@@ -17337,7 +17455,7 @@ function processLexicalScope2(unit, ops, savedView) {
|
|
|
17337
17455
|
}
|
|
17338
17456
|
}
|
|
17339
17457
|
|
|
17340
|
-
// bazel-out/
|
|
17458
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
|
|
17341
17459
|
var sanitizers = /* @__PURE__ */ new Map([
|
|
17342
17460
|
[SecurityContext.HTML, SanitizerFn.Html],
|
|
17343
17461
|
[SecurityContext.SCRIPT, SanitizerFn.Script],
|
|
@@ -17347,7 +17465,7 @@ var sanitizers = /* @__PURE__ */ new Map([
|
|
|
17347
17465
|
]);
|
|
17348
17466
|
function phaseResolveSanitizers(job) {
|
|
17349
17467
|
for (const unit of job.units) {
|
|
17350
|
-
const elements =
|
|
17468
|
+
const elements = createOpXrefMap(unit);
|
|
17351
17469
|
let sanitizerFn;
|
|
17352
17470
|
for (const op of unit.update) {
|
|
17353
17471
|
switch (op.kind) {
|
|
@@ -17357,7 +17475,7 @@ function phaseResolveSanitizers(job) {
|
|
|
17357
17475
|
op.sanitizer = sanitizerFn ? new SanitizerExpr(sanitizerFn) : null;
|
|
17358
17476
|
if (op.sanitizer === null) {
|
|
17359
17477
|
const ownerOp = elements.get(op.target);
|
|
17360
|
-
if (ownerOp === void 0) {
|
|
17478
|
+
if (ownerOp === void 0 || !isElementOrContainerOp(ownerOp)) {
|
|
17361
17479
|
throw Error("Property should have an element-like owner");
|
|
17362
17480
|
}
|
|
17363
17481
|
if (isIframeElement(ownerOp) && isIframeSecuritySensitiveAttr(op.name)) {
|
|
@@ -17374,7 +17492,7 @@ function isIframeElement(op) {
|
|
|
17374
17492
|
return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
|
|
17375
17493
|
}
|
|
17376
17494
|
|
|
17377
|
-
// bazel-out/
|
|
17495
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
|
|
17378
17496
|
function phaseSaveRestoreView(job) {
|
|
17379
17497
|
for (const view of job.views.values()) {
|
|
17380
17498
|
view.create.prepend([
|
|
@@ -17382,7 +17500,7 @@ function phaseSaveRestoreView(job) {
|
|
|
17382
17500
|
kind: SemanticVariableKind.SavedView,
|
|
17383
17501
|
name: null,
|
|
17384
17502
|
view: view.xref
|
|
17385
|
-
}, new GetCurrentViewExpr())
|
|
17503
|
+
}, new GetCurrentViewExpr(), VariableFlags.None)
|
|
17386
17504
|
]);
|
|
17387
17505
|
for (const op of view.create) {
|
|
17388
17506
|
if (op.kind !== OpKind.Listener) {
|
|
@@ -17410,7 +17528,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
|
|
|
17410
17528
|
kind: SemanticVariableKind.Context,
|
|
17411
17529
|
name: null,
|
|
17412
17530
|
view: unit.xref
|
|
17413
|
-
}, new RestoreViewExpr(unit.xref))
|
|
17531
|
+
}, new RestoreViewExpr(unit.xref), VariableFlags.None)
|
|
17414
17532
|
]);
|
|
17415
17533
|
for (const handlerOp of op.handlerOps) {
|
|
17416
17534
|
if (handlerOp.kind === OpKind.Statement && handlerOp.statement instanceof ReturnStatement) {
|
|
@@ -17419,7 +17537,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
|
|
|
17419
17537
|
}
|
|
17420
17538
|
}
|
|
17421
17539
|
|
|
17422
|
-
// bazel-out/
|
|
17540
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
|
|
17423
17541
|
function phaseSlotAllocation(job) {
|
|
17424
17542
|
const slotMap = /* @__PURE__ */ new Map();
|
|
17425
17543
|
for (const unit of job.units) {
|
|
@@ -17436,11 +17554,11 @@ function phaseSlotAllocation(job) {
|
|
|
17436
17554
|
}
|
|
17437
17555
|
for (const unit of job.units) {
|
|
17438
17556
|
for (const op of unit.ops()) {
|
|
17439
|
-
if (op.kind === OpKind.Template) {
|
|
17557
|
+
if (op.kind === OpKind.Template || op.kind === OpKind.RepeaterCreate) {
|
|
17440
17558
|
const childView = job.views.get(op.xref);
|
|
17441
17559
|
op.decls = childView.decls;
|
|
17442
17560
|
}
|
|
17443
|
-
if (hasUsesSlotIndexTrait(op) && op.targetSlot === null) {
|
|
17561
|
+
if (hasUsesSlotIndexTrait(op) && op.target !== null && op.targetSlot === null) {
|
|
17444
17562
|
if (!slotMap.has(op.target)) {
|
|
17445
17563
|
throw new Error(`AssertionError: no slot allocated for ${OpKind[op.kind]} target ${op.target}`);
|
|
17446
17564
|
}
|
|
@@ -17462,7 +17580,7 @@ function phaseSlotAllocation(job) {
|
|
|
17462
17580
|
}
|
|
17463
17581
|
}
|
|
17464
17582
|
|
|
17465
|
-
// bazel-out/
|
|
17583
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
|
|
17466
17584
|
function phaseStyleBindingSpecialization(cpl) {
|
|
17467
17585
|
for (const unit of cpl.units) {
|
|
17468
17586
|
for (const op of unit.update) {
|
|
@@ -17492,7 +17610,7 @@ function phaseStyleBindingSpecialization(cpl) {
|
|
|
17492
17610
|
}
|
|
17493
17611
|
}
|
|
17494
17612
|
|
|
17495
|
-
// bazel-out/
|
|
17613
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
|
|
17496
17614
|
function phaseTemporaryVariables(cpl) {
|
|
17497
17615
|
for (const unit of cpl.units) {
|
|
17498
17616
|
unit.create.prepend(generateTemporaries(unit.create));
|
|
@@ -17550,9 +17668,121 @@ function assignName(names, expr) {
|
|
|
17550
17668
|
expr.name = name;
|
|
17551
17669
|
}
|
|
17552
17670
|
|
|
17553
|
-
// bazel-out/
|
|
17671
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
|
|
17672
|
+
function phaseVarCounting(job) {
|
|
17673
|
+
for (const unit of job.units) {
|
|
17674
|
+
let varCount = 0;
|
|
17675
|
+
for (const op of unit.ops()) {
|
|
17676
|
+
if (hasConsumesVarsTrait(op)) {
|
|
17677
|
+
varCount += varsUsedByOp(op);
|
|
17678
|
+
}
|
|
17679
|
+
}
|
|
17680
|
+
for (const op of unit.ops()) {
|
|
17681
|
+
visitExpressionsInOp(op, (expr) => {
|
|
17682
|
+
if (!isIrExpression(expr)) {
|
|
17683
|
+
return;
|
|
17684
|
+
}
|
|
17685
|
+
if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && expr instanceof PureFunctionExpr) {
|
|
17686
|
+
return;
|
|
17687
|
+
}
|
|
17688
|
+
if (hasUsesVarOffsetTrait(expr)) {
|
|
17689
|
+
expr.varOffset = varCount;
|
|
17690
|
+
}
|
|
17691
|
+
if (hasConsumesVarsTrait(expr)) {
|
|
17692
|
+
varCount += varsUsedByIrExpression(expr);
|
|
17693
|
+
}
|
|
17694
|
+
});
|
|
17695
|
+
}
|
|
17696
|
+
if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
|
|
17697
|
+
for (const op of unit.ops()) {
|
|
17698
|
+
visitExpressionsInOp(op, (expr) => {
|
|
17699
|
+
if (!isIrExpression(expr) || !(expr instanceof PureFunctionExpr)) {
|
|
17700
|
+
return;
|
|
17701
|
+
}
|
|
17702
|
+
if (hasUsesVarOffsetTrait(expr)) {
|
|
17703
|
+
expr.varOffset = varCount;
|
|
17704
|
+
}
|
|
17705
|
+
if (hasConsumesVarsTrait(expr)) {
|
|
17706
|
+
varCount += varsUsedByIrExpression(expr);
|
|
17707
|
+
}
|
|
17708
|
+
});
|
|
17709
|
+
}
|
|
17710
|
+
}
|
|
17711
|
+
unit.vars = varCount;
|
|
17712
|
+
}
|
|
17713
|
+
if (job instanceof ComponentCompilationJob) {
|
|
17714
|
+
for (const unit of job.units) {
|
|
17715
|
+
for (const op of unit.create) {
|
|
17716
|
+
if (op.kind !== OpKind.Template && op.kind !== OpKind.RepeaterCreate) {
|
|
17717
|
+
continue;
|
|
17718
|
+
}
|
|
17719
|
+
const childView = job.views.get(op.xref);
|
|
17720
|
+
op.vars = childView.vars;
|
|
17721
|
+
}
|
|
17722
|
+
}
|
|
17723
|
+
}
|
|
17724
|
+
}
|
|
17725
|
+
function varsUsedByOp(op) {
|
|
17726
|
+
let slots;
|
|
17727
|
+
switch (op.kind) {
|
|
17728
|
+
case OpKind.Property:
|
|
17729
|
+
case OpKind.HostProperty:
|
|
17730
|
+
case OpKind.Attribute:
|
|
17731
|
+
slots = 1;
|
|
17732
|
+
if (op.expression instanceof Interpolation2 && !isSingletonInterpolation(op.expression)) {
|
|
17733
|
+
slots += op.expression.expressions.length;
|
|
17734
|
+
}
|
|
17735
|
+
return slots;
|
|
17736
|
+
case OpKind.StyleProp:
|
|
17737
|
+
case OpKind.ClassProp:
|
|
17738
|
+
case OpKind.StyleMap:
|
|
17739
|
+
case OpKind.ClassMap:
|
|
17740
|
+
slots = 2;
|
|
17741
|
+
if (op.expression instanceof Interpolation2) {
|
|
17742
|
+
slots += op.expression.expressions.length;
|
|
17743
|
+
}
|
|
17744
|
+
return slots;
|
|
17745
|
+
case OpKind.InterpolateText:
|
|
17746
|
+
return op.interpolation.expressions.length;
|
|
17747
|
+
case OpKind.I18nExpression:
|
|
17748
|
+
case OpKind.Conditional:
|
|
17749
|
+
return 1;
|
|
17750
|
+
default:
|
|
17751
|
+
throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
|
|
17752
|
+
}
|
|
17753
|
+
}
|
|
17754
|
+
function varsUsedByIrExpression(expr) {
|
|
17755
|
+
switch (expr.kind) {
|
|
17756
|
+
case ExpressionKind.PureFunctionExpr:
|
|
17757
|
+
return 1 + expr.args.length;
|
|
17758
|
+
case ExpressionKind.PipeBinding:
|
|
17759
|
+
return 1 + expr.args.length;
|
|
17760
|
+
case ExpressionKind.PipeBindingVariadic:
|
|
17761
|
+
return 1 + expr.numArgs;
|
|
17762
|
+
default:
|
|
17763
|
+
throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
|
|
17764
|
+
}
|
|
17765
|
+
}
|
|
17766
|
+
function isSingletonInterpolation(expr) {
|
|
17767
|
+
if (expr.expressions.length !== 1 || expr.strings.length !== 2) {
|
|
17768
|
+
return false;
|
|
17769
|
+
}
|
|
17770
|
+
if (expr.strings[0] !== "" || expr.strings[1] !== "") {
|
|
17771
|
+
return false;
|
|
17772
|
+
}
|
|
17773
|
+
return true;
|
|
17774
|
+
}
|
|
17775
|
+
|
|
17776
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
|
|
17554
17777
|
function phaseVariableOptimization(job) {
|
|
17555
17778
|
for (const unit of job.units) {
|
|
17779
|
+
inlineAlwaysInlineVariables(unit.create);
|
|
17780
|
+
inlineAlwaysInlineVariables(unit.update);
|
|
17781
|
+
for (const op of unit.create) {
|
|
17782
|
+
if (op.kind === OpKind.Listener) {
|
|
17783
|
+
inlineAlwaysInlineVariables(op.handlerOps);
|
|
17784
|
+
}
|
|
17785
|
+
}
|
|
17556
17786
|
optimizeVariablesInOpList(unit.create, job.compatibility);
|
|
17557
17787
|
optimizeVariablesInOpList(unit.update, job.compatibility);
|
|
17558
17788
|
for (const op of unit.create) {
|
|
@@ -17569,6 +17799,29 @@ var Fence;
|
|
|
17569
17799
|
Fence2[Fence2["ViewContextWrite"] = 3] = "ViewContextWrite";
|
|
17570
17800
|
Fence2[Fence2["SideEffectful"] = 4] = "SideEffectful";
|
|
17571
17801
|
})(Fence || (Fence = {}));
|
|
17802
|
+
function inlineAlwaysInlineVariables(ops) {
|
|
17803
|
+
const vars = /* @__PURE__ */ new Map();
|
|
17804
|
+
for (const op of ops) {
|
|
17805
|
+
if (op.kind === OpKind.Variable && op.flags & VariableFlags.AlwaysInline) {
|
|
17806
|
+
visitExpressionsInOp(op, (expr) => {
|
|
17807
|
+
if (isIrExpression(expr) && fencesForIrExpression(expr) !== Fence.None) {
|
|
17808
|
+
throw new Error(`AssertionError: A context-sensitive variable was marked AlwaysInline`);
|
|
17809
|
+
}
|
|
17810
|
+
});
|
|
17811
|
+
vars.set(op.xref, op);
|
|
17812
|
+
}
|
|
17813
|
+
transformExpressionsInOp(op, (expr) => {
|
|
17814
|
+
if (expr instanceof ReadVariableExpr && vars.has(expr.xref)) {
|
|
17815
|
+
const varOp = vars.get(expr.xref);
|
|
17816
|
+
return varOp.initializer.clone();
|
|
17817
|
+
}
|
|
17818
|
+
return expr;
|
|
17819
|
+
}, VisitorContextFlag.None);
|
|
17820
|
+
}
|
|
17821
|
+
for (const op of vars.values()) {
|
|
17822
|
+
OpList.remove(op);
|
|
17823
|
+
}
|
|
17824
|
+
}
|
|
17572
17825
|
function optimizeVariablesInOpList(ops, compatibility) {
|
|
17573
17826
|
const varDecls = /* @__PURE__ */ new Map();
|
|
17574
17827
|
const varUsages = /* @__PURE__ */ new Map();
|
|
@@ -17608,7 +17861,10 @@ function optimizeVariablesInOpList(ops, compatibility) {
|
|
|
17608
17861
|
}
|
|
17609
17862
|
const toInline = [];
|
|
17610
17863
|
for (const [id, count] of varUsages) {
|
|
17611
|
-
|
|
17864
|
+
const decl = varDecls.get(id);
|
|
17865
|
+
const varInfo = opMap.get(decl);
|
|
17866
|
+
const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
|
|
17867
|
+
if (count !== 1 || isAlwaysInline) {
|
|
17612
17868
|
continue;
|
|
17613
17869
|
}
|
|
17614
17870
|
if (varRemoteUsages.has(id)) {
|
|
@@ -17620,6 +17876,10 @@ function optimizeVariablesInOpList(ops, compatibility) {
|
|
|
17620
17876
|
while (candidate = toInline.pop()) {
|
|
17621
17877
|
const decl = varDecls.get(candidate);
|
|
17622
17878
|
const varInfo = opMap.get(decl);
|
|
17879
|
+
const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
|
|
17880
|
+
if (isAlwaysInline) {
|
|
17881
|
+
throw new Error(`AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.`);
|
|
17882
|
+
}
|
|
17623
17883
|
for (let targetOp = decl.next; targetOp.kind !== OpKind.ListEnd; targetOp = targetOp.next) {
|
|
17624
17884
|
const opInfo = opMap.get(targetOp);
|
|
17625
17885
|
if (opInfo.variablesUsed.has(candidate)) {
|
|
@@ -17763,7 +18023,7 @@ function allowConservativeInlining(decl, target) {
|
|
|
17763
18023
|
}
|
|
17764
18024
|
}
|
|
17765
18025
|
|
|
17766
|
-
// bazel-out/
|
|
18026
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
|
|
17767
18027
|
function phaseWrapIcus(job) {
|
|
17768
18028
|
for (const unit of job.units) {
|
|
17769
18029
|
let currentI18nOp = null;
|
|
@@ -17787,7 +18047,105 @@ function phaseWrapIcus(job) {
|
|
|
17787
18047
|
}
|
|
17788
18048
|
}
|
|
17789
18049
|
|
|
17790
|
-
// bazel-out/
|
|
18050
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
|
|
18051
|
+
function phaseTrackVariables(job) {
|
|
18052
|
+
for (const unit of job.units) {
|
|
18053
|
+
for (const op of unit.create) {
|
|
18054
|
+
if (op.kind !== OpKind.RepeaterCreate) {
|
|
18055
|
+
continue;
|
|
18056
|
+
}
|
|
18057
|
+
op.track = transformExpressionsInExpression(op.track, (expr) => {
|
|
18058
|
+
if (expr instanceof LexicalReadExpr) {
|
|
18059
|
+
if (expr.name === op.varNames.$index) {
|
|
18060
|
+
return variable("$index");
|
|
18061
|
+
} else if (expr.name === op.varNames.$implicit) {
|
|
18062
|
+
return variable("$item");
|
|
18063
|
+
}
|
|
18064
|
+
}
|
|
18065
|
+
return expr;
|
|
18066
|
+
}, VisitorContextFlag.None);
|
|
18067
|
+
}
|
|
18068
|
+
}
|
|
18069
|
+
}
|
|
18070
|
+
|
|
18071
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
|
|
18072
|
+
function phaseTrackFnGeneration(job) {
|
|
18073
|
+
for (const unit of job.units) {
|
|
18074
|
+
for (const op of unit.create) {
|
|
18075
|
+
if (op.kind !== OpKind.RepeaterCreate) {
|
|
18076
|
+
continue;
|
|
18077
|
+
}
|
|
18078
|
+
if (op.trackByFn !== null) {
|
|
18079
|
+
continue;
|
|
18080
|
+
}
|
|
18081
|
+
let usesComponentContext = false;
|
|
18082
|
+
op.track = transformExpressionsInExpression(op.track, (expr) => {
|
|
18083
|
+
if (expr instanceof TrackContextExpr) {
|
|
18084
|
+
usesComponentContext = true;
|
|
18085
|
+
return variable("this");
|
|
18086
|
+
}
|
|
18087
|
+
return expr;
|
|
18088
|
+
}, VisitorContextFlag.None);
|
|
18089
|
+
let fn2;
|
|
18090
|
+
const fnParams = [new FnParam("$index"), new FnParam("$item")];
|
|
18091
|
+
if (usesComponentContext) {
|
|
18092
|
+
fn2 = new FunctionExpr(fnParams, [new ReturnStatement(op.track)]);
|
|
18093
|
+
} else {
|
|
18094
|
+
fn2 = arrowFn(fnParams, op.track);
|
|
18095
|
+
}
|
|
18096
|
+
op.trackByFn = job.pool.getSharedFunctionReference(fn2, "_forTrack");
|
|
18097
|
+
}
|
|
18098
|
+
}
|
|
18099
|
+
}
|
|
18100
|
+
|
|
18101
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
|
|
18102
|
+
function phaseTrackFnOptimization(job) {
|
|
18103
|
+
for (const unit of job.units) {
|
|
18104
|
+
for (const op of unit.create) {
|
|
18105
|
+
if (op.kind !== OpKind.RepeaterCreate) {
|
|
18106
|
+
continue;
|
|
18107
|
+
}
|
|
18108
|
+
if (op.track instanceof ReadVarExpr && op.track.name === "$index") {
|
|
18109
|
+
op.trackByFn = importExpr(Identifiers.repeaterTrackByIndex);
|
|
18110
|
+
} else if (op.track instanceof ReadVarExpr && op.track.name === "$item") {
|
|
18111
|
+
op.trackByFn = importExpr(Identifiers.repeaterTrackByIdentity);
|
|
18112
|
+
} else if (isTrackByFunctionCall(job.root.xref, op.track)) {
|
|
18113
|
+
if (op.track.receiver.receiver.view === unit.xref) {
|
|
18114
|
+
op.trackByFn = op.track.receiver;
|
|
18115
|
+
} else {
|
|
18116
|
+
op.trackByFn = importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name);
|
|
18117
|
+
op.track = op.trackByFn;
|
|
18118
|
+
}
|
|
18119
|
+
} else {
|
|
18120
|
+
op.track = transformExpressionsInExpression(op.track, (expr) => {
|
|
18121
|
+
if (expr instanceof ContextExpr) {
|
|
18122
|
+
op.usesComponentInstance = true;
|
|
18123
|
+
return new TrackContextExpr(expr.view);
|
|
18124
|
+
}
|
|
18125
|
+
return expr;
|
|
18126
|
+
}, VisitorContextFlag.None);
|
|
18127
|
+
}
|
|
18128
|
+
}
|
|
18129
|
+
}
|
|
18130
|
+
}
|
|
18131
|
+
function isTrackByFunctionCall(rootView, expr) {
|
|
18132
|
+
if (!(expr instanceof InvokeFunctionExpr) || expr.args.length !== 2) {
|
|
18133
|
+
return false;
|
|
18134
|
+
}
|
|
18135
|
+
if (!(expr.receiver instanceof ReadPropExpr && expr.receiver.receiver instanceof ContextExpr) || expr.receiver.receiver.view !== rootView) {
|
|
18136
|
+
return false;
|
|
18137
|
+
}
|
|
18138
|
+
const [arg0, arg1] = expr.args;
|
|
18139
|
+
if (!(arg0 instanceof ReadVarExpr) || arg0.name !== "$index") {
|
|
18140
|
+
return false;
|
|
18141
|
+
}
|
|
18142
|
+
if (!(arg1 instanceof ReadVarExpr) || arg1.name !== "$item") {
|
|
18143
|
+
return false;
|
|
18144
|
+
}
|
|
18145
|
+
return true;
|
|
18146
|
+
}
|
|
18147
|
+
|
|
18148
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
|
|
17791
18149
|
var phases = [
|
|
17792
18150
|
{ kind: CompilationJobKind.Tmpl, fn: phaseRemoveContentSelectors },
|
|
17793
18151
|
{ kind: CompilationJobKind.Host, fn: phaseHostStylePropertyParsing },
|
|
@@ -17799,6 +18157,8 @@ var phases = [
|
|
|
17799
18157
|
{ kind: CompilationJobKind.Both, fn: phaseAttributeExtraction },
|
|
17800
18158
|
{ kind: CompilationJobKind.Both, fn: phaseParseExtractedStyles },
|
|
17801
18159
|
{ kind: CompilationJobKind.Tmpl, fn: phaseRemoveEmptyBindings },
|
|
18160
|
+
{ kind: CompilationJobKind.Both, fn: phaseCollapseSingletonInterpolations },
|
|
18161
|
+
{ kind: CompilationJobKind.Both, fn: phaseOrdering },
|
|
17802
18162
|
{ kind: CompilationJobKind.Tmpl, fn: phaseConditionals },
|
|
17803
18163
|
{ kind: CompilationJobKind.Tmpl, fn: phasePipeCreation },
|
|
17804
18164
|
{ kind: CompilationJobKind.Tmpl, fn: phaseI18nTextExtraction },
|
|
@@ -17811,7 +18171,10 @@ var phases = [
|
|
|
17811
18171
|
{ kind: CompilationJobKind.Tmpl, fn: phaseSaveRestoreView },
|
|
17812
18172
|
{ kind: CompilationJobKind.Tmpl, fn: phaseFindAnyCasts },
|
|
17813
18173
|
{ kind: CompilationJobKind.Both, fn: phaseResolveDollarEvent },
|
|
18174
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseRepeaterDerivedVars },
|
|
18175
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseTrackVariables },
|
|
17814
18176
|
{ kind: CompilationJobKind.Both, fn: phaseResolveNames },
|
|
18177
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseTrackFnOptimization },
|
|
17815
18178
|
{ kind: CompilationJobKind.Both, fn: phaseResolveContexts },
|
|
17816
18179
|
{ kind: CompilationJobKind.Tmpl, fn: phaseResolveSanitizers },
|
|
17817
18180
|
{ kind: CompilationJobKind.Tmpl, fn: phaseLocalRefs },
|
|
@@ -17820,6 +18183,7 @@ var phases = [
|
|
|
17820
18183
|
{ kind: CompilationJobKind.Both, fn: phaseTemporaryVariables },
|
|
17821
18184
|
{ kind: CompilationJobKind.Tmpl, fn: phaseSlotAllocation },
|
|
17822
18185
|
{ kind: CompilationJobKind.Tmpl, fn: phaseResolveI18nPlaceholders },
|
|
18186
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseTrackFnGeneration },
|
|
17823
18187
|
{ kind: CompilationJobKind.Tmpl, fn: phaseI18nMessageExtraction },
|
|
17824
18188
|
{ kind: CompilationJobKind.Tmpl, fn: phaseI18nConstCollection },
|
|
17825
18189
|
{ kind: CompilationJobKind.Tmpl, fn: phaseConstTraitCollection },
|
|
@@ -17834,8 +18198,6 @@ var phases = [
|
|
|
17834
18198
|
{ kind: CompilationJobKind.Tmpl, fn: phaseEmptyElements },
|
|
17835
18199
|
{ kind: CompilationJobKind.Tmpl, fn: phaseNonbindable },
|
|
17836
18200
|
{ kind: CompilationJobKind.Both, fn: phasePureFunctionExtraction },
|
|
17837
|
-
{ kind: CompilationJobKind.Tmpl, fn: phaseAlignPipeVariadicVarOffset },
|
|
17838
|
-
{ kind: CompilationJobKind.Both, fn: phaseOrdering },
|
|
17839
18201
|
{ kind: CompilationJobKind.Both, fn: phaseReify },
|
|
17840
18202
|
{ kind: CompilationJobKind.Both, fn: phaseChaining }
|
|
17841
18203
|
];
|
|
@@ -17941,7 +18303,7 @@ function emitHostBindingFunction(job) {
|
|
|
17941
18303
|
);
|
|
17942
18304
|
}
|
|
17943
18305
|
|
|
17944
|
-
// bazel-out/
|
|
18306
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
|
|
17945
18307
|
var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
|
|
17946
18308
|
function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds) {
|
|
17947
18309
|
const cpl = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds);
|
|
@@ -18019,6 +18381,8 @@ function ingestNodes(unit, template2) {
|
|
|
18019
18381
|
ingestDeferBlock(unit, node);
|
|
18020
18382
|
} else if (node instanceof Icu) {
|
|
18021
18383
|
ingestIcu(unit, node);
|
|
18384
|
+
} else if (node instanceof ForLoopBlock) {
|
|
18385
|
+
ingestForBlock(unit, node);
|
|
18022
18386
|
} else {
|
|
18023
18387
|
throw new Error(`Unsupported template node: ${node.constructor.name}`);
|
|
18024
18388
|
}
|
|
@@ -18064,7 +18428,7 @@ function ingestTemplate(unit, tmpl) {
|
|
|
18064
18428
|
ingestReferences(tplOp, tmpl);
|
|
18065
18429
|
ingestNodes(childView, tmpl.children);
|
|
18066
18430
|
for (const { name, value } of tmpl.variables) {
|
|
18067
|
-
childView.contextVariables.set(name, value);
|
|
18431
|
+
childView.contextVariables.set(name, value !== "" ? value : "$implicit");
|
|
18068
18432
|
}
|
|
18069
18433
|
if (isPlainTemplate(tmpl) && tmpl.i18n instanceof Message) {
|
|
18070
18434
|
const id = unit.job.allocateXrefId();
|
|
@@ -18073,7 +18437,7 @@ function ingestTemplate(unit, tmpl) {
|
|
|
18073
18437
|
}
|
|
18074
18438
|
}
|
|
18075
18439
|
function ingestContent(unit, content) {
|
|
18076
|
-
const op = createProjectionOp(unit.job.allocateXrefId(), content.selector);
|
|
18440
|
+
const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.sourceSpan);
|
|
18077
18441
|
for (const attr of content.attributes) {
|
|
18078
18442
|
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
|
|
18079
18443
|
}
|
|
@@ -18186,6 +18550,47 @@ function ingestIcu(unit, icu) {
|
|
|
18186
18550
|
throw Error(`Unhandled i18n metadata type for ICU: ${(_a2 = icu.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
18187
18551
|
}
|
|
18188
18552
|
}
|
|
18553
|
+
function ingestForBlock(unit, forBlock) {
|
|
18554
|
+
var _a2;
|
|
18555
|
+
const repeaterView = unit.job.allocateView(unit.xref);
|
|
18556
|
+
const createRepeaterAlias = (ident, repeaterVar) => {
|
|
18557
|
+
repeaterView.aliases.add({
|
|
18558
|
+
kind: SemanticVariableKind.Alias,
|
|
18559
|
+
name: null,
|
|
18560
|
+
identifier: ident,
|
|
18561
|
+
expression: new DerivedRepeaterVarExpr(repeaterView.xref, repeaterVar)
|
|
18562
|
+
});
|
|
18563
|
+
};
|
|
18564
|
+
repeaterView.contextVariables.set(forBlock.item.name, forBlock.item.value);
|
|
18565
|
+
repeaterView.contextVariables.set(forBlock.contextVariables.$index.name, forBlock.contextVariables.$index.value);
|
|
18566
|
+
repeaterView.contextVariables.set(forBlock.contextVariables.$count.name, forBlock.contextVariables.$count.value);
|
|
18567
|
+
createRepeaterAlias(forBlock.contextVariables.$first.name, DerivedRepeaterVarIdentity.First);
|
|
18568
|
+
createRepeaterAlias(forBlock.contextVariables.$last.name, DerivedRepeaterVarIdentity.Last);
|
|
18569
|
+
createRepeaterAlias(forBlock.contextVariables.$even.name, DerivedRepeaterVarIdentity.Even);
|
|
18570
|
+
createRepeaterAlias(forBlock.contextVariables.$odd.name, DerivedRepeaterVarIdentity.Odd);
|
|
18571
|
+
const sourceSpan = convertSourceSpan(forBlock.trackBy.span, forBlock.sourceSpan);
|
|
18572
|
+
const track = convertAst(forBlock.trackBy, unit.job, sourceSpan);
|
|
18573
|
+
ingestNodes(repeaterView, forBlock.children);
|
|
18574
|
+
let emptyView = null;
|
|
18575
|
+
if (forBlock.empty !== null) {
|
|
18576
|
+
emptyView = unit.job.allocateView(unit.xref);
|
|
18577
|
+
ingestNodes(emptyView, forBlock.empty.children);
|
|
18578
|
+
}
|
|
18579
|
+
const varNames = {
|
|
18580
|
+
$index: forBlock.contextVariables.$index.name,
|
|
18581
|
+
$count: forBlock.contextVariables.$count.name,
|
|
18582
|
+
$first: forBlock.contextVariables.$first.name,
|
|
18583
|
+
$last: forBlock.contextVariables.$last.name,
|
|
18584
|
+
$even: forBlock.contextVariables.$even.name,
|
|
18585
|
+
$odd: forBlock.contextVariables.$odd.name,
|
|
18586
|
+
$implicit: forBlock.item.name
|
|
18587
|
+
};
|
|
18588
|
+
const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_a2 = emptyView == null ? void 0 : emptyView.xref) != null ? _a2 : null, track, varNames, forBlock.sourceSpan);
|
|
18589
|
+
unit.create.push(repeaterCreate2);
|
|
18590
|
+
const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan));
|
|
18591
|
+
const repeater2 = createRepeaterOp(repeaterCreate2.xref, expression, forBlock.sourceSpan);
|
|
18592
|
+
unit.update.push(repeater2);
|
|
18593
|
+
}
|
|
18189
18594
|
function convertAst(ast, job, baseSourceSpan) {
|
|
18190
18595
|
if (ast instanceof ASTWithSource) {
|
|
18191
18596
|
return convertAst(ast.ast, job, baseSourceSpan);
|
|
@@ -18367,10 +18772,10 @@ function convertSourceSpan(span, baseSourceSpan) {
|
|
|
18367
18772
|
return new ParseSourceSpan(start, end, fullStart);
|
|
18368
18773
|
}
|
|
18369
18774
|
|
|
18370
|
-
// bazel-out/
|
|
18775
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
|
|
18371
18776
|
var USE_TEMPLATE_PIPELINE = false;
|
|
18372
18777
|
|
|
18373
|
-
// bazel-out/
|
|
18778
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
|
|
18374
18779
|
var IMPORTANT_FLAG = "!important";
|
|
18375
18780
|
var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
|
|
18376
18781
|
var StylingBuilder = class {
|
|
@@ -18703,7 +19108,7 @@ function isEmptyExpression(ast) {
|
|
|
18703
19108
|
return ast instanceof EmptyExpr;
|
|
18704
19109
|
}
|
|
18705
19110
|
|
|
18706
|
-
// bazel-out/
|
|
19111
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
|
|
18707
19112
|
var HtmlParser = class extends Parser2 {
|
|
18708
19113
|
constructor() {
|
|
18709
19114
|
super(getHtmlTagDefinition);
|
|
@@ -18713,7 +19118,7 @@ var HtmlParser = class extends Parser2 {
|
|
|
18713
19118
|
}
|
|
18714
19119
|
};
|
|
18715
19120
|
|
|
18716
|
-
// bazel-out/
|
|
19121
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
|
|
18717
19122
|
var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
|
|
18718
19123
|
var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
|
|
18719
19124
|
var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
|
|
@@ -18755,7 +19160,7 @@ var WhitespaceVisitor = class {
|
|
|
18755
19160
|
return expansionCase;
|
|
18756
19161
|
}
|
|
18757
19162
|
visitBlock(block, context) {
|
|
18758
|
-
return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan);
|
|
19163
|
+
return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);
|
|
18759
19164
|
}
|
|
18760
19165
|
visitBlockParameter(parameter, context) {
|
|
18761
19166
|
return parameter;
|
|
@@ -18779,7 +19184,7 @@ function visitAllWithSiblings(visitor, nodes) {
|
|
|
18779
19184
|
return result;
|
|
18780
19185
|
}
|
|
18781
19186
|
|
|
18782
|
-
// bazel-out/
|
|
19187
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
|
|
18783
19188
|
var PROPERTY_PARTS_SEPARATOR = ".";
|
|
18784
19189
|
var ATTRIBUTE_PREFIX = "attr";
|
|
18785
19190
|
var CLASS_PREFIX = "class";
|
|
@@ -19099,7 +19504,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
|
|
|
19099
19504
|
return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
|
|
19100
19505
|
}
|
|
19101
19506
|
|
|
19102
|
-
// bazel-out/
|
|
19507
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
|
|
19103
19508
|
function isStyleUrlResolvable(url) {
|
|
19104
19509
|
if (url == null || url.length === 0 || url[0] == "/")
|
|
19105
19510
|
return false;
|
|
@@ -19108,7 +19513,7 @@ function isStyleUrlResolvable(url) {
|
|
|
19108
19513
|
}
|
|
19109
19514
|
var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
|
|
19110
19515
|
|
|
19111
|
-
// bazel-out/
|
|
19516
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
|
|
19112
19517
|
var NG_CONTENT_SELECT_ATTR = "select";
|
|
19113
19518
|
var LINK_ELEMENT = "link";
|
|
19114
19519
|
var LINK_STYLE_REL_ATTR = "rel";
|
|
@@ -19178,7 +19583,7 @@ function normalizeNgContentSelect(selectAttr) {
|
|
|
19178
19583
|
return selectAttr;
|
|
19179
19584
|
}
|
|
19180
19585
|
|
|
19181
|
-
// bazel-out/
|
|
19586
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
|
|
19182
19587
|
var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+(.*)/;
|
|
19183
19588
|
var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
|
|
19184
19589
|
var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
|
|
@@ -19263,7 +19668,7 @@ function createSwitchBlock(ast, visitor, bindingParser) {
|
|
|
19263
19668
|
continue;
|
|
19264
19669
|
}
|
|
19265
19670
|
if ((node.name !== "case" || node.parameters.length === 0) && node.name !== "default") {
|
|
19266
|
-
unknownBlocks.push(new UnknownBlock(node.name, node.sourceSpan));
|
|
19671
|
+
unknownBlocks.push(new UnknownBlock(node.name, node.sourceSpan, node.nameSpan));
|
|
19267
19672
|
continue;
|
|
19268
19673
|
}
|
|
19269
19674
|
const expression = node.name === "case" ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;
|
|
@@ -19467,7 +19872,7 @@ function stripOptionalParentheses(param, errors) {
|
|
|
19467
19872
|
return expression.slice(start, end);
|
|
19468
19873
|
}
|
|
19469
19874
|
|
|
19470
|
-
// bazel-out/
|
|
19875
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
|
|
19471
19876
|
var TIME_PATTERN = /^\d+(ms|s)?$/;
|
|
19472
19877
|
var SEPARATOR_PATTERN = /^\s$/;
|
|
19473
19878
|
var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
|
|
@@ -19715,7 +20120,7 @@ function parseDeferredTime(value) {
|
|
|
19715
20120
|
return parseInt(time) * (units === "s" ? 1e3 : 1);
|
|
19716
20121
|
}
|
|
19717
20122
|
|
|
19718
|
-
// bazel-out/
|
|
20123
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
|
|
19719
20124
|
var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
|
|
19720
20125
|
var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
|
|
19721
20126
|
var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
|
|
@@ -19850,7 +20255,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
|
|
|
19850
20255
|
return { triggers, prefetchTriggers };
|
|
19851
20256
|
}
|
|
19852
20257
|
|
|
19853
|
-
// bazel-out/
|
|
20258
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
|
|
19854
20259
|
var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
|
|
19855
20260
|
var KW_BIND_IDX = 1;
|
|
19856
20261
|
var KW_LET_IDX = 2;
|
|
@@ -20068,7 +20473,7 @@ var HtmlAstToIvyAst = class {
|
|
|
20068
20473
|
errorMessage = `Unrecognized block @${block.name}.`;
|
|
20069
20474
|
}
|
|
20070
20475
|
result = {
|
|
20071
|
-
node: new UnknownBlock(block.name, block.sourceSpan),
|
|
20476
|
+
node: new UnknownBlock(block.name, block.sourceSpan, block.nameSpan),
|
|
20072
20477
|
errors: [new ParseError(block.sourceSpan, errorMessage)]
|
|
20073
20478
|
};
|
|
20074
20479
|
break;
|
|
@@ -20281,7 +20686,7 @@ function textContents(node) {
|
|
|
20281
20686
|
}
|
|
20282
20687
|
}
|
|
20283
20688
|
|
|
20284
|
-
// bazel-out/
|
|
20689
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
|
|
20285
20690
|
var TagType;
|
|
20286
20691
|
(function(TagType2) {
|
|
20287
20692
|
TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
|
|
@@ -20416,7 +20821,7 @@ function serializePlaceholderValue(value) {
|
|
|
20416
20821
|
}
|
|
20417
20822
|
}
|
|
20418
20823
|
|
|
20419
|
-
// bazel-out/
|
|
20824
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
|
|
20420
20825
|
var NG_CONTENT_SELECT_ATTR2 = "select";
|
|
20421
20826
|
var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
|
|
20422
20827
|
var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
|
|
@@ -22046,7 +22451,7 @@ function createClosureModeGuard2() {
|
|
|
22046
22451
|
return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
|
|
22047
22452
|
}
|
|
22048
22453
|
|
|
22049
|
-
// bazel-out/
|
|
22454
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
|
|
22050
22455
|
var ATTR_REGEX = /attr\.([^\]]+)/;
|
|
22051
22456
|
var COMPONENT_VARIABLE = "%COMP%";
|
|
22052
22457
|
var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
|
@@ -22648,7 +23053,7 @@ function createHostDirectivesMappingArray(mapping) {
|
|
|
22648
23053
|
return elements.length > 0 ? literalArr(elements) : null;
|
|
22649
23054
|
}
|
|
22650
23055
|
|
|
22651
|
-
// bazel-out/
|
|
23056
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
|
|
22652
23057
|
var R3TargetBinder = class {
|
|
22653
23058
|
constructor(directiveMatcher) {
|
|
22654
23059
|
this.directiveMatcher = directiveMatcher;
|
|
@@ -23240,11 +23645,11 @@ function extractScopedNodeEntities(rootScope) {
|
|
|
23240
23645
|
return templateEntities;
|
|
23241
23646
|
}
|
|
23242
23647
|
|
|
23243
|
-
// bazel-out/
|
|
23648
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
|
|
23244
23649
|
var ResourceLoader = class {
|
|
23245
23650
|
};
|
|
23246
23651
|
|
|
23247
|
-
// bazel-out/
|
|
23652
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
|
|
23248
23653
|
var CompilerFacadeImpl = class {
|
|
23249
23654
|
constructor(jitEvaluator = new JitEvaluator()) {
|
|
23250
23655
|
this.jitEvaluator = jitEvaluator;
|
|
@@ -23796,17 +24201,17 @@ function publishFacade(global) {
|
|
|
23796
24201
|
ng.\u0275compilerFacade = new CompilerFacadeImpl();
|
|
23797
24202
|
}
|
|
23798
24203
|
|
|
23799
|
-
// bazel-out/
|
|
23800
|
-
var VERSION2 = new Version("17.0.0-rc.
|
|
24204
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
|
|
24205
|
+
var VERSION2 = new Version("17.0.0-rc.1");
|
|
23801
24206
|
|
|
23802
|
-
// bazel-out/
|
|
24207
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
23803
24208
|
var _VisitorMode;
|
|
23804
24209
|
(function(_VisitorMode2) {
|
|
23805
24210
|
_VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
|
|
23806
24211
|
_VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
|
|
23807
24212
|
})(_VisitorMode || (_VisitorMode = {}));
|
|
23808
24213
|
|
|
23809
|
-
// bazel-out/
|
|
24214
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
|
|
23810
24215
|
var XmlTagDefinition = class {
|
|
23811
24216
|
constructor() {
|
|
23812
24217
|
this.closedByParent = false;
|
|
@@ -23828,7 +24233,7 @@ var XmlTagDefinition = class {
|
|
|
23828
24233
|
};
|
|
23829
24234
|
var _TAG_DEFINITION = new XmlTagDefinition();
|
|
23830
24235
|
|
|
23831
|
-
// bazel-out/
|
|
24236
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
|
|
23832
24237
|
var FactoryTarget2;
|
|
23833
24238
|
(function(FactoryTarget3) {
|
|
23834
24239
|
FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
|
|
@@ -23838,31 +24243,42 @@ var FactoryTarget2;
|
|
|
23838
24243
|
FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
|
|
23839
24244
|
})(FactoryTarget2 || (FactoryTarget2 = {}));
|
|
23840
24245
|
|
|
23841
|
-
// bazel-out/
|
|
24246
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
|
|
23842
24247
|
publishFacade(_global);
|
|
23843
24248
|
|
|
23844
|
-
// bazel-out/
|
|
24249
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
|
|
23845
24250
|
var import_path2 = require("path");
|
|
23846
24251
|
var import_typescript3 = __toESM(require("typescript"), 1);
|
|
23847
24252
|
|
|
23848
|
-
// bazel-out/
|
|
24253
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
|
|
23849
24254
|
var ngif = "*ngIf";
|
|
24255
|
+
var boundngif = "[ngIf]";
|
|
24256
|
+
var nakedngif = "ngIf";
|
|
23850
24257
|
var ngfor = "*ngFor";
|
|
23851
24258
|
var ngswitch = "[ngSwitch]";
|
|
24259
|
+
var boundcase = "[ngSwitchCase]";
|
|
24260
|
+
var switchcase = "*ngSwitchCase";
|
|
24261
|
+
var nakedcase = "ngSwitchCase";
|
|
24262
|
+
var switchdefault = "*ngSwitchDefault";
|
|
24263
|
+
var nakeddefault = "ngSwitchDefault";
|
|
23852
24264
|
var attributesToMigrate = [
|
|
23853
24265
|
ngif,
|
|
24266
|
+
nakedngif,
|
|
24267
|
+
boundngif,
|
|
23854
24268
|
ngfor,
|
|
23855
|
-
ngswitch
|
|
23856
|
-
|
|
23857
|
-
|
|
23858
|
-
|
|
23859
|
-
|
|
24269
|
+
ngswitch,
|
|
24270
|
+
boundcase,
|
|
24271
|
+
switchcase,
|
|
24272
|
+
nakedcase,
|
|
24273
|
+
switchdefault,
|
|
24274
|
+
nakeddefault
|
|
23860
24275
|
];
|
|
23861
24276
|
var ElementToMigrate = class {
|
|
23862
24277
|
constructor(el, attr) {
|
|
23863
24278
|
__publicField(this, "el");
|
|
23864
24279
|
__publicField(this, "attr");
|
|
23865
24280
|
__publicField(this, "nestCount", 0);
|
|
24281
|
+
__publicField(this, "hasLineBreaks", false);
|
|
23866
24282
|
this.el = el;
|
|
23867
24283
|
this.attr = attr;
|
|
23868
24284
|
}
|
|
@@ -23880,30 +24296,16 @@ var ElementToMigrate = class {
|
|
|
23880
24296
|
}
|
|
23881
24297
|
start(offset) {
|
|
23882
24298
|
var _a2;
|
|
23883
|
-
return ((_a2 = this.el.sourceSpan) == null ? void 0 : _a2.start.offset) -
|
|
24299
|
+
return ((_a2 = this.el.sourceSpan) == null ? void 0 : _a2.start.offset) - offset;
|
|
23884
24300
|
}
|
|
23885
24301
|
end(offset) {
|
|
23886
24302
|
var _a2;
|
|
23887
|
-
return ((_a2 = this.el.sourceSpan) == null ? void 0 : _a2.end.offset) -
|
|
24303
|
+
return ((_a2 = this.el.sourceSpan) == null ? void 0 : _a2.end.offset) - offset;
|
|
23888
24304
|
}
|
|
23889
24305
|
length() {
|
|
23890
24306
|
var _a2, _b2;
|
|
23891
24307
|
return ((_a2 = this.el.sourceSpan) == null ? void 0 : _a2.end.offset) - ((_b2 = this.el.sourceSpan) == null ? void 0 : _b2.start.offset);
|
|
23892
24308
|
}
|
|
23893
|
-
openLength() {
|
|
23894
|
-
var _a2, _b2;
|
|
23895
|
-
return ((_a2 = this.el.children[0]) == null ? void 0 : _a2.sourceSpan.start.offset) - ((_b2 = this.el.sourceSpan) == null ? void 0 : _b2.start.offset);
|
|
23896
|
-
}
|
|
23897
|
-
closeLength() {
|
|
23898
|
-
var _a2, _b2;
|
|
23899
|
-
return ((_a2 = this.el.sourceSpan) == null ? void 0 : _a2.end.offset) - ((_b2 = this.el.children[0]) == null ? void 0 : _b2.sourceSpan.end.offset);
|
|
23900
|
-
}
|
|
23901
|
-
preOffset(newOffset) {
|
|
23902
|
-
return newOffset - this.openLength() + 1;
|
|
23903
|
-
}
|
|
23904
|
-
postOffset(newOffset) {
|
|
23905
|
-
return newOffset - this.closeLength();
|
|
23906
|
-
}
|
|
23907
24309
|
};
|
|
23908
24310
|
var Template2 = class {
|
|
23909
24311
|
constructor(el) {
|
|
@@ -23911,6 +24313,7 @@ var Template2 = class {
|
|
|
23911
24313
|
__publicField(this, "count", 0);
|
|
23912
24314
|
__publicField(this, "contents", "");
|
|
23913
24315
|
__publicField(this, "children", "");
|
|
24316
|
+
__publicField(this, "used", false);
|
|
23914
24317
|
this.el = el;
|
|
23915
24318
|
}
|
|
23916
24319
|
generateContents(tmpl) {
|
|
@@ -23965,36 +24368,17 @@ var ElementCollector = class extends RecursiveVisitor {
|
|
|
23965
24368
|
super.visitElement(el, null);
|
|
23966
24369
|
}
|
|
23967
24370
|
};
|
|
23968
|
-
var CaseCollector = class extends RecursiveVisitor {
|
|
23969
|
-
constructor() {
|
|
23970
|
-
super(...arguments);
|
|
23971
|
-
__publicField(this, "elements", []);
|
|
23972
|
-
}
|
|
23973
|
-
visitElement(el) {
|
|
23974
|
-
if (el.attrs.length > 0) {
|
|
23975
|
-
for (const attr of el.attrs) {
|
|
23976
|
-
if (casesToMigrate.includes(attr.name)) {
|
|
23977
|
-
this.elements.push(new ElementToMigrate(el, attr));
|
|
23978
|
-
}
|
|
23979
|
-
}
|
|
23980
|
-
}
|
|
23981
|
-
super.visitElement(el, null);
|
|
23982
|
-
}
|
|
23983
|
-
};
|
|
23984
24371
|
|
|
23985
|
-
// bazel-out/
|
|
24372
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
|
|
23986
24373
|
function analyze(sourceFile, analyzedFiles) {
|
|
23987
|
-
|
|
23988
|
-
|
|
23989
|
-
if (!import_typescript3.default.isClassDeclaration(node)) {
|
|
23990
|
-
continue;
|
|
23991
|
-
}
|
|
24374
|
+
forEachClass(sourceFile, (node) => {
|
|
24375
|
+
var _a2;
|
|
23992
24376
|
const decorator = (_a2 = import_typescript3.default.getDecorators(node)) == null ? void 0 : _a2.find((dec) => {
|
|
23993
24377
|
return import_typescript3.default.isCallExpression(dec.expression) && import_typescript3.default.isIdentifier(dec.expression.expression) && dec.expression.expression.text === "Component";
|
|
23994
24378
|
});
|
|
23995
24379
|
const metadata = decorator && decorator.expression.arguments.length > 0 && import_typescript3.default.isObjectLiteralExpression(decorator.expression.arguments[0]) ? decorator.expression.arguments[0] : null;
|
|
23996
24380
|
if (!metadata) {
|
|
23997
|
-
|
|
24381
|
+
return;
|
|
23998
24382
|
}
|
|
23999
24383
|
for (const prop of metadata.properties) {
|
|
24000
24384
|
if (!import_typescript3.default.isPropertyAssignment(prop) || !import_typescript3.default.isStringLiteralLike(prop.initializer) || !import_typescript3.default.isIdentifier(prop.name) && !import_typescript3.default.isStringLiteralLike(prop.name)) {
|
|
@@ -24010,7 +24394,7 @@ function analyze(sourceFile, analyzedFiles) {
|
|
|
24010
24394
|
break;
|
|
24011
24395
|
}
|
|
24012
24396
|
}
|
|
24013
|
-
}
|
|
24397
|
+
});
|
|
24014
24398
|
}
|
|
24015
24399
|
function getNestedCount(etm, aggregator) {
|
|
24016
24400
|
if (aggregator.length === 0) {
|
|
@@ -24024,14 +24408,16 @@ function getNestedCount(etm, aggregator) {
|
|
|
24024
24408
|
return getNestedCount(etm, aggregator);
|
|
24025
24409
|
}
|
|
24026
24410
|
}
|
|
24411
|
+
var lb = "\n";
|
|
24027
24412
|
function migrateTemplate(template2) {
|
|
24028
|
-
var _a2, _b2, _c2;
|
|
24413
|
+
var _a2, _b2, _c2, _d2;
|
|
24029
24414
|
let parsed;
|
|
24030
24415
|
let errors = [];
|
|
24031
24416
|
try {
|
|
24032
24417
|
parsed = new HtmlParser().parse(template2, "", {
|
|
24033
24418
|
tokenizeExpansionForms: true,
|
|
24034
|
-
tokenizeBlocks: false
|
|
24419
|
+
tokenizeBlocks: false,
|
|
24420
|
+
preserveLineEndings: true
|
|
24035
24421
|
});
|
|
24036
24422
|
if (parsed.errors && parsed.errors.length > 0) {
|
|
24037
24423
|
for (let error2 of parsed.errors) {
|
|
@@ -24044,6 +24430,8 @@ function migrateTemplate(template2) {
|
|
|
24044
24430
|
return { migrated: null, errors };
|
|
24045
24431
|
}
|
|
24046
24432
|
let result = template2;
|
|
24433
|
+
const lineBreaks = template2.match(/\r|\n/g);
|
|
24434
|
+
const hasLineBreaks = lineBreaks !== null;
|
|
24047
24435
|
const visitor = new ElementCollector();
|
|
24048
24436
|
visitAll2(visitor, parsed.rootNodes);
|
|
24049
24437
|
for (let [key, tmpl] of visitor.templates) {
|
|
@@ -24052,78 +24440,71 @@ function migrateTemplate(template2) {
|
|
|
24052
24440
|
tmpl.count = (_a2 = matches == null ? void 0 : matches.length) != null ? _a2 : 0;
|
|
24053
24441
|
tmpl.generateContents(template2);
|
|
24054
24442
|
}
|
|
24443
|
+
visitor.elements[0].hasLineBreaks = hasLineBreaks;
|
|
24055
24444
|
let prevElEnd = (_c2 = (_b2 = visitor.elements[0]) == null ? void 0 : _b2.el.sourceSpan.end.offset) != null ? _c2 : result.length - 1;
|
|
24056
24445
|
let nestedQueue = [prevElEnd];
|
|
24057
24446
|
for (let i = 1; i < visitor.elements.length; i++) {
|
|
24058
24447
|
let currEl = visitor.elements[i];
|
|
24448
|
+
currEl.hasLineBreaks = hasLineBreaks;
|
|
24059
24449
|
currEl.nestCount = getNestedCount(currEl, nestedQueue);
|
|
24450
|
+
if (currEl.el.sourceSpan.end.offset !== nestedQueue[nestedQueue.length - 1]) {
|
|
24451
|
+
nestedQueue.push(currEl.el.sourceSpan.end.offset);
|
|
24452
|
+
}
|
|
24060
24453
|
}
|
|
24061
24454
|
let offset = 0;
|
|
24455
|
+
let nestLevel = -1;
|
|
24456
|
+
let postOffsets = [];
|
|
24062
24457
|
for (const el of visitor.elements) {
|
|
24063
|
-
|
|
24458
|
+
let migrateResult = { tmpl: result, offsets: { pre: 0, post: 0 } };
|
|
24459
|
+
if (el.nestCount <= nestLevel) {
|
|
24460
|
+
const count = nestLevel - el.nestCount;
|
|
24461
|
+
for (let i = 0; i <= count; i++) {
|
|
24462
|
+
offset += (_d2 = postOffsets.pop()) != null ? _d2 : 0;
|
|
24463
|
+
}
|
|
24464
|
+
}
|
|
24465
|
+
if (el.attr.name === ngif || el.attr.name === nakedngif || el.attr.name === boundngif) {
|
|
24064
24466
|
try {
|
|
24065
|
-
|
|
24066
|
-
result = ifResult.tmpl;
|
|
24067
|
-
offset = ifResult.offset;
|
|
24467
|
+
migrateResult = migrateNgIf(el, visitor.templates, result, offset);
|
|
24068
24468
|
} catch (error2) {
|
|
24069
|
-
errors.push({ type:
|
|
24469
|
+
errors.push({ type: ngif, error: error2 });
|
|
24070
24470
|
}
|
|
24071
24471
|
} else if (el.attr.name === ngfor) {
|
|
24072
24472
|
try {
|
|
24073
|
-
|
|
24074
|
-
result = forResult.tmpl;
|
|
24075
|
-
offset = forResult.offset;
|
|
24473
|
+
migrateResult = migrateNgFor(el, result, offset);
|
|
24076
24474
|
} catch (error2) {
|
|
24077
24475
|
errors.push({ type: ngfor, error: error2 });
|
|
24078
24476
|
}
|
|
24079
24477
|
} else if (el.attr.name === ngswitch) {
|
|
24080
24478
|
try {
|
|
24081
|
-
|
|
24082
|
-
result = switchResult.tmpl;
|
|
24083
|
-
offset = switchResult.offset;
|
|
24479
|
+
migrateResult = migrateNgSwitch(el, result, offset);
|
|
24084
24480
|
} catch (error2) {
|
|
24085
|
-
errors.push({ type:
|
|
24481
|
+
errors.push({ type: ngswitch, error: error2 });
|
|
24482
|
+
}
|
|
24483
|
+
} else if (el.attr.name === switchcase || el.attr.name === nakedcase || el.attr.name === boundcase) {
|
|
24484
|
+
try {
|
|
24485
|
+
migrateResult = migrateNgSwitchCase(el, result, offset);
|
|
24486
|
+
} catch (error2) {
|
|
24487
|
+
errors.push({ type: ngswitch, error: error2 });
|
|
24488
|
+
}
|
|
24489
|
+
} else if (el.attr.name === switchdefault || el.attr.name === nakeddefault) {
|
|
24490
|
+
try {
|
|
24491
|
+
migrateResult = migrateNgSwitchDefault(el, result, offset);
|
|
24492
|
+
} catch (error2) {
|
|
24493
|
+
errors.push({ type: ngswitch, error: error2 });
|
|
24086
24494
|
}
|
|
24087
24495
|
}
|
|
24496
|
+
result = migrateResult.tmpl;
|
|
24497
|
+
offset += migrateResult.offsets.pre;
|
|
24498
|
+
postOffsets.push(migrateResult.offsets.post);
|
|
24499
|
+
nestLevel = el.nestCount;
|
|
24088
24500
|
}
|
|
24089
24501
|
for (const [_, t] of visitor.templates) {
|
|
24090
|
-
if (t.count < 2) {
|
|
24502
|
+
if (t.count < 2 && t.used) {
|
|
24091
24503
|
result = result.replace(t.contents, "");
|
|
24092
24504
|
}
|
|
24093
24505
|
}
|
|
24094
24506
|
return { migrated: result, errors };
|
|
24095
24507
|
}
|
|
24096
|
-
function migrateNgFor(etm, tmpl, offset) {
|
|
24097
|
-
const aliasWithEqualRegexp = /=\s+(count|index|first|last|even|odd)/gm;
|
|
24098
|
-
const aliasWithAsRegexp = /(count|index|first|last|even|odd)\s+as/gm;
|
|
24099
|
-
const aliases = [];
|
|
24100
|
-
const parts = etm.attr.value.split(";");
|
|
24101
|
-
const condition = parts[0].replace("let ", "");
|
|
24102
|
-
const loopVar = condition.split(" of ")[0];
|
|
24103
|
-
let trackBy = loopVar;
|
|
24104
|
-
for (let i = 1; i < parts.length; i++) {
|
|
24105
|
-
const part = parts[i].trim();
|
|
24106
|
-
if (part.startsWith("trackBy:")) {
|
|
24107
|
-
const trackByFn = part.replace("trackBy:", "").trim();
|
|
24108
|
-
trackBy = `${trackByFn}($index, ${loopVar})`;
|
|
24109
|
-
}
|
|
24110
|
-
if (part.match(aliasWithEqualRegexp)) {
|
|
24111
|
-
const aliasParts = part.split("=");
|
|
24112
|
-
aliases.push(` ${aliasParts[0].trim()} = $${aliasParts[1].trim()}`);
|
|
24113
|
-
}
|
|
24114
|
-
if (part.match(aliasWithAsRegexp)) {
|
|
24115
|
-
const aliasParts = part.split(/\s+as\s+/);
|
|
24116
|
-
aliases.push(` let ${aliasParts[1].trim()} = $${aliasParts[0].trim()}`);
|
|
24117
|
-
}
|
|
24118
|
-
}
|
|
24119
|
-
const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
|
|
24120
|
-
const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {`;
|
|
24121
|
-
const mainBlock = getMainBlock(etm, tmpl, offset);
|
|
24122
|
-
const forBlock = startBlock + mainBlock + "}";
|
|
24123
|
-
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + forBlock + tmpl.slice(etm.end(offset));
|
|
24124
|
-
offset = offset + etm.length() - forBlock.length;
|
|
24125
|
-
return { tmpl: updatedTmpl, offset };
|
|
24126
|
-
}
|
|
24127
24508
|
function migrateNgIf(etm, ngTemplates, tmpl, offset) {
|
|
24128
24509
|
const matchThen = etm.attr.value.match(/;\s+then/gm);
|
|
24129
24510
|
const matchElse = etm.attr.value.match(/;\s+else/gm);
|
|
@@ -24135,105 +24516,176 @@ function migrateNgIf(etm, ngTemplates, tmpl, offset) {
|
|
|
24135
24516
|
return buildIfBlock(etm, tmpl, offset);
|
|
24136
24517
|
}
|
|
24137
24518
|
function buildIfBlock(etm, tmpl, offset) {
|
|
24519
|
+
const lbString = etm.hasLineBreaks ? lb : "";
|
|
24138
24520
|
const condition = etm.attr.value.replace(" as ", "; as ");
|
|
24139
|
-
const
|
|
24140
|
-
const
|
|
24521
|
+
const originals = getOriginals(etm, tmpl, offset);
|
|
24522
|
+
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
24523
|
+
const startBlock = `@if (${condition}) {${lbString}${start}`;
|
|
24524
|
+
const endBlock = `${end}${lbString}}`;
|
|
24525
|
+
const ifBlock = startBlock + middle + endBlock;
|
|
24141
24526
|
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + ifBlock + tmpl.slice(etm.end(offset));
|
|
24142
|
-
|
|
24143
|
-
|
|
24527
|
+
const pre = originals.start.length - startBlock.length;
|
|
24528
|
+
const post = originals.end.length - endBlock.length;
|
|
24529
|
+
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
24144
24530
|
}
|
|
24145
24531
|
function buildIfElseBlock(etm, ngTemplates, tmpl, elseString, offset) {
|
|
24532
|
+
const lbString = etm.hasLineBreaks ? lb : "";
|
|
24146
24533
|
const condition = etm.getCondition(elseString).replace(" as ", "; as ");
|
|
24534
|
+
const originals = getOriginals(etm, tmpl, offset);
|
|
24147
24535
|
const elseTmpl = ngTemplates.get(`#${etm.getTemplateName(elseString)}`);
|
|
24148
|
-
const
|
|
24149
|
-
const
|
|
24150
|
-
const elseBlock =
|
|
24151
|
-
const postBlock = elseBlock + elseTmpl.children +
|
|
24152
|
-
const ifElseBlock = startBlock +
|
|
24153
|
-
|
|
24154
|
-
|
|
24536
|
+
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
24537
|
+
const startBlock = `@if (${condition}) {${lbString}${start}`;
|
|
24538
|
+
const elseBlock = `${end}${lbString}} @else {${lbString}`;
|
|
24539
|
+
const postBlock = elseBlock + elseTmpl.children + `${lbString}}`;
|
|
24540
|
+
const ifElseBlock = startBlock + middle + postBlock;
|
|
24541
|
+
const tmplStart = tmpl.slice(0, etm.start(offset));
|
|
24542
|
+
const tmplEnd = tmpl.slice(etm.end(offset));
|
|
24155
24543
|
const updatedTmpl = tmplStart + ifElseBlock + tmplEnd;
|
|
24156
|
-
offset = offset + etm.preOffset(startBlock.length) + etm.postOffset(mainBlock.length + postBlock.length);
|
|
24157
24544
|
elseTmpl.count--;
|
|
24158
|
-
|
|
24545
|
+
elseTmpl.used = true;
|
|
24546
|
+
const pre = originals.start.length - startBlock.length;
|
|
24547
|
+
const post = originals.end.length - postBlock.length;
|
|
24548
|
+
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
24159
24549
|
}
|
|
24160
24550
|
function buildIfThenElseBlock(etm, ngTemplates, tmpl, thenString, elseString, offset) {
|
|
24161
24551
|
const condition = etm.getCondition(thenString).replace(" as ", "; as ");
|
|
24162
|
-
const
|
|
24163
|
-
const
|
|
24552
|
+
const lbString = etm.hasLineBreaks ? lb : "";
|
|
24553
|
+
const originals = getOriginals(etm, tmpl, offset);
|
|
24554
|
+
const startBlock = `@if (${condition}) {${lbString}`;
|
|
24555
|
+
const elseBlock = `${lbString}} @else {${lbString}`;
|
|
24164
24556
|
const thenTmpl = ngTemplates.get(`#${etm.getTemplateName(thenString, elseString)}`);
|
|
24165
24557
|
const elseTmpl = ngTemplates.get(`#${etm.getTemplateName(elseString)}`);
|
|
24166
|
-
const postBlock = thenTmpl.children + elseBlock + elseTmpl.children +
|
|
24558
|
+
const postBlock = thenTmpl.children + elseBlock + elseTmpl.children + `${lbString}}`;
|
|
24167
24559
|
const ifThenElseBlock = startBlock + postBlock;
|
|
24168
|
-
|
|
24169
|
-
|
|
24560
|
+
const tmplStart = tmpl.slice(0, etm.start(offset));
|
|
24561
|
+
const tmplEnd = tmpl.slice(etm.end(offset));
|
|
24170
24562
|
const updatedTmpl = tmplStart + ifThenElseBlock + tmplEnd;
|
|
24171
|
-
offset = offset + etm.preOffset(startBlock.length) + etm.postOffset(postBlock.length);
|
|
24172
24563
|
thenTmpl.count--;
|
|
24564
|
+
thenTmpl.used = true;
|
|
24173
24565
|
elseTmpl.count--;
|
|
24174
|
-
|
|
24566
|
+
elseTmpl.used = true;
|
|
24567
|
+
const pre = originals.start.length - startBlock.length;
|
|
24568
|
+
const post = originals.end.length - postBlock.length;
|
|
24569
|
+
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
24175
24570
|
}
|
|
24176
|
-
function
|
|
24177
|
-
|
|
24178
|
-
|
|
24179
|
-
|
|
24180
|
-
|
|
24571
|
+
function migrateNgFor(etm, tmpl, offset) {
|
|
24572
|
+
const aliasWithEqualRegexp = /=\s+(count|index|first|last|even|odd)/gm;
|
|
24573
|
+
const aliasWithAsRegexp = /(count|index|first|last|even|odd)\s+as/gm;
|
|
24574
|
+
const aliases = [];
|
|
24575
|
+
const lbString = etm.hasLineBreaks ? lb : "";
|
|
24576
|
+
const lbSpaces = etm.hasLineBreaks ? `${lb} ` : "";
|
|
24577
|
+
const parts = etm.attr.value.split(";");
|
|
24578
|
+
const originals = getOriginals(etm, tmpl, offset);
|
|
24579
|
+
const condition = parts[0].replace("let ", "");
|
|
24580
|
+
const loopVar = condition.split(" of ")[0];
|
|
24581
|
+
let trackBy = loopVar;
|
|
24582
|
+
for (let i = 1; i < parts.length; i++) {
|
|
24583
|
+
const part = parts[i].trim();
|
|
24584
|
+
if (part.startsWith("trackBy:")) {
|
|
24585
|
+
const trackByFn = part.replace("trackBy:", "").trim();
|
|
24586
|
+
trackBy = `${trackByFn}($index, ${loopVar})`;
|
|
24587
|
+
}
|
|
24588
|
+
if (part.match(aliasWithEqualRegexp)) {
|
|
24589
|
+
const aliasParts = part.split("=");
|
|
24590
|
+
aliases.push(` ${aliasParts[0].trim()} = $${aliasParts[1].trim()}`);
|
|
24591
|
+
}
|
|
24592
|
+
if (part.match(aliasWithAsRegexp)) {
|
|
24593
|
+
const aliasParts = part.split(/\s+as\s+/);
|
|
24594
|
+
aliases.push(` let ${aliasParts[1].trim()} = $${aliasParts[0].trim()}`);
|
|
24595
|
+
}
|
|
24181
24596
|
}
|
|
24182
|
-
const
|
|
24183
|
-
const
|
|
24184
|
-
const
|
|
24185
|
-
const
|
|
24186
|
-
|
|
24597
|
+
const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
|
|
24598
|
+
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
24599
|
+
const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {${lbSpaces}${start}`;
|
|
24600
|
+
const endBlock = `${end}${lbString}}`;
|
|
24601
|
+
const forBlock = startBlock + middle + endBlock;
|
|
24602
|
+
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + forBlock + tmpl.slice(etm.end(offset));
|
|
24603
|
+
const pre = originals.start.length - startBlock.length;
|
|
24604
|
+
const post = originals.end.length - endBlock.length;
|
|
24605
|
+
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
24187
24606
|
}
|
|
24188
|
-
function
|
|
24189
|
-
|
|
24190
|
-
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
const switchBlock = openTag + startBlock + cases.join(" ") + `}` + closeTag;
|
|
24194
|
-
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + switchBlock + tmpl.slice(etm.end(offset));
|
|
24195
|
-
const difference = etm.length() - switchBlock.length;
|
|
24196
|
-
offset = offset + difference;
|
|
24197
|
-
return { tmpl: updatedTmpl, offset };
|
|
24198
|
-
}
|
|
24199
|
-
function getSwitchBlockElements(etm, tmpl, offset) {
|
|
24200
|
-
const attrStart = etm.attr.keySpan.start.offset - 1 - etm.nestCount - offset;
|
|
24201
|
-
const valEnd = etm.attr.valueSpan.end.offset + 1 - etm.nestCount - offset;
|
|
24202
|
-
const childStart = etm.el.children[0].sourceSpan.start.offset - etm.nestCount - offset;
|
|
24203
|
-
const childEnd = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - etm.nestCount - offset;
|
|
24204
|
-
let openTag = tmpl.slice(etm.start(offset), attrStart) + tmpl.slice(valEnd, childStart);
|
|
24205
|
-
if (tmpl.slice(childStart, childStart + 1) === "\n") {
|
|
24206
|
-
openTag += "\n";
|
|
24207
|
-
}
|
|
24208
|
-
let closeTag = tmpl.slice(childEnd, etm.end(offset));
|
|
24209
|
-
if (tmpl.slice(childEnd - 1, childEnd) === "\n") {
|
|
24210
|
-
closeTag = "\n" + closeTag;
|
|
24607
|
+
function getOriginals(etm, tmpl, offset) {
|
|
24608
|
+
if (etm.el.children.length > 0) {
|
|
24609
|
+
const start2 = tmpl.slice(etm.el.sourceSpan.start.offset - offset, etm.el.children[0].sourceSpan.start.offset - offset);
|
|
24610
|
+
const end = tmpl.slice(etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset, etm.el.sourceSpan.end.offset - offset);
|
|
24611
|
+
return { start: start2, end };
|
|
24211
24612
|
}
|
|
24212
|
-
|
|
24213
|
-
|
|
24214
|
-
closeTag,
|
|
24215
|
-
children: etm.el.children
|
|
24216
|
-
};
|
|
24613
|
+
const start = tmpl.slice(etm.el.sourceSpan.start.offset - offset, etm.el.sourceSpan.end.offset - offset);
|
|
24614
|
+
return { start, end: "" };
|
|
24217
24615
|
}
|
|
24218
|
-
function
|
|
24219
|
-
|
|
24220
|
-
|
|
24221
|
-
|
|
24616
|
+
function getMainBlock(etm, tmpl, offset) {
|
|
24617
|
+
if ((etm.el.name === "ng-container" || etm.el.name === "ng-template") && etm.el.attrs.length === 1) {
|
|
24618
|
+
const childStart2 = etm.el.children[0].sourceSpan.start.offset - offset;
|
|
24619
|
+
const childEnd2 = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
|
|
24620
|
+
const middle2 = tmpl.slice(childStart2, childEnd2);
|
|
24621
|
+
return { start: "", middle: middle2, end: "" };
|
|
24622
|
+
}
|
|
24623
|
+
const attrStart = etm.attr.keySpan.start.offset - 1 - offset;
|
|
24624
|
+
const valEnd = (etm.attr.valueSpan ? etm.attr.valueSpan.end.offset + 1 : etm.attr.keySpan.end.offset) - offset;
|
|
24625
|
+
let childStart = valEnd;
|
|
24626
|
+
let childEnd = valEnd;
|
|
24627
|
+
if (etm.el.children.length > 0) {
|
|
24628
|
+
childStart = etm.el.children[0].sourceSpan.start.offset - offset;
|
|
24629
|
+
childEnd = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
|
|
24630
|
+
}
|
|
24631
|
+
let start = tmpl.slice(etm.start(offset), attrStart);
|
|
24632
|
+
start += tmpl.slice(valEnd, childStart);
|
|
24633
|
+
const middle = tmpl.slice(childStart, childEnd);
|
|
24634
|
+
const end = tmpl.slice(childEnd, etm.end(offset));
|
|
24635
|
+
return { start, middle, end };
|
|
24222
24636
|
}
|
|
24223
|
-
function
|
|
24224
|
-
|
|
24225
|
-
const
|
|
24226
|
-
const
|
|
24227
|
-
const
|
|
24228
|
-
const
|
|
24229
|
-
|
|
24230
|
-
|
|
24231
|
-
|
|
24232
|
-
const
|
|
24233
|
-
|
|
24637
|
+
function migrateNgSwitch(etm, tmpl, offset) {
|
|
24638
|
+
const lbString = etm.hasLineBreaks ? lb : "";
|
|
24639
|
+
const condition = etm.attr.value;
|
|
24640
|
+
const originals = getOriginals(etm, tmpl, offset);
|
|
24641
|
+
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
24642
|
+
const startBlock = `${start}${lbString}@switch (${condition}) {`;
|
|
24643
|
+
const endBlock = `}${lbString}${end}`;
|
|
24644
|
+
const switchBlock = startBlock + middle + endBlock;
|
|
24645
|
+
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + switchBlock + tmpl.slice(etm.end(offset));
|
|
24646
|
+
const pre = originals.start.length - startBlock.length;
|
|
24647
|
+
const post = originals.end.length - endBlock.length;
|
|
24648
|
+
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
24649
|
+
}
|
|
24650
|
+
function migrateNgSwitchCase(etm, tmpl, offset) {
|
|
24651
|
+
const lbString = etm.hasLineBreaks ? lb : "";
|
|
24652
|
+
const lbSpaces = etm.hasLineBreaks ? " " : "";
|
|
24653
|
+
const leadingSpace = etm.hasLineBreaks ? "" : " ";
|
|
24654
|
+
const condition = etm.attr.value;
|
|
24655
|
+
const originals = getOriginals(etm, tmpl, offset);
|
|
24656
|
+
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
24657
|
+
const startBlock = `${leadingSpace}@case (${condition}) {${leadingSpace}${lbString}${lbSpaces}${start}`;
|
|
24658
|
+
const endBlock = `${end}${lbString}${leadingSpace}}`;
|
|
24659
|
+
const defaultBlock = startBlock + middle + endBlock;
|
|
24660
|
+
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
|
|
24661
|
+
const pre = originals.start.length - startBlock.length;
|
|
24662
|
+
const post = originals.end.length - endBlock.length;
|
|
24663
|
+
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
24664
|
+
}
|
|
24665
|
+
function migrateNgSwitchDefault(etm, tmpl, offset) {
|
|
24666
|
+
const lbString = etm.hasLineBreaks ? lb : "";
|
|
24667
|
+
const lbSpaces = etm.hasLineBreaks ? " " : "";
|
|
24668
|
+
const leadingSpace = etm.hasLineBreaks ? "" : " ";
|
|
24669
|
+
const originals = getOriginals(etm, tmpl, offset);
|
|
24670
|
+
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
24671
|
+
const startBlock = `${leadingSpace}@default {${leadingSpace}${lbString}${lbSpaces}${start}`;
|
|
24672
|
+
const endBlock = `${end}${lbString}${leadingSpace}}`;
|
|
24673
|
+
const defaultBlock = startBlock + middle + endBlock;
|
|
24674
|
+
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
|
|
24675
|
+
const pre = originals.start.length - startBlock.length;
|
|
24676
|
+
const post = originals.end.length - endBlock.length;
|
|
24677
|
+
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
24678
|
+
}
|
|
24679
|
+
function forEachClass(sourceFile, callback) {
|
|
24680
|
+
sourceFile.forEachChild(function walk(node) {
|
|
24681
|
+
if (import_typescript3.default.isClassDeclaration(node)) {
|
|
24682
|
+
callback(node);
|
|
24683
|
+
}
|
|
24684
|
+
node.forEachChild(walk);
|
|
24685
|
+
});
|
|
24234
24686
|
}
|
|
24235
24687
|
|
|
24236
|
-
// bazel-out/
|
|
24688
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
|
|
24237
24689
|
function control_flow_migration_default() {
|
|
24238
24690
|
return (tree, context) => __async(this, null, function* () {
|
|
24239
24691
|
const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
|
|
@@ -24299,6 +24751,14 @@ function generateErrorMessage(path2, errors) {
|
|
|
24299
24751
|
}
|
|
24300
24752
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24301
24753
|
0 && (module.exports = {});
|
|
24754
|
+
/**
|
|
24755
|
+
*
|
|
24756
|
+
* @license
|
|
24757
|
+
* Copyright Google LLC All Rights Reserved.
|
|
24758
|
+
*
|
|
24759
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
24760
|
+
* found in the LICENSE file at https://angular.io/license
|
|
24761
|
+
*/
|
|
24302
24762
|
/**
|
|
24303
24763
|
* @license
|
|
24304
24764
|
* Copyright Google LLC All Rights Reserved.
|