@angular/compiler 15.1.0-next.1 → 15.1.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/expression_parser/ast.mjs +13 -13
- package/esm2020/src/i18n/big_integer.mjs +7 -7
- package/esm2020/src/i18n/digest.mjs +93 -60
- package/esm2020/src/ml_parser/interpolation_config.mjs +5 -5
- package/esm2020/src/ml_parser/parser.mjs +4 -4
- package/esm2020/src/output/abstract_emitter.mjs +4 -4
- package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/directive.mjs +1 -1
- package/esm2020/src/render3/partial/factory.mjs +1 -1
- package/esm2020/src/render3/partial/injectable.mjs +1 -1
- package/esm2020/src/render3/partial/injector.mjs +1 -1
- package/esm2020/src/render3/partial/ng_module.mjs +1 -1
- package/esm2020/src/render3/partial/pipe.mjs +1 -1
- package/esm2020/src/render3/view/i18n/context.mjs +1 -2
- package/esm2020/src/render3/view/template.mjs +6 -12
- package/esm2020/src/shadow_css.mjs +3 -2
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +265 -237
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +265 -237
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
package/fesm2020/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.
|
|
2
|
+
* @license Angular v15.1.0-next.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -658,135 +658,6 @@ var core = /*#__PURE__*/Object.freeze({
|
|
|
658
658
|
parseSelectorToR3Selector: parseSelectorToR3Selector
|
|
659
659
|
});
|
|
660
660
|
|
|
661
|
-
/**
|
|
662
|
-
* @license
|
|
663
|
-
* Copyright Google LLC All Rights Reserved.
|
|
664
|
-
*
|
|
665
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
666
|
-
* found in the LICENSE file at https://angular.io/license
|
|
667
|
-
*/
|
|
668
|
-
const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
|
|
669
|
-
function dashCaseToCamelCase(input) {
|
|
670
|
-
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
|
671
|
-
}
|
|
672
|
-
function splitAtColon(input, defaultValues) {
|
|
673
|
-
return _splitAt(input, ':', defaultValues);
|
|
674
|
-
}
|
|
675
|
-
function splitAtPeriod(input, defaultValues) {
|
|
676
|
-
return _splitAt(input, '.', defaultValues);
|
|
677
|
-
}
|
|
678
|
-
function _splitAt(input, character, defaultValues) {
|
|
679
|
-
const characterIndex = input.indexOf(character);
|
|
680
|
-
if (characterIndex == -1)
|
|
681
|
-
return defaultValues;
|
|
682
|
-
return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
|
|
683
|
-
}
|
|
684
|
-
function noUndefined(val) {
|
|
685
|
-
return val === undefined ? null : val;
|
|
686
|
-
}
|
|
687
|
-
function error(msg) {
|
|
688
|
-
throw new Error(`Internal Error: ${msg}`);
|
|
689
|
-
}
|
|
690
|
-
// Escape characters that have a special meaning in Regular Expressions
|
|
691
|
-
function escapeRegExp(s) {
|
|
692
|
-
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
|
693
|
-
}
|
|
694
|
-
function utf8Encode(str) {
|
|
695
|
-
let encoded = [];
|
|
696
|
-
for (let index = 0; index < str.length; index++) {
|
|
697
|
-
let codePoint = str.charCodeAt(index);
|
|
698
|
-
// decode surrogate
|
|
699
|
-
// see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
700
|
-
if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {
|
|
701
|
-
const low = str.charCodeAt(index + 1);
|
|
702
|
-
if (low >= 0xdc00 && low <= 0xdfff) {
|
|
703
|
-
index++;
|
|
704
|
-
codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
if (codePoint <= 0x7f) {
|
|
708
|
-
encoded.push(codePoint);
|
|
709
|
-
}
|
|
710
|
-
else if (codePoint <= 0x7ff) {
|
|
711
|
-
encoded.push(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);
|
|
712
|
-
}
|
|
713
|
-
else if (codePoint <= 0xffff) {
|
|
714
|
-
encoded.push((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
715
|
-
}
|
|
716
|
-
else if (codePoint <= 0x1fffff) {
|
|
717
|
-
encoded.push(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
return encoded;
|
|
721
|
-
}
|
|
722
|
-
function stringify(token) {
|
|
723
|
-
if (typeof token === 'string') {
|
|
724
|
-
return token;
|
|
725
|
-
}
|
|
726
|
-
if (Array.isArray(token)) {
|
|
727
|
-
return '[' + token.map(stringify).join(', ') + ']';
|
|
728
|
-
}
|
|
729
|
-
if (token == null) {
|
|
730
|
-
return '' + token;
|
|
731
|
-
}
|
|
732
|
-
if (token.overriddenName) {
|
|
733
|
-
return `${token.overriddenName}`;
|
|
734
|
-
}
|
|
735
|
-
if (token.name) {
|
|
736
|
-
return `${token.name}`;
|
|
737
|
-
}
|
|
738
|
-
if (!token.toString) {
|
|
739
|
-
return 'object';
|
|
740
|
-
}
|
|
741
|
-
// WARNING: do not try to `JSON.stringify(token)` here
|
|
742
|
-
// see https://github.com/angular/angular/issues/23440
|
|
743
|
-
const res = token.toString();
|
|
744
|
-
if (res == null) {
|
|
745
|
-
return '' + res;
|
|
746
|
-
}
|
|
747
|
-
const newLineIndex = res.indexOf('\n');
|
|
748
|
-
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
|
|
749
|
-
}
|
|
750
|
-
class Version {
|
|
751
|
-
constructor(full) {
|
|
752
|
-
this.full = full;
|
|
753
|
-
const splits = full.split('.');
|
|
754
|
-
this.major = splits[0];
|
|
755
|
-
this.minor = splits[1];
|
|
756
|
-
this.patch = splits.slice(2).join('.');
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
// Check `global` first, because in Node tests both `global` and `window` may be defined and our
|
|
760
|
-
// `_global` variable should point to the NodeJS `global` in that case. Note: Typeof/Instanceof
|
|
761
|
-
// checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
|
|
762
|
-
// https://github.com/terser/terser/issues/250.
|
|
763
|
-
const _global = ( /* @__PURE__ */(() => (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
|
|
764
|
-
(typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
|
|
765
|
-
self instanceof WorkerGlobalScope && self))());
|
|
766
|
-
function newArray(size, value) {
|
|
767
|
-
const list = [];
|
|
768
|
-
for (let i = 0; i < size; i++) {
|
|
769
|
-
list.push(value);
|
|
770
|
-
}
|
|
771
|
-
return list;
|
|
772
|
-
}
|
|
773
|
-
/**
|
|
774
|
-
* Partitions a given array into 2 arrays, based on a boolean value returned by the condition
|
|
775
|
-
* function.
|
|
776
|
-
*
|
|
777
|
-
* @param arr Input array that should be partitioned
|
|
778
|
-
* @param conditionFn Condition function that is called for each item in a given array and returns a
|
|
779
|
-
* boolean value.
|
|
780
|
-
*/
|
|
781
|
-
function partitionArray(arr, conditionFn) {
|
|
782
|
-
const truthy = [];
|
|
783
|
-
const falsy = [];
|
|
784
|
-
for (const item of arr) {
|
|
785
|
-
(conditionFn(item) ? truthy : falsy).push(item);
|
|
786
|
-
}
|
|
787
|
-
return [truthy, falsy];
|
|
788
|
-
}
|
|
789
|
-
|
|
790
661
|
/**
|
|
791
662
|
* @license
|
|
792
663
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -802,18 +673,18 @@ function partitionArray(arr, conditionFn) {
|
|
|
802
673
|
* to reduce memory pressure of allocation for the digits array.
|
|
803
674
|
*/
|
|
804
675
|
class BigInteger {
|
|
805
|
-
/**
|
|
806
|
-
* Creates a big integer using its individual digits in little endian storage.
|
|
807
|
-
*/
|
|
808
|
-
constructor(digits) {
|
|
809
|
-
this.digits = digits;
|
|
810
|
-
}
|
|
811
676
|
static zero() {
|
|
812
677
|
return new BigInteger([0]);
|
|
813
678
|
}
|
|
814
679
|
static one() {
|
|
815
680
|
return new BigInteger([1]);
|
|
816
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* Creates a big integer using its individual digits in little endian storage.
|
|
684
|
+
*/
|
|
685
|
+
constructor(digits) {
|
|
686
|
+
this.digits = digits;
|
|
687
|
+
}
|
|
817
688
|
/**
|
|
818
689
|
* Creates a clone of this instance.
|
|
819
690
|
*/
|
|
@@ -974,6 +845,10 @@ class BigIntExponentiation {
|
|
|
974
845
|
* Use of this source code is governed by an MIT-style license that can be
|
|
975
846
|
* found in the LICENSE file at https://angular.io/license
|
|
976
847
|
*/
|
|
848
|
+
/**
|
|
849
|
+
* A lazily created TextEncoder instance for converting strings into UTF-8 bytes
|
|
850
|
+
*/
|
|
851
|
+
let textEncoder;
|
|
977
852
|
/**
|
|
978
853
|
* Return the message id or compute it using the XLIFF1 digest.
|
|
979
854
|
*/
|
|
@@ -1057,10 +932,11 @@ class _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor {
|
|
|
1057
932
|
* DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.
|
|
1058
933
|
*/
|
|
1059
934
|
function sha1(str) {
|
|
1060
|
-
|
|
935
|
+
textEncoder ?? (textEncoder = new TextEncoder());
|
|
936
|
+
const utf8 = [...textEncoder.encode(str)];
|
|
1061
937
|
const words32 = bytesToWords32(utf8, Endian.Big);
|
|
1062
938
|
const len = utf8.length * 8;
|
|
1063
|
-
const w =
|
|
939
|
+
const w = new Uint32Array(80);
|
|
1064
940
|
let a = 0x67452301, b = 0xefcdab89, c = 0x98badcfe, d = 0x10325476, e = 0xc3d2e1f0;
|
|
1065
941
|
words32[len >> 5] |= 0x80 << (24 - len % 32);
|
|
1066
942
|
words32[((len + 64 >> 9) << 4) + 15] = len;
|
|
@@ -1089,7 +965,17 @@ function sha1(str) {
|
|
|
1089
965
|
d = add32(d, h3);
|
|
1090
966
|
e = add32(e, h4);
|
|
1091
967
|
}
|
|
1092
|
-
|
|
968
|
+
// Convert the output parts to a 160-bit hexadecimal string
|
|
969
|
+
return toHexU32(a) + toHexU32(b) + toHexU32(c) + toHexU32(d) + toHexU32(e);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Convert and format a number as a string representing a 32-bit unsigned hexadecimal number.
|
|
973
|
+
* @param value The value to format as a string.
|
|
974
|
+
* @returns A hexadecimal string representing the value.
|
|
975
|
+
*/
|
|
976
|
+
function toHexU32(value) {
|
|
977
|
+
// unsigned right shift of zero ensures an unsigned 32-bit number
|
|
978
|
+
return (value >>> 0).toString(16).padStart(8, '0');
|
|
1093
979
|
}
|
|
1094
980
|
function fk(index, b, c, d) {
|
|
1095
981
|
if (index < 20) {
|
|
@@ -1112,9 +998,11 @@ function fk(index, b, c, d) {
|
|
|
1112
998
|
* https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java
|
|
1113
999
|
*/
|
|
1114
1000
|
function fingerprint(str) {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1001
|
+
textEncoder ?? (textEncoder = new TextEncoder());
|
|
1002
|
+
const utf8 = textEncoder.encode(str);
|
|
1003
|
+
const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength);
|
|
1004
|
+
let hi = hash32(view, utf8.length, 0);
|
|
1005
|
+
let lo = hash32(view, utf8.length, 102072);
|
|
1118
1006
|
if (hi == 0 && (lo == 0 || lo == 1)) {
|
|
1119
1007
|
hi = hi ^ 0x130f9bef;
|
|
1120
1008
|
lo = lo ^ -0x6b5f56d8;
|
|
@@ -1131,52 +1019,92 @@ function computeMsgId(msg, meaning = '') {
|
|
|
1131
1019
|
const lo = msgFingerprint[1];
|
|
1132
1020
|
return wordsToDecimalString(hi & 0x7fffffff, lo);
|
|
1133
1021
|
}
|
|
1134
|
-
function hash32(
|
|
1022
|
+
function hash32(view, length, c) {
|
|
1135
1023
|
let a = 0x9e3779b9, b = 0x9e3779b9;
|
|
1136
|
-
let
|
|
1137
|
-
const
|
|
1138
|
-
for (
|
|
1139
|
-
a
|
|
1140
|
-
b
|
|
1141
|
-
c
|
|
1024
|
+
let index = 0;
|
|
1025
|
+
const end = length - 12;
|
|
1026
|
+
for (; index <= end; index += 12) {
|
|
1027
|
+
a += view.getUint32(index, true);
|
|
1028
|
+
b += view.getUint32(index + 4, true);
|
|
1029
|
+
c += view.getUint32(index + 8, true);
|
|
1142
1030
|
const res = mix(a, b, c);
|
|
1143
1031
|
a = res[0], b = res[1], c = res[2];
|
|
1144
1032
|
}
|
|
1145
|
-
|
|
1146
|
-
b = add32(b, wordAt(bytes, i + 4, Endian.Little));
|
|
1033
|
+
const remainder = length - index;
|
|
1147
1034
|
// the first byte of c is reserved for the length
|
|
1148
|
-
c
|
|
1149
|
-
|
|
1035
|
+
c += length;
|
|
1036
|
+
if (remainder >= 4) {
|
|
1037
|
+
a += view.getUint32(index, true);
|
|
1038
|
+
index += 4;
|
|
1039
|
+
if (remainder >= 8) {
|
|
1040
|
+
b += view.getUint32(index, true);
|
|
1041
|
+
index += 4;
|
|
1042
|
+
// Partial 32-bit word for c
|
|
1043
|
+
if (remainder >= 9) {
|
|
1044
|
+
c += view.getUint8(index++) << 8;
|
|
1045
|
+
}
|
|
1046
|
+
if (remainder >= 10) {
|
|
1047
|
+
c += view.getUint8(index++) << 16;
|
|
1048
|
+
}
|
|
1049
|
+
if (remainder === 11) {
|
|
1050
|
+
c += view.getUint8(index++) << 24;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
// Partial 32-bit word for b
|
|
1055
|
+
if (remainder >= 5) {
|
|
1056
|
+
b += view.getUint8(index++);
|
|
1057
|
+
}
|
|
1058
|
+
if (remainder >= 6) {
|
|
1059
|
+
b += view.getUint8(index++) << 8;
|
|
1060
|
+
}
|
|
1061
|
+
if (remainder === 7) {
|
|
1062
|
+
b += view.getUint8(index++) << 16;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
// Partial 32-bit word for a
|
|
1068
|
+
if (remainder >= 1) {
|
|
1069
|
+
a += view.getUint8(index++);
|
|
1070
|
+
}
|
|
1071
|
+
if (remainder >= 2) {
|
|
1072
|
+
a += view.getUint8(index++) << 8;
|
|
1073
|
+
}
|
|
1074
|
+
if (remainder === 3) {
|
|
1075
|
+
a += view.getUint8(index++) << 16;
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1150
1078
|
return mix(a, b, c)[2];
|
|
1151
1079
|
}
|
|
1152
1080
|
// clang-format off
|
|
1153
1081
|
function mix(a, b, c) {
|
|
1154
|
-
a
|
|
1155
|
-
a
|
|
1082
|
+
a -= b;
|
|
1083
|
+
a -= c;
|
|
1156
1084
|
a ^= c >>> 13;
|
|
1157
|
-
b
|
|
1158
|
-
b
|
|
1085
|
+
b -= c;
|
|
1086
|
+
b -= a;
|
|
1159
1087
|
b ^= a << 8;
|
|
1160
|
-
c
|
|
1161
|
-
c
|
|
1088
|
+
c -= a;
|
|
1089
|
+
c -= b;
|
|
1162
1090
|
c ^= b >>> 13;
|
|
1163
|
-
a
|
|
1164
|
-
a
|
|
1091
|
+
a -= b;
|
|
1092
|
+
a -= c;
|
|
1165
1093
|
a ^= c >>> 12;
|
|
1166
|
-
b
|
|
1167
|
-
b
|
|
1094
|
+
b -= c;
|
|
1095
|
+
b -= a;
|
|
1168
1096
|
b ^= a << 16;
|
|
1169
|
-
c
|
|
1170
|
-
c
|
|
1097
|
+
c -= a;
|
|
1098
|
+
c -= b;
|
|
1171
1099
|
c ^= b >>> 5;
|
|
1172
|
-
a
|
|
1173
|
-
a
|
|
1100
|
+
a -= b;
|
|
1101
|
+
a -= c;
|
|
1174
1102
|
a ^= c >>> 3;
|
|
1175
|
-
b
|
|
1176
|
-
b
|
|
1103
|
+
b -= c;
|
|
1104
|
+
b -= a;
|
|
1177
1105
|
b ^= a << 10;
|
|
1178
|
-
c
|
|
1179
|
-
c
|
|
1106
|
+
c -= a;
|
|
1107
|
+
c -= b;
|
|
1180
1108
|
c ^= b >>> 15;
|
|
1181
1109
|
return [a, b, c];
|
|
1182
1110
|
}
|
|
@@ -1204,11 +1132,6 @@ function add64(a, b) {
|
|
|
1204
1132
|
const h = add32(add32(ah, bh), carry);
|
|
1205
1133
|
return [h, l];
|
|
1206
1134
|
}
|
|
1207
|
-
function sub32(a, b) {
|
|
1208
|
-
const low = (a & 0xffff) - (b & 0xffff);
|
|
1209
|
-
const high = (a >> 16) - (b >> 16) + (low >> 16);
|
|
1210
|
-
return (high << 16) | (low & 0xffff);
|
|
1211
|
-
}
|
|
1212
1135
|
// Rotate a 32b number left `count` position
|
|
1213
1136
|
function rol32(a, count) {
|
|
1214
1137
|
return (a << count) | (a >>> (32 - count));
|
|
@@ -1245,24 +1168,6 @@ function wordAt(bytes, index, endian) {
|
|
|
1245
1168
|
}
|
|
1246
1169
|
return word;
|
|
1247
1170
|
}
|
|
1248
|
-
function words32ToByteString(words32) {
|
|
1249
|
-
return words32.reduce((bytes, word) => bytes.concat(word32ToByteString(word)), []);
|
|
1250
|
-
}
|
|
1251
|
-
function word32ToByteString(word) {
|
|
1252
|
-
let bytes = [];
|
|
1253
|
-
for (let i = 0; i < 4; i++) {
|
|
1254
|
-
bytes.push((word >>> 8 * (3 - i)) & 0xff);
|
|
1255
|
-
}
|
|
1256
|
-
return bytes;
|
|
1257
|
-
}
|
|
1258
|
-
function bytesToHexString(bytes) {
|
|
1259
|
-
let hex = '';
|
|
1260
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
1261
|
-
const b = byteAt(bytes, i);
|
|
1262
|
-
hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);
|
|
1263
|
-
}
|
|
1264
|
-
return hex.toLowerCase();
|
|
1265
|
-
}
|
|
1266
1171
|
/**
|
|
1267
1172
|
* Create a shared exponentiation pool for base-256 computations. This shared pool provides memoized
|
|
1268
1173
|
* power-of-256 results with memoized power-of-two computations for efficient multiplication.
|
|
@@ -2939,6 +2844,135 @@ Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: COR
|
|
|
2939
2844
|
Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
|
|
2940
2845
|
Identifiers.validateIframeAttribute = { name: 'ɵɵvalidateIframeAttribute', moduleName: CORE };
|
|
2941
2846
|
|
|
2847
|
+
/**
|
|
2848
|
+
* @license
|
|
2849
|
+
* Copyright Google LLC All Rights Reserved.
|
|
2850
|
+
*
|
|
2851
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
2852
|
+
* found in the LICENSE file at https://angular.io/license
|
|
2853
|
+
*/
|
|
2854
|
+
const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
|
|
2855
|
+
function dashCaseToCamelCase(input) {
|
|
2856
|
+
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
|
2857
|
+
}
|
|
2858
|
+
function splitAtColon(input, defaultValues) {
|
|
2859
|
+
return _splitAt(input, ':', defaultValues);
|
|
2860
|
+
}
|
|
2861
|
+
function splitAtPeriod(input, defaultValues) {
|
|
2862
|
+
return _splitAt(input, '.', defaultValues);
|
|
2863
|
+
}
|
|
2864
|
+
function _splitAt(input, character, defaultValues) {
|
|
2865
|
+
const characterIndex = input.indexOf(character);
|
|
2866
|
+
if (characterIndex == -1)
|
|
2867
|
+
return defaultValues;
|
|
2868
|
+
return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
|
|
2869
|
+
}
|
|
2870
|
+
function noUndefined(val) {
|
|
2871
|
+
return val === undefined ? null : val;
|
|
2872
|
+
}
|
|
2873
|
+
function error(msg) {
|
|
2874
|
+
throw new Error(`Internal Error: ${msg}`);
|
|
2875
|
+
}
|
|
2876
|
+
// Escape characters that have a special meaning in Regular Expressions
|
|
2877
|
+
function escapeRegExp(s) {
|
|
2878
|
+
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
|
2879
|
+
}
|
|
2880
|
+
function utf8Encode(str) {
|
|
2881
|
+
let encoded = [];
|
|
2882
|
+
for (let index = 0; index < str.length; index++) {
|
|
2883
|
+
let codePoint = str.charCodeAt(index);
|
|
2884
|
+
// decode surrogate
|
|
2885
|
+
// see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
2886
|
+
if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {
|
|
2887
|
+
const low = str.charCodeAt(index + 1);
|
|
2888
|
+
if (low >= 0xdc00 && low <= 0xdfff) {
|
|
2889
|
+
index++;
|
|
2890
|
+
codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
if (codePoint <= 0x7f) {
|
|
2894
|
+
encoded.push(codePoint);
|
|
2895
|
+
}
|
|
2896
|
+
else if (codePoint <= 0x7ff) {
|
|
2897
|
+
encoded.push(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);
|
|
2898
|
+
}
|
|
2899
|
+
else if (codePoint <= 0xffff) {
|
|
2900
|
+
encoded.push((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
2901
|
+
}
|
|
2902
|
+
else if (codePoint <= 0x1fffff) {
|
|
2903
|
+
encoded.push(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
return encoded;
|
|
2907
|
+
}
|
|
2908
|
+
function stringify(token) {
|
|
2909
|
+
if (typeof token === 'string') {
|
|
2910
|
+
return token;
|
|
2911
|
+
}
|
|
2912
|
+
if (Array.isArray(token)) {
|
|
2913
|
+
return '[' + token.map(stringify).join(', ') + ']';
|
|
2914
|
+
}
|
|
2915
|
+
if (token == null) {
|
|
2916
|
+
return '' + token;
|
|
2917
|
+
}
|
|
2918
|
+
if (token.overriddenName) {
|
|
2919
|
+
return `${token.overriddenName}`;
|
|
2920
|
+
}
|
|
2921
|
+
if (token.name) {
|
|
2922
|
+
return `${token.name}`;
|
|
2923
|
+
}
|
|
2924
|
+
if (!token.toString) {
|
|
2925
|
+
return 'object';
|
|
2926
|
+
}
|
|
2927
|
+
// WARNING: do not try to `JSON.stringify(token)` here
|
|
2928
|
+
// see https://github.com/angular/angular/issues/23440
|
|
2929
|
+
const res = token.toString();
|
|
2930
|
+
if (res == null) {
|
|
2931
|
+
return '' + res;
|
|
2932
|
+
}
|
|
2933
|
+
const newLineIndex = res.indexOf('\n');
|
|
2934
|
+
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
|
|
2935
|
+
}
|
|
2936
|
+
class Version {
|
|
2937
|
+
constructor(full) {
|
|
2938
|
+
this.full = full;
|
|
2939
|
+
const splits = full.split('.');
|
|
2940
|
+
this.major = splits[0];
|
|
2941
|
+
this.minor = splits[1];
|
|
2942
|
+
this.patch = splits.slice(2).join('.');
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
// Check `global` first, because in Node tests both `global` and `window` may be defined and our
|
|
2946
|
+
// `_global` variable should point to the NodeJS `global` in that case. Note: Typeof/Instanceof
|
|
2947
|
+
// checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
|
|
2948
|
+
// https://github.com/terser/terser/issues/250.
|
|
2949
|
+
const _global = ( /* @__PURE__ */(() => (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
|
|
2950
|
+
(typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
|
|
2951
|
+
self instanceof WorkerGlobalScope && self))());
|
|
2952
|
+
function newArray(size, value) {
|
|
2953
|
+
const list = [];
|
|
2954
|
+
for (let i = 0; i < size; i++) {
|
|
2955
|
+
list.push(value);
|
|
2956
|
+
}
|
|
2957
|
+
return list;
|
|
2958
|
+
}
|
|
2959
|
+
/**
|
|
2960
|
+
* Partitions a given array into 2 arrays, based on a boolean value returned by the condition
|
|
2961
|
+
* function.
|
|
2962
|
+
*
|
|
2963
|
+
* @param arr Input array that should be partitioned
|
|
2964
|
+
* @param conditionFn Condition function that is called for each item in a given array and returns a
|
|
2965
|
+
* boolean value.
|
|
2966
|
+
*/
|
|
2967
|
+
function partitionArray(arr, conditionFn) {
|
|
2968
|
+
const truthy = [];
|
|
2969
|
+
const falsy = [];
|
|
2970
|
+
for (const item of arr) {
|
|
2971
|
+
(conditionFn(item) ? truthy : falsy).push(item);
|
|
2972
|
+
}
|
|
2973
|
+
return [truthy, falsy];
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2942
2976
|
/**
|
|
2943
2977
|
* @license
|
|
2944
2978
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -3107,13 +3141,13 @@ class _EmittedLine {
|
|
|
3107
3141
|
}
|
|
3108
3142
|
}
|
|
3109
3143
|
class EmitterVisitorContext {
|
|
3144
|
+
static createRoot() {
|
|
3145
|
+
return new EmitterVisitorContext(0);
|
|
3146
|
+
}
|
|
3110
3147
|
constructor(_indent) {
|
|
3111
3148
|
this._indent = _indent;
|
|
3112
3149
|
this._lines = [new _EmittedLine(_indent)];
|
|
3113
3150
|
}
|
|
3114
|
-
static createRoot() {
|
|
3115
|
-
return new EmitterVisitorContext(0);
|
|
3116
|
-
}
|
|
3117
3151
|
/**
|
|
3118
3152
|
* @internal strip this from published d.ts files due to
|
|
3119
3153
|
* https://github.com/microsoft/TypeScript/issues/36216
|
|
@@ -5305,10 +5339,6 @@ function assertInterpolationSymbols(identifier, value) {
|
|
|
5305
5339
|
* found in the LICENSE file at https://angular.io/license
|
|
5306
5340
|
*/
|
|
5307
5341
|
class InterpolationConfig {
|
|
5308
|
-
constructor(start, end) {
|
|
5309
|
-
this.start = start;
|
|
5310
|
-
this.end = end;
|
|
5311
|
-
}
|
|
5312
5342
|
static fromArray(markers) {
|
|
5313
5343
|
if (!markers) {
|
|
5314
5344
|
return DEFAULT_INTERPOLATION_CONFIG;
|
|
@@ -5316,6 +5346,10 @@ class InterpolationConfig {
|
|
|
5316
5346
|
assertInterpolationSymbols('interpolation', markers);
|
|
5317
5347
|
return new InterpolationConfig(markers[0], markers[1]);
|
|
5318
5348
|
}
|
|
5349
|
+
constructor(start, end) {
|
|
5350
|
+
this.start = start;
|
|
5351
|
+
this.end = end;
|
|
5352
|
+
}
|
|
5319
5353
|
}
|
|
5320
5354
|
const DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');
|
|
5321
5355
|
|
|
@@ -6414,6 +6448,18 @@ class Binary extends AST {
|
|
|
6414
6448
|
* after consumers have been given a chance to fully support Unary.
|
|
6415
6449
|
*/
|
|
6416
6450
|
class Unary extends Binary {
|
|
6451
|
+
/**
|
|
6452
|
+
* Creates a unary minus expression "-x", represented as `Binary` using "0 - x".
|
|
6453
|
+
*/
|
|
6454
|
+
static createMinus(span, sourceSpan, expr) {
|
|
6455
|
+
return new Unary(span, sourceSpan, '-', expr, '-', new LiteralPrimitive(span, sourceSpan, 0), expr);
|
|
6456
|
+
}
|
|
6457
|
+
/**
|
|
6458
|
+
* Creates a unary plus expression "+x", represented as `Binary` using "x - 0".
|
|
6459
|
+
*/
|
|
6460
|
+
static createPlus(span, sourceSpan, expr) {
|
|
6461
|
+
return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));
|
|
6462
|
+
}
|
|
6417
6463
|
/**
|
|
6418
6464
|
* During the deprecation period this constructor is private, to avoid consumers from creating
|
|
6419
6465
|
* a `Unary` with the fallback properties for `Binary`.
|
|
@@ -6428,18 +6474,6 @@ class Unary extends Binary {
|
|
|
6428
6474
|
this.right = null;
|
|
6429
6475
|
this.operation = null;
|
|
6430
6476
|
}
|
|
6431
|
-
/**
|
|
6432
|
-
* Creates a unary minus expression "-x", represented as `Binary` using "0 - x".
|
|
6433
|
-
*/
|
|
6434
|
-
static createMinus(span, sourceSpan, expr) {
|
|
6435
|
-
return new Unary(span, sourceSpan, '-', expr, '-', new LiteralPrimitive(span, sourceSpan, 0), expr);
|
|
6436
|
-
}
|
|
6437
|
-
/**
|
|
6438
|
-
* Creates a unary plus expression "+x", represented as `Binary` using "x - 0".
|
|
6439
|
-
*/
|
|
6440
|
-
static createPlus(span, sourceSpan, expr) {
|
|
6441
|
-
return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));
|
|
6442
|
-
}
|
|
6443
6477
|
visit(visitor, context = null) {
|
|
6444
6478
|
if (visitor.visitUnary !== undefined) {
|
|
6445
6479
|
return visitor.visitUnary(this, context);
|
|
@@ -8301,7 +8335,8 @@ class ShadowCss {
|
|
|
8301
8335
|
this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
|
|
8302
8336
|
}
|
|
8303
8337
|
else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
|
|
8304
|
-
rule.selector.startsWith('@document') || rule.selector.startsWith('@layer')
|
|
8338
|
+
rule.selector.startsWith('@document') || rule.selector.startsWith('@layer') ||
|
|
8339
|
+
rule.selector.startsWith('@container')) {
|
|
8305
8340
|
content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
|
|
8306
8341
|
}
|
|
8307
8342
|
else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
|
|
@@ -14341,13 +14376,13 @@ class CursorError {
|
|
|
14341
14376
|
* found in the LICENSE file at https://angular.io/license
|
|
14342
14377
|
*/
|
|
14343
14378
|
class TreeError extends ParseError {
|
|
14379
|
+
static create(elementName, span, msg) {
|
|
14380
|
+
return new TreeError(elementName, span, msg);
|
|
14381
|
+
}
|
|
14344
14382
|
constructor(elementName, span, msg) {
|
|
14345
14383
|
super(span, msg);
|
|
14346
14384
|
this.elementName = elementName;
|
|
14347
14385
|
}
|
|
14348
|
-
static create(elementName, span, msg) {
|
|
14349
|
-
return new TreeError(elementName, span, msg);
|
|
14350
|
-
}
|
|
14351
14386
|
}
|
|
14352
14387
|
class ParseTreeResult {
|
|
14353
14388
|
constructor(rootNodes, errors) {
|
|
@@ -16483,7 +16518,6 @@ function findTemplateFn(ctx, templateIndex) {
|
|
|
16483
16518
|
function serializePlaceholderValue(value) {
|
|
16484
16519
|
const element = (data, closed) => wrapTag('#', data, closed);
|
|
16485
16520
|
const template = (data, closed) => wrapTag('*', data, closed);
|
|
16486
|
-
const projection = (data, closed) => wrapTag('!', data, closed);
|
|
16487
16521
|
switch (value.type) {
|
|
16488
16522
|
case TagType.ELEMENT:
|
|
16489
16523
|
// close element tag
|
|
@@ -18413,7 +18447,7 @@ class TemplateDefinitionBuilder {
|
|
|
18413
18447
|
if (!references || references.length === 0) {
|
|
18414
18448
|
return TYPED_NULL_EXPR;
|
|
18415
18449
|
}
|
|
18416
|
-
const refsParam =
|
|
18450
|
+
const refsParam = references.flatMap(reference => {
|
|
18417
18451
|
const slot = this.allocateDataSlot();
|
|
18418
18452
|
// Generate the update temporary.
|
|
18419
18453
|
const variableName = this._bindingScope.freshReferenceName();
|
|
@@ -18427,7 +18461,7 @@ class TemplateDefinitionBuilder {
|
|
|
18427
18461
|
return nextContextStmt.concat(refExpr.toConstDecl());
|
|
18428
18462
|
}, true);
|
|
18429
18463
|
return [reference.name, reference.value];
|
|
18430
|
-
})
|
|
18464
|
+
});
|
|
18431
18465
|
return asLiteral(refsParam);
|
|
18432
18466
|
}
|
|
18433
18467
|
prepareListenerParameter(tagName, outputAst, index) {
|
|
@@ -18561,6 +18595,9 @@ function getAttributeNameLiterals(name) {
|
|
|
18561
18595
|
/** The prefix used to get a shared context in BindingScope's map. */
|
|
18562
18596
|
const SHARED_CONTEXT_KEY = '$$shared_ctx$$';
|
|
18563
18597
|
class BindingScope {
|
|
18598
|
+
static createRootScope() {
|
|
18599
|
+
return new BindingScope();
|
|
18600
|
+
}
|
|
18564
18601
|
constructor(bindingLevel = 0, parent = null, globals) {
|
|
18565
18602
|
this.bindingLevel = bindingLevel;
|
|
18566
18603
|
this.parent = parent;
|
|
@@ -18576,9 +18613,6 @@ class BindingScope {
|
|
|
18576
18613
|
}
|
|
18577
18614
|
}
|
|
18578
18615
|
}
|
|
18579
|
-
static createRootScope() {
|
|
18580
|
-
return new BindingScope();
|
|
18581
|
-
}
|
|
18582
18616
|
get(name) {
|
|
18583
18617
|
let current = this;
|
|
18584
18618
|
while (current) {
|
|
@@ -19078,12 +19112,6 @@ function createClosureModeGuard() {
|
|
|
19078
19112
|
.notIdentical(literal('undefined', STRING_TYPE))
|
|
19079
19113
|
.and(variable(NG_I18N_CLOSURE_MODE));
|
|
19080
19114
|
}
|
|
19081
|
-
function flatten(list) {
|
|
19082
|
-
return list.reduce((flat, item) => {
|
|
19083
|
-
const flatItem = Array.isArray(item) ? flatten(item) : item;
|
|
19084
|
-
return flat.concat(flatItem);
|
|
19085
|
-
}, []);
|
|
19086
|
-
}
|
|
19087
19115
|
|
|
19088
19116
|
/**
|
|
19089
19117
|
* @license
|
|
@@ -20334,7 +20362,7 @@ function publishFacade(global) {
|
|
|
20334
20362
|
* Use of this source code is governed by an MIT-style license that can be
|
|
20335
20363
|
* found in the LICENSE file at https://angular.io/license
|
|
20336
20364
|
*/
|
|
20337
|
-
const VERSION = new Version('15.1.0-next.
|
|
20365
|
+
const VERSION = new Version('15.1.0-next.3');
|
|
20338
20366
|
|
|
20339
20367
|
/**
|
|
20340
20368
|
* @license
|
|
@@ -22366,7 +22394,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
22366
22394
|
function compileDeclareClassMetadata(metadata) {
|
|
22367
22395
|
const definitionMap = new DefinitionMap();
|
|
22368
22396
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
22369
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22397
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22370
22398
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22371
22399
|
definitionMap.set('type', metadata.type);
|
|
22372
22400
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -22483,7 +22511,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
|
|
|
22483
22511
|
function createDirectiveDefinitionMap(meta) {
|
|
22484
22512
|
const definitionMap = new DefinitionMap();
|
|
22485
22513
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
22486
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22514
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22487
22515
|
// e.g. `type: MyDirective`
|
|
22488
22516
|
definitionMap.set('type', meta.internalType);
|
|
22489
22517
|
if (meta.isStandalone) {
|
|
@@ -22722,7 +22750,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22722
22750
|
function compileDeclareFactoryFunction(meta) {
|
|
22723
22751
|
const definitionMap = new DefinitionMap();
|
|
22724
22752
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22725
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22753
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22726
22754
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22727
22755
|
definitionMap.set('type', meta.internalType);
|
|
22728
22756
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -22764,7 +22792,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22764
22792
|
function createInjectableDefinitionMap(meta) {
|
|
22765
22793
|
const definitionMap = new DefinitionMap();
|
|
22766
22794
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22767
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22795
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22768
22796
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22769
22797
|
definitionMap.set('type', meta.internalType);
|
|
22770
22798
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -22822,7 +22850,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22822
22850
|
function createInjectorDefinitionMap(meta) {
|
|
22823
22851
|
const definitionMap = new DefinitionMap();
|
|
22824
22852
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22825
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22853
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22826
22854
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22827
22855
|
definitionMap.set('type', meta.internalType);
|
|
22828
22856
|
definitionMap.set('providers', meta.providers);
|
|
@@ -22859,7 +22887,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22859
22887
|
function createNgModuleDefinitionMap(meta) {
|
|
22860
22888
|
const definitionMap = new DefinitionMap();
|
|
22861
22889
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22862
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22890
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22863
22891
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22864
22892
|
definitionMap.set('type', meta.internalType);
|
|
22865
22893
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -22917,7 +22945,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22917
22945
|
function createPipeDefinitionMap(meta) {
|
|
22918
22946
|
const definitionMap = new DefinitionMap();
|
|
22919
22947
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22920
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22948
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22921
22949
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22922
22950
|
// e.g. `type: MyPipe`
|
|
22923
22951
|
definitionMap.set('type', meta.internalType);
|