@angular/compiler 14.0.0-next.15 → 14.0.0-next.16
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/core.mjs +6 -6
- package/esm2020/src/expression_parser/parser.mjs +12 -12
- package/esm2020/src/i18n/i18n_parser.mjs +3 -3
- package/esm2020/src/jit_compiler_facade.mjs +6 -6
- package/esm2020/src/ml_parser/html_whitespaces.mjs +2 -2
- package/esm2020/src/ml_parser/lexer.mjs +36 -36
- package/esm2020/src/ml_parser/parser.mjs +41 -41
- package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/component.mjs +2 -2
- package/esm2020/src/render3/partial/directive.mjs +3 -3
- 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 +3 -3
- package/esm2020/src/render3/partial/pipe.mjs +3 -3
- package/esm2020/src/render3/r3_ast.mjs +3 -3
- package/esm2020/src/render3/r3_factory.mjs +6 -6
- package/esm2020/src/render3/util.mjs +4 -4
- package/esm2020/src/render3/view/compiler.mjs +28 -21
- package/esm2020/src/render3/view/i18n/meta.mjs +4 -4
- package/esm2020/src/render3/view/style_parser.mjs +19 -19
- package/esm2020/src/render3/view/styling_builder.mjs +6 -6
- package/esm2020/src/render3/view/template.mjs +22 -22
- package/esm2020/src/render3/view/util.mjs +4 -4
- package/esm2020/src/selector.mjs +8 -8
- package/esm2020/src/shadow_css.mjs +12 -291
- package/esm2020/src/template_parser/binding_parser.mjs +8 -8
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +224 -493
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +224 -496
- 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 v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.16
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -211,7 +211,7 @@ class CssSelector {
|
|
|
211
211
|
let inNot = false;
|
|
212
212
|
_SELECTOR_REGEXP.lastIndex = 0;
|
|
213
213
|
while (match = _SELECTOR_REGEXP.exec(selector)) {
|
|
214
|
-
if (match[1 /* NOT */]) {
|
|
214
|
+
if (match[1 /* SelectorRegexp.NOT */]) {
|
|
215
215
|
if (inNot) {
|
|
216
216
|
throw new Error('Nesting :not in a selector is not allowed');
|
|
217
217
|
}
|
|
@@ -219,9 +219,9 @@ class CssSelector {
|
|
|
219
219
|
current = new CssSelector();
|
|
220
220
|
cssSelector.notSelectors.push(current);
|
|
221
221
|
}
|
|
222
|
-
const tag = match[2 /* TAG */];
|
|
222
|
+
const tag = match[2 /* SelectorRegexp.TAG */];
|
|
223
223
|
if (tag) {
|
|
224
|
-
const prefix = match[3 /* PREFIX */];
|
|
224
|
+
const prefix = match[3 /* SelectorRegexp.PREFIX */];
|
|
225
225
|
if (prefix === '#') {
|
|
226
226
|
// #hash
|
|
227
227
|
current.addAttribute('id', tag.slice(1));
|
|
@@ -235,15 +235,15 @@ class CssSelector {
|
|
|
235
235
|
current.setElement(tag);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const attribute = match[4 /* ATTRIBUTE */];
|
|
238
|
+
const attribute = match[4 /* SelectorRegexp.ATTRIBUTE */];
|
|
239
239
|
if (attribute) {
|
|
240
|
-
current.addAttribute(current.unescapeAttribute(attribute), match[6 /* ATTRIBUTE_VALUE */]);
|
|
240
|
+
current.addAttribute(current.unescapeAttribute(attribute), match[6 /* SelectorRegexp.ATTRIBUTE_VALUE */]);
|
|
241
241
|
}
|
|
242
|
-
if (match[7 /* NOT_END */]) {
|
|
242
|
+
if (match[7 /* SelectorRegexp.NOT_END */]) {
|
|
243
243
|
inNot = false;
|
|
244
244
|
current = cssSelector;
|
|
245
245
|
}
|
|
246
|
-
if (match[8 /* SEPARATOR */]) {
|
|
246
|
+
if (match[8 /* SelectorRegexp.SEPARATOR */]) {
|
|
247
247
|
if (inNot) {
|
|
248
248
|
throw new Error('Multiple selectors in :not are not supported');
|
|
249
249
|
}
|
|
@@ -611,26 +611,26 @@ var MissingTranslationStrategy;
|
|
|
611
611
|
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
|
|
612
612
|
function parserSelectorToSimpleSelector(selector) {
|
|
613
613
|
const classes = selector.classNames && selector.classNames.length ?
|
|
614
|
-
[8 /* CLASS */, ...selector.classNames] :
|
|
614
|
+
[8 /* SelectorFlags.CLASS */, ...selector.classNames] :
|
|
615
615
|
[];
|
|
616
616
|
const elementName = selector.element && selector.element !== '*' ? selector.element : '';
|
|
617
617
|
return [elementName, ...selector.attrs, ...classes];
|
|
618
618
|
}
|
|
619
619
|
function parserSelectorToNegativeSelector(selector) {
|
|
620
620
|
const classes = selector.classNames && selector.classNames.length ?
|
|
621
|
-
[8 /* CLASS */, ...selector.classNames] :
|
|
621
|
+
[8 /* SelectorFlags.CLASS */, ...selector.classNames] :
|
|
622
622
|
[];
|
|
623
623
|
if (selector.element) {
|
|
624
624
|
return [
|
|
625
|
-
1 /* NOT */ | 4 /* ELEMENT */, selector.element, ...selector.attrs, ...classes
|
|
625
|
+
1 /* SelectorFlags.NOT */ | 4 /* SelectorFlags.ELEMENT */, selector.element, ...selector.attrs, ...classes
|
|
626
626
|
];
|
|
627
627
|
}
|
|
628
628
|
else if (selector.attrs.length) {
|
|
629
|
-
return [1 /* NOT */ | 2 /* ATTRIBUTE */, ...selector.attrs, ...classes];
|
|
629
|
+
return [1 /* SelectorFlags.NOT */ | 2 /* SelectorFlags.ATTRIBUTE */, ...selector.attrs, ...classes];
|
|
630
630
|
}
|
|
631
631
|
else {
|
|
632
632
|
return selector.classNames && selector.classNames.length ?
|
|
633
|
-
[1 /* NOT */ | 8 /* CLASS */, ...selector.classNames] :
|
|
633
|
+
[1 /* SelectorFlags.NOT */ | 8 /* SelectorFlags.CLASS */, ...selector.classNames] :
|
|
634
634
|
[];
|
|
635
635
|
}
|
|
636
636
|
}
|
|
@@ -3662,10 +3662,10 @@ function createMayBeForwardRefExpression(expression, forwardRef) {
|
|
|
3662
3662
|
*/
|
|
3663
3663
|
function convertFromMaybeForwardRefExpression({ expression, forwardRef }) {
|
|
3664
3664
|
switch (forwardRef) {
|
|
3665
|
-
case 0 /* None */:
|
|
3666
|
-
case 1 /* Wrapped */:
|
|
3665
|
+
case 0 /* ForwardRefHandling.None */:
|
|
3666
|
+
case 1 /* ForwardRefHandling.Wrapped */:
|
|
3667
3667
|
return expression;
|
|
3668
|
-
case 2 /* Unwrapped */:
|
|
3668
|
+
case 2 /* ForwardRefHandling.Unwrapped */:
|
|
3669
3669
|
return generateForwardRef(expression);
|
|
3670
3670
|
}
|
|
3671
3671
|
}
|
|
@@ -3789,14 +3789,14 @@ function compileInjectDependency(dep, target, index) {
|
|
|
3789
3789
|
}
|
|
3790
3790
|
else if (dep.attributeNameType === null) {
|
|
3791
3791
|
// Build up the injection flags according to the metadata.
|
|
3792
|
-
const flags = 0 /* Default */ | (dep.self ? 2 /* Self */ : 0) |
|
|
3793
|
-
(dep.skipSelf ? 4 /* SkipSelf */ : 0) | (dep.host ? 1 /* Host */ : 0) |
|
|
3794
|
-
(dep.optional ? 8 /* Optional */ : 0) |
|
|
3795
|
-
(target === FactoryTarget$1.Pipe ? 16 /* ForPipe */ : 0);
|
|
3792
|
+
const flags = 0 /* InjectFlags.Default */ | (dep.self ? 2 /* InjectFlags.Self */ : 0) |
|
|
3793
|
+
(dep.skipSelf ? 4 /* InjectFlags.SkipSelf */ : 0) | (dep.host ? 1 /* InjectFlags.Host */ : 0) |
|
|
3794
|
+
(dep.optional ? 8 /* InjectFlags.Optional */ : 0) |
|
|
3795
|
+
(target === FactoryTarget$1.Pipe ? 16 /* InjectFlags.ForPipe */ : 0);
|
|
3796
3796
|
// If this dependency is optional or otherwise has non-default flags, then additional
|
|
3797
3797
|
// parameters describing how to inject the dependency must be passed to the inject function
|
|
3798
3798
|
// that's being used.
|
|
3799
|
-
let flagsParam = (flags !== 0 /* Default */ || dep.optional) ? literal(flags) : null;
|
|
3799
|
+
let flagsParam = (flags !== 0 /* InjectFlags.Default */ || dep.optional) ? literal(flags) : null;
|
|
3800
3800
|
// Build up the arguments to the injectFn call.
|
|
3801
3801
|
const injectArgs = [dep.token];
|
|
3802
3802
|
if (flagsParam) {
|
|
@@ -3967,8 +3967,8 @@ class BoundEvent {
|
|
|
3967
3967
|
this.keySpan = keySpan;
|
|
3968
3968
|
}
|
|
3969
3969
|
static fromParsedEvent(event) {
|
|
3970
|
-
const target = event.type === 0 /* Regular */ ? event.targetOrPhase : null;
|
|
3971
|
-
const phase = event.type === 1 /* Animation */ ? event.targetOrPhase : null;
|
|
3970
|
+
const target = event.type === 0 /* ParsedEventType.Regular */ ? event.targetOrPhase : null;
|
|
3971
|
+
const phase = event.type === 1 /* ParsedEventType.Animation */ ? event.targetOrPhase : null;
|
|
3972
3972
|
if (event.keySpan === undefined) {
|
|
3973
3973
|
throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`);
|
|
3974
3974
|
}
|
|
@@ -5026,10 +5026,10 @@ function getQueryPredicate(query, constantPool) {
|
|
|
5026
5026
|
else {
|
|
5027
5027
|
// The original predicate may have been wrapped in a `forwardRef()` call.
|
|
5028
5028
|
switch (query.predicate.forwardRef) {
|
|
5029
|
-
case 0 /* None */:
|
|
5030
|
-
case 2 /* Unwrapped */:
|
|
5029
|
+
case 0 /* ForwardRefHandling.None */:
|
|
5030
|
+
case 2 /* ForwardRefHandling.Unwrapped */:
|
|
5031
5031
|
return query.predicate.expression;
|
|
5032
|
-
case 1 /* Wrapped */:
|
|
5032
|
+
case 1 /* ForwardRefHandling.Wrapped */:
|
|
5033
5033
|
return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
|
|
5034
5034
|
}
|
|
5035
5035
|
}
|
|
@@ -7687,26 +7687,7 @@ class BuiltinFunctionCall extends Call {
|
|
|
7687
7687
|
* found in the LICENSE file at https://angular.io/license
|
|
7688
7688
|
*/
|
|
7689
7689
|
/**
|
|
7690
|
-
*
|
|
7691
|
-
* property and is used during the scoping of keyframes to make sure such keywords
|
|
7692
|
-
* are not modified.
|
|
7693
|
-
*/
|
|
7694
|
-
const animationKeywords = new Set([
|
|
7695
|
-
// global values
|
|
7696
|
-
'inherit', 'initial', 'revert', 'unset',
|
|
7697
|
-
// animation-direction
|
|
7698
|
-
'alternate', 'alternate-reverse', 'normal', 'reverse',
|
|
7699
|
-
// animation-fill-mode
|
|
7700
|
-
'backwards', 'both', 'forwards', 'none',
|
|
7701
|
-
// animation-play-state
|
|
7702
|
-
'paused', 'running',
|
|
7703
|
-
// animation-timing-function
|
|
7704
|
-
'ease', 'ease-in', 'ease-in-out', 'ease-out', 'linear', 'step-start', 'step-end',
|
|
7705
|
-
// `steps()` function
|
|
7706
|
-
'end', 'jump-both', 'jump-end', 'jump-none', 'jump-start', 'start'
|
|
7707
|
-
]);
|
|
7708
|
-
/**
|
|
7709
|
-
* The following class is a port of shadowCSS from webcomponents.js to TypeScript.
|
|
7690
|
+
* This file is a port of shadowCSS from webcomponents.js to TypeScript.
|
|
7710
7691
|
*
|
|
7711
7692
|
* Please make sure to keep to edits in sync with the source file.
|
|
7712
7693
|
*
|
|
@@ -7832,21 +7813,6 @@ const animationKeywords = new Set([
|
|
|
7832
7813
|
class ShadowCss {
|
|
7833
7814
|
constructor() {
|
|
7834
7815
|
this.strictStyling = true;
|
|
7835
|
-
/**
|
|
7836
|
-
* Regular expression used to extrapolate the possible keyframes from an
|
|
7837
|
-
* animation declaration (with possibly multiple animation definitions)
|
|
7838
|
-
*
|
|
7839
|
-
* The regular expression can be divided in three parts
|
|
7840
|
-
* - (^|\s+)
|
|
7841
|
-
* simply captures how many (if any) leading whitespaces are present
|
|
7842
|
-
* - (?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))
|
|
7843
|
-
* captures two different possible keyframes, ones which are quoted or ones which are valid css
|
|
7844
|
-
* idents (custom properties excluded)
|
|
7845
|
-
* - (?=[,\s;]|$)
|
|
7846
|
-
* simply matches the end of the possible keyframe, valid endings are: a comma, a space, a
|
|
7847
|
-
* semicolon or the end of the string
|
|
7848
|
-
*/
|
|
7849
|
-
this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
|
|
7850
7816
|
}
|
|
7851
7817
|
/*
|
|
7852
7818
|
* Shim some cssText with the given selector. Returns cssText that can
|
|
@@ -7867,143 +7833,6 @@ class ShadowCss {
|
|
|
7867
7833
|
cssText = this._insertPolyfillDirectivesInCssText(cssText);
|
|
7868
7834
|
return this._insertPolyfillRulesInCssText(cssText);
|
|
7869
7835
|
}
|
|
7870
|
-
/**
|
|
7871
|
-
* Process styles to add scope to keyframes.
|
|
7872
|
-
*
|
|
7873
|
-
* Modify both the names of the keyframes defined in the component styles and also the css
|
|
7874
|
-
* animation rules using them.
|
|
7875
|
-
*
|
|
7876
|
-
* Animation rules using keyframes defined elsewhere are not modified to allow for globally
|
|
7877
|
-
* defined keyframes.
|
|
7878
|
-
*
|
|
7879
|
-
* For example, we convert this css:
|
|
7880
|
-
*
|
|
7881
|
-
* ```
|
|
7882
|
-
* .box {
|
|
7883
|
-
* animation: box-animation 1s forwards;
|
|
7884
|
-
* }
|
|
7885
|
-
*
|
|
7886
|
-
* @keyframes box-animation {
|
|
7887
|
-
* to {
|
|
7888
|
-
* background-color: green;
|
|
7889
|
-
* }
|
|
7890
|
-
* }
|
|
7891
|
-
* ```
|
|
7892
|
-
*
|
|
7893
|
-
* to this:
|
|
7894
|
-
*
|
|
7895
|
-
* ```
|
|
7896
|
-
* .box {
|
|
7897
|
-
* animation: scopeName_box-animation 1s forwards;
|
|
7898
|
-
* }
|
|
7899
|
-
*
|
|
7900
|
-
* @keyframes scopeName_box-animation {
|
|
7901
|
-
* to {
|
|
7902
|
-
* background-color: green;
|
|
7903
|
-
* }
|
|
7904
|
-
* }
|
|
7905
|
-
* ```
|
|
7906
|
-
*
|
|
7907
|
-
* @param cssText the component's css text that needs to be scoped.
|
|
7908
|
-
* @param scopeSelector the component's scope selector.
|
|
7909
|
-
*
|
|
7910
|
-
* @returns the scoped css text.
|
|
7911
|
-
*/
|
|
7912
|
-
_scopeKeyframesRelatedCss(cssText, scopeSelector) {
|
|
7913
|
-
const unscopedKeyframesSet = new Set();
|
|
7914
|
-
const scopedKeyframesCssText = processRules(cssText, rule => this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet));
|
|
7915
|
-
return processRules(scopedKeyframesCssText, rule => this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet));
|
|
7916
|
-
}
|
|
7917
|
-
/**
|
|
7918
|
-
* Scopes local keyframes names, returning the updated css rule and it also
|
|
7919
|
-
* adds the original keyframe name to a provided set to collect all keyframes names
|
|
7920
|
-
* so that it can later be used to scope the animation rules.
|
|
7921
|
-
*
|
|
7922
|
-
* For example, it takes a rule such as:
|
|
7923
|
-
*
|
|
7924
|
-
* ```
|
|
7925
|
-
* @keyframes box-animation {
|
|
7926
|
-
* to {
|
|
7927
|
-
* background-color: green;
|
|
7928
|
-
* }
|
|
7929
|
-
* }
|
|
7930
|
-
* ```
|
|
7931
|
-
*
|
|
7932
|
-
* and returns:
|
|
7933
|
-
*
|
|
7934
|
-
* ```
|
|
7935
|
-
* @keyframes scopeName_box-animation {
|
|
7936
|
-
* to {
|
|
7937
|
-
* background-color: green;
|
|
7938
|
-
* }
|
|
7939
|
-
* }
|
|
7940
|
-
* ```
|
|
7941
|
-
* and as a side effect it adds "box-animation" to the `unscopedKeyframesSet` set
|
|
7942
|
-
*
|
|
7943
|
-
* @param cssRule the css rule to process.
|
|
7944
|
-
* @param scopeSelector the component's scope selector.
|
|
7945
|
-
* @param unscopedKeyframesSet the set of unscoped keyframes names (which can be
|
|
7946
|
-
* modified as a side effect)
|
|
7947
|
-
*
|
|
7948
|
-
* @returns the css rule modified with the scoped keyframes name.
|
|
7949
|
-
*/
|
|
7950
|
-
_scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) {
|
|
7951
|
-
return {
|
|
7952
|
-
...rule,
|
|
7953
|
-
selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
|
|
7954
|
-
unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));
|
|
7955
|
-
return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;
|
|
7956
|
-
}),
|
|
7957
|
-
};
|
|
7958
|
-
}
|
|
7959
|
-
/**
|
|
7960
|
-
* Function used to scope a keyframes name (obtained from an animation declaration)
|
|
7961
|
-
* using an existing set of unscopedKeyframes names to discern if the scoping needs to be
|
|
7962
|
-
* performed (keyframes names of keyframes not defined in the component's css need not to be
|
|
7963
|
-
* scoped).
|
|
7964
|
-
*
|
|
7965
|
-
* @param keyframe the keyframes name to check.
|
|
7966
|
-
* @param scopeSelector the component's scope selector.
|
|
7967
|
-
* @param unscopedKeyframesSet the set of unscoped keyframes names.
|
|
7968
|
-
*
|
|
7969
|
-
* @returns the scoped name of the keyframe, or the original name is the name need not to be
|
|
7970
|
-
* scoped.
|
|
7971
|
-
*/
|
|
7972
|
-
_scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet) {
|
|
7973
|
-
return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => {
|
|
7974
|
-
name = `${unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''}${name}`;
|
|
7975
|
-
return `${spaces1}${quote}${name}${quote}${spaces2}`;
|
|
7976
|
-
});
|
|
7977
|
-
}
|
|
7978
|
-
/**
|
|
7979
|
-
* Scope an animation rule so that the keyframes mentioned in such rule
|
|
7980
|
-
* are scoped if defined in the component's css and left untouched otherwise.
|
|
7981
|
-
*
|
|
7982
|
-
* It can scope values of both the 'animation' and 'animation-name' properties.
|
|
7983
|
-
*
|
|
7984
|
-
* @param rule css rule to scope.
|
|
7985
|
-
* @param scopeSelector the component's scope selector.
|
|
7986
|
-
* @param unscopedKeyframesSet the set of unscoped keyframes names.
|
|
7987
|
-
*
|
|
7988
|
-
* @returns the updated css rule.
|
|
7989
|
-
**/
|
|
7990
|
-
_scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
|
|
7991
|
-
let content = rule.content.replace(/((?:^|\s+)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g, (_, start, animationDeclarations) => start +
|
|
7992
|
-
animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = '', quotedName, nonQuotedName) => {
|
|
7993
|
-
if (quotedName) {
|
|
7994
|
-
return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
|
|
7995
|
-
}
|
|
7996
|
-
else {
|
|
7997
|
-
return animationKeywords.has(nonQuotedName) ?
|
|
7998
|
-
original :
|
|
7999
|
-
`${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName, scopeSelector, unscopedKeyframesSet)}`;
|
|
8000
|
-
}
|
|
8001
|
-
}));
|
|
8002
|
-
content = content.replace(/((?:^|\s+)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(',')
|
|
8003
|
-
.map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet))
|
|
8004
|
-
.join(',')}`);
|
|
8005
|
-
return { ...rule, content };
|
|
8006
|
-
}
|
|
8007
7836
|
/*
|
|
8008
7837
|
* Process styles to convert native ShadowDOM rules that will trip
|
|
8009
7838
|
* up the css parser; we rely on decorating the stylesheet with inert rules.
|
|
@@ -8062,7 +7891,6 @@ class ShadowCss {
|
|
|
8062
7891
|
cssText = this._convertColonHostContext(cssText);
|
|
8063
7892
|
cssText = this._convertShadowDOMSelectors(cssText);
|
|
8064
7893
|
if (scopeSelector) {
|
|
8065
|
-
cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector);
|
|
8066
7894
|
cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
|
|
8067
7895
|
}
|
|
8068
7896
|
cssText = cssText + '\n' + unscopedRules;
|
|
@@ -8434,14 +8262,11 @@ function extractCommentsWithHash(input) {
|
|
|
8434
8262
|
return input.match(_commentWithHashRe) || [];
|
|
8435
8263
|
}
|
|
8436
8264
|
const BLOCK_PLACEHOLDER = '%BLOCK%';
|
|
8265
|
+
const QUOTE_PLACEHOLDER = '%QUOTED%';
|
|
8437
8266
|
const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
|
8267
|
+
const _quotedRe = /%QUOTED%/g;
|
|
8438
8268
|
const CONTENT_PAIRS = new Map([['{', '}']]);
|
|
8439
|
-
const
|
|
8440
|
-
const SEMI_IN_PLACEHOLDER = '%SEMI_IN_PLACEHOLDER%';
|
|
8441
|
-
const COLON_IN_PLACEHOLDER = '%COLON_IN_PLACEHOLDER%';
|
|
8442
|
-
const _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, 'g');
|
|
8443
|
-
const _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, 'g');
|
|
8444
|
-
const _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, 'g');
|
|
8269
|
+
const QUOTE_PAIRS = new Map([[`"`, `"`], [`'`, `'`]]);
|
|
8445
8270
|
class CssRule {
|
|
8446
8271
|
constructor(selector, content) {
|
|
8447
8272
|
this.selector = selector;
|
|
@@ -8449,10 +8274,12 @@ class CssRule {
|
|
|
8449
8274
|
}
|
|
8450
8275
|
}
|
|
8451
8276
|
function processRules(input, ruleCallback) {
|
|
8452
|
-
const
|
|
8453
|
-
const inputWithEscapedBlocks = escapeBlocks(
|
|
8277
|
+
const inputWithEscapedQuotes = escapeBlocks(input, QUOTE_PAIRS, QUOTE_PLACEHOLDER);
|
|
8278
|
+
const inputWithEscapedBlocks = escapeBlocks(inputWithEscapedQuotes.escapedString, CONTENT_PAIRS, BLOCK_PLACEHOLDER);
|
|
8454
8279
|
let nextBlockIndex = 0;
|
|
8455
|
-
|
|
8280
|
+
let nextQuoteIndex = 0;
|
|
8281
|
+
return inputWithEscapedBlocks.escapedString
|
|
8282
|
+
.replace(_ruleRe, (...m) => {
|
|
8456
8283
|
const selector = m[2];
|
|
8457
8284
|
let content = '';
|
|
8458
8285
|
let suffix = m[4];
|
|
@@ -8464,8 +8291,8 @@ function processRules(input, ruleCallback) {
|
|
|
8464
8291
|
}
|
|
8465
8292
|
const rule = ruleCallback(new CssRule(selector, content));
|
|
8466
8293
|
return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
|
|
8467
|
-
})
|
|
8468
|
-
|
|
8294
|
+
})
|
|
8295
|
+
.replace(_quotedRe, () => inputWithEscapedQuotes.blocks[nextQuoteIndex++]);
|
|
8469
8296
|
}
|
|
8470
8297
|
class StringWithEscapedBlocks {
|
|
8471
8298
|
constructor(escapedString, blocks) {
|
|
@@ -8516,112 +8343,6 @@ function escapeBlocks(input, charPairs, placeholder) {
|
|
|
8516
8343
|
}
|
|
8517
8344
|
return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);
|
|
8518
8345
|
}
|
|
8519
|
-
/**
|
|
8520
|
-
* Object containing as keys characters that should be substituted by placeholders
|
|
8521
|
-
* when found in strings during the css text parsing, and as values the respective
|
|
8522
|
-
* placeholders
|
|
8523
|
-
*/
|
|
8524
|
-
const ESCAPE_IN_STRING_MAP = {
|
|
8525
|
-
';': SEMI_IN_PLACEHOLDER,
|
|
8526
|
-
',': COMMA_IN_PLACEHOLDER,
|
|
8527
|
-
':': COLON_IN_PLACEHOLDER
|
|
8528
|
-
};
|
|
8529
|
-
/**
|
|
8530
|
-
* Parse the provided css text and inside strings (meaning, inside pairs of unescaped single or
|
|
8531
|
-
* double quotes) replace specific characters with their respective placeholders as indicated
|
|
8532
|
-
* by the `ESCAPE_IN_STRING_MAP` map.
|
|
8533
|
-
*
|
|
8534
|
-
* For example convert the text
|
|
8535
|
-
* `animation: "my-anim:at\"ion" 1s;`
|
|
8536
|
-
* to
|
|
8537
|
-
* `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
|
|
8538
|
-
*
|
|
8539
|
-
* This is necessary in order to remove the meaning of some characters when found inside strings
|
|
8540
|
-
* (for example `;` indicates the end of a css declaration, `,` the sequence of values and `:` the
|
|
8541
|
-
* division between property and value during a declaration, none of these meanings apply when such
|
|
8542
|
-
* characters are within strings and so in order to prevent parsing issues they need to be replaced
|
|
8543
|
-
* with placeholder text for the duration of the css manipulation process).
|
|
8544
|
-
*
|
|
8545
|
-
* @param input the original css text.
|
|
8546
|
-
*
|
|
8547
|
-
* @returns the css text with specific characters in strings replaced by placeholders.
|
|
8548
|
-
**/
|
|
8549
|
-
function escapeInStrings(input) {
|
|
8550
|
-
let result = input;
|
|
8551
|
-
let currentQuoteChar = null;
|
|
8552
|
-
for (let i = 0; i < result.length; i++) {
|
|
8553
|
-
const char = result[i];
|
|
8554
|
-
if (char === '\\') {
|
|
8555
|
-
i++;
|
|
8556
|
-
}
|
|
8557
|
-
else {
|
|
8558
|
-
if (currentQuoteChar !== null) {
|
|
8559
|
-
// index i is inside a quoted sub-string
|
|
8560
|
-
if (char === currentQuoteChar) {
|
|
8561
|
-
currentQuoteChar = null;
|
|
8562
|
-
}
|
|
8563
|
-
else {
|
|
8564
|
-
const placeholder = ESCAPE_IN_STRING_MAP[char];
|
|
8565
|
-
if (placeholder) {
|
|
8566
|
-
result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`;
|
|
8567
|
-
i += placeholder.length - 1;
|
|
8568
|
-
}
|
|
8569
|
-
}
|
|
8570
|
-
}
|
|
8571
|
-
else if (char === '\'' || char === '"') {
|
|
8572
|
-
currentQuoteChar = char;
|
|
8573
|
-
}
|
|
8574
|
-
}
|
|
8575
|
-
}
|
|
8576
|
-
return result;
|
|
8577
|
-
}
|
|
8578
|
-
/**
|
|
8579
|
-
* Replace in a string all occurrences of keys in the `ESCAPE_IN_STRING_MAP` map with their
|
|
8580
|
-
* original representation, this is simply used to revert the changes applied by the
|
|
8581
|
-
* escapeInStrings function.
|
|
8582
|
-
*
|
|
8583
|
-
* For example it reverts the text:
|
|
8584
|
-
* `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
|
|
8585
|
-
* to it's original form of:
|
|
8586
|
-
* `animation: "my-anim:at\"ion" 1s;`
|
|
8587
|
-
*
|
|
8588
|
-
* Note: For the sake of simplicity this function does not check that the placeholders are
|
|
8589
|
-
* actually inside strings as it would anyway be extremely unlikely to find them outside of strings.
|
|
8590
|
-
*
|
|
8591
|
-
* @param input the css text containing the placeholders.
|
|
8592
|
-
*
|
|
8593
|
-
* @returns the css text without the placeholders.
|
|
8594
|
-
*/
|
|
8595
|
-
function unescapeInStrings(input) {
|
|
8596
|
-
let result = input.replace(_cssCommaInPlaceholderReGlobal, ',');
|
|
8597
|
-
result = result.replace(_cssSemiInPlaceholderReGlobal, ';');
|
|
8598
|
-
result = result.replace(_cssColonInPlaceholderReGlobal, ':');
|
|
8599
|
-
return result;
|
|
8600
|
-
}
|
|
8601
|
-
/**
|
|
8602
|
-
* Unescape all quotes present in a string, but only if the string was actually already
|
|
8603
|
-
* quoted.
|
|
8604
|
-
*
|
|
8605
|
-
* This generates a "canonical" representation of strings which can be used to match strings
|
|
8606
|
-
* which would otherwise only differ because of differently escaped quotes.
|
|
8607
|
-
*
|
|
8608
|
-
* For example it converts the string (assumed to be quoted):
|
|
8609
|
-
* `this \\"is\\" a \\'\\\\'test`
|
|
8610
|
-
* to:
|
|
8611
|
-
* `this "is" a '\\\\'test`
|
|
8612
|
-
* (note that the latter backslashes are not removed as they are not actually escaping the single
|
|
8613
|
-
* quote)
|
|
8614
|
-
*
|
|
8615
|
-
*
|
|
8616
|
-
* @param input the string possibly containing escaped quotes.
|
|
8617
|
-
* @param isQuoted boolean indicating whether the string was quoted inside a bigger string (if not
|
|
8618
|
-
* then it means that it doesn't represent an inner string and thus no unescaping is required)
|
|
8619
|
-
*
|
|
8620
|
-
* @returns the string in the "canonical" representation without escaped quotes.
|
|
8621
|
-
*/
|
|
8622
|
-
function unescapeQuotes(str, isQuoted) {
|
|
8623
|
-
return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1');
|
|
8624
|
-
}
|
|
8625
8346
|
/**
|
|
8626
8347
|
* Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`
|
|
8627
8348
|
* to create a selector that matches the same as `:host-context()`.
|
|
@@ -8720,7 +8441,7 @@ function parse(value) {
|
|
|
8720
8441
|
const styles = [];
|
|
8721
8442
|
let i = 0;
|
|
8722
8443
|
let parenDepth = 0;
|
|
8723
|
-
let quote = 0 /* QuoteNone */;
|
|
8444
|
+
let quote = 0 /* Char.QuoteNone */;
|
|
8724
8445
|
let valueStart = 0;
|
|
8725
8446
|
let propStart = 0;
|
|
8726
8447
|
let currentProp = null;
|
|
@@ -8728,41 +8449,41 @@ function parse(value) {
|
|
|
8728
8449
|
while (i < value.length) {
|
|
8729
8450
|
const token = value.charCodeAt(i++);
|
|
8730
8451
|
switch (token) {
|
|
8731
|
-
case 40 /* OpenParen */:
|
|
8452
|
+
case 40 /* Char.OpenParen */:
|
|
8732
8453
|
parenDepth++;
|
|
8733
8454
|
break;
|
|
8734
|
-
case 41 /* CloseParen */:
|
|
8455
|
+
case 41 /* Char.CloseParen */:
|
|
8735
8456
|
parenDepth--;
|
|
8736
8457
|
break;
|
|
8737
|
-
case 39 /* QuoteSingle */:
|
|
8458
|
+
case 39 /* Char.QuoteSingle */:
|
|
8738
8459
|
// valueStart needs to be there since prop values don't
|
|
8739
8460
|
// have quotes in CSS
|
|
8740
8461
|
valueHasQuotes = valueHasQuotes || valueStart > 0;
|
|
8741
|
-
if (quote === 0 /* QuoteNone */) {
|
|
8742
|
-
quote = 39 /* QuoteSingle */;
|
|
8462
|
+
if (quote === 0 /* Char.QuoteNone */) {
|
|
8463
|
+
quote = 39 /* Char.QuoteSingle */;
|
|
8743
8464
|
}
|
|
8744
|
-
else if (quote === 39 /* QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
|
|
8745
|
-
quote = 0 /* QuoteNone */;
|
|
8465
|
+
else if (quote === 39 /* Char.QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) {
|
|
8466
|
+
quote = 0 /* Char.QuoteNone */;
|
|
8746
8467
|
}
|
|
8747
8468
|
break;
|
|
8748
|
-
case 34 /* QuoteDouble */:
|
|
8469
|
+
case 34 /* Char.QuoteDouble */:
|
|
8749
8470
|
// same logic as above
|
|
8750
8471
|
valueHasQuotes = valueHasQuotes || valueStart > 0;
|
|
8751
|
-
if (quote === 0 /* QuoteNone */) {
|
|
8752
|
-
quote = 34 /* QuoteDouble */;
|
|
8472
|
+
if (quote === 0 /* Char.QuoteNone */) {
|
|
8473
|
+
quote = 34 /* Char.QuoteDouble */;
|
|
8753
8474
|
}
|
|
8754
|
-
else if (quote === 34 /* QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
|
|
8755
|
-
quote = 0 /* QuoteNone */;
|
|
8475
|
+
else if (quote === 34 /* Char.QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) {
|
|
8476
|
+
quote = 0 /* Char.QuoteNone */;
|
|
8756
8477
|
}
|
|
8757
8478
|
break;
|
|
8758
|
-
case 58 /* Colon */:
|
|
8759
|
-
if (!currentProp && parenDepth === 0 && quote === 0 /* QuoteNone */) {
|
|
8479
|
+
case 58 /* Char.Colon */:
|
|
8480
|
+
if (!currentProp && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) {
|
|
8760
8481
|
currentProp = hyphenate(value.substring(propStart, i - 1).trim());
|
|
8761
8482
|
valueStart = i;
|
|
8762
8483
|
}
|
|
8763
8484
|
break;
|
|
8764
|
-
case 59 /* Semicolon */:
|
|
8765
|
-
if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* QuoteNone */) {
|
|
8485
|
+
case 59 /* Char.Semicolon */:
|
|
8486
|
+
if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) {
|
|
8766
8487
|
const styleVal = value.substring(valueStart, i - 1).trim();
|
|
8767
8488
|
styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
|
|
8768
8489
|
propStart = i;
|
|
@@ -8782,7 +8503,7 @@ function parse(value) {
|
|
|
8782
8503
|
function stripUnnecessaryQuotes(value) {
|
|
8783
8504
|
const qS = value.charCodeAt(0);
|
|
8784
8505
|
const qE = value.charCodeAt(value.length - 1);
|
|
8785
|
-
if (qS == qE && (qS == 39 /* QuoteSingle */ || qS == 34 /* QuoteDouble */)) {
|
|
8506
|
+
if (qS == qE && (qS == 39 /* Char.QuoteSingle */ || qS == 34 /* Char.QuoteDouble */)) {
|
|
8786
8507
|
const tempValue = value.substring(1, value.length - 1);
|
|
8787
8508
|
// special case to avoid using a multi-quoted string that was just chomped
|
|
8788
8509
|
// (e.g. `font-family: "Verdana", "sans-serif"`)
|
|
@@ -8933,13 +8654,13 @@ class StylingBuilder {
|
|
|
8933
8654
|
let binding = null;
|
|
8934
8655
|
let name = input.name;
|
|
8935
8656
|
switch (input.type) {
|
|
8936
|
-
case 0 /* Property */:
|
|
8657
|
+
case 0 /* BindingType.Property */:
|
|
8937
8658
|
binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
|
|
8938
8659
|
break;
|
|
8939
|
-
case 3 /* Style */:
|
|
8660
|
+
case 3 /* BindingType.Style */:
|
|
8940
8661
|
binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
|
|
8941
8662
|
break;
|
|
8942
|
-
case 2 /* Class */:
|
|
8663
|
+
case 2 /* BindingType.Class */:
|
|
8943
8664
|
binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
|
|
8944
8665
|
break;
|
|
8945
8666
|
}
|
|
@@ -9038,14 +8759,14 @@ class StylingBuilder {
|
|
|
9038
8759
|
populateInitialStylingAttrs(attrs) {
|
|
9039
8760
|
// [CLASS_MARKER, 'foo', 'bar', 'baz' ...]
|
|
9040
8761
|
if (this._initialClassValues.length) {
|
|
9041
|
-
attrs.push(literal(1 /* Classes */));
|
|
8762
|
+
attrs.push(literal(1 /* AttributeMarker.Classes */));
|
|
9042
8763
|
for (let i = 0; i < this._initialClassValues.length; i++) {
|
|
9043
8764
|
attrs.push(literal(this._initialClassValues[i]));
|
|
9044
8765
|
}
|
|
9045
8766
|
}
|
|
9046
8767
|
// [STYLE_MARKER, 'width', '200px', 'height', '100px', ...]
|
|
9047
8768
|
if (this._initialStyleValues.length) {
|
|
9048
|
-
attrs.push(literal(2 /* Styles */));
|
|
8769
|
+
attrs.push(literal(2 /* AttributeMarker.Styles */));
|
|
9049
8770
|
for (let i = 0; i < this._initialStyleValues.length; i += 2) {
|
|
9050
8771
|
attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
|
|
9051
8772
|
}
|
|
@@ -9777,9 +9498,9 @@ class Parser$1 {
|
|
|
9777
9498
|
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
9778
9499
|
const sourceToLex = this._stripComments(input);
|
|
9779
9500
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9780
|
-
let flags = 1 /* Action */;
|
|
9501
|
+
let flags = 1 /* ParseFlags.Action */;
|
|
9781
9502
|
if (isAssignmentEvent) {
|
|
9782
|
-
flags |= 2 /* AssignmentEvent */;
|
|
9503
|
+
flags |= 2 /* ParseFlags.AssignmentEvent */;
|
|
9783
9504
|
}
|
|
9784
9505
|
const ast = new _ParseAST(input, location, absoluteOffset, tokens, flags, this.errors, 0).parseChain();
|
|
9785
9506
|
return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);
|
|
@@ -9808,7 +9529,7 @@ class Parser$1 {
|
|
|
9808
9529
|
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
9809
9530
|
const sourceToLex = this._stripComments(input);
|
|
9810
9531
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9811
|
-
return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
|
|
9532
|
+
return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0)
|
|
9812
9533
|
.parseChain();
|
|
9813
9534
|
}
|
|
9814
9535
|
/**
|
|
@@ -9839,7 +9560,7 @@ class Parser$1 {
|
|
|
9839
9560
|
*/
|
|
9840
9561
|
parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {
|
|
9841
9562
|
const tokens = this._lexer.tokenize(templateValue);
|
|
9842
|
-
const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* None */, this.errors, 0 /* relative offset */);
|
|
9563
|
+
const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0 /* relative offset */);
|
|
9843
9564
|
return parser.parseTemplateBindings({
|
|
9844
9565
|
source: templateKey,
|
|
9845
9566
|
span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
|
|
@@ -9854,7 +9575,7 @@ class Parser$1 {
|
|
|
9854
9575
|
const expressionText = expressions[i].text;
|
|
9855
9576
|
const sourceToLex = this._stripComments(expressionText);
|
|
9856
9577
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9857
|
-
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, offsets[i])
|
|
9578
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, offsets[i])
|
|
9858
9579
|
.parseChain();
|
|
9859
9580
|
expressionNodes.push(ast);
|
|
9860
9581
|
}
|
|
@@ -9868,7 +9589,7 @@ class Parser$1 {
|
|
|
9868
9589
|
parseInterpolationExpression(expression, location, absoluteOffset) {
|
|
9869
9590
|
const sourceToLex = this._stripComments(expression);
|
|
9870
9591
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9871
|
-
const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
|
|
9592
|
+
const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0)
|
|
9872
9593
|
.parseChain();
|
|
9873
9594
|
const strings = ['', '']; // The prefix and suffix strings are both empty
|
|
9874
9595
|
return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);
|
|
@@ -10224,7 +9945,7 @@ class _ParseAST {
|
|
|
10224
9945
|
const expr = this.parsePipe();
|
|
10225
9946
|
exprs.push(expr);
|
|
10226
9947
|
if (this.consumeOptionalCharacter($SEMICOLON)) {
|
|
10227
|
-
if (!(this.parseFlags & 1 /* Action */)) {
|
|
9948
|
+
if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {
|
|
10228
9949
|
this.error('Binding expression cannot contain chained expression');
|
|
10229
9950
|
}
|
|
10230
9951
|
while (this.consumeOptionalCharacter($SEMICOLON)) {
|
|
@@ -10248,7 +9969,7 @@ class _ParseAST {
|
|
|
10248
9969
|
const start = this.inputIndex;
|
|
10249
9970
|
let result = this.parseExpression();
|
|
10250
9971
|
if (this.consumeOptionalOperator('|')) {
|
|
10251
|
-
if (this.parseFlags & 1 /* Action */) {
|
|
9972
|
+
if (this.parseFlags & 1 /* ParseFlags.Action */) {
|
|
10252
9973
|
this.error('Cannot have a pipe in an action expression');
|
|
10253
9974
|
}
|
|
10254
9975
|
do {
|
|
@@ -10600,7 +10321,7 @@ class _ParseAST {
|
|
|
10600
10321
|
}
|
|
10601
10322
|
else {
|
|
10602
10323
|
if (this.consumeOptionalAssignment()) {
|
|
10603
|
-
if (!(this.parseFlags & 1 /* Action */)) {
|
|
10324
|
+
if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {
|
|
10604
10325
|
this.error('Bindings cannot contain assignments');
|
|
10605
10326
|
return new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
10606
10327
|
}
|
|
@@ -10632,7 +10353,7 @@ class _ParseAST {
|
|
|
10632
10353
|
// primary expression is substituted as LHS of the assignment operator to achieve
|
|
10633
10354
|
// two-way-binding, such that the LHS could be the non-null operator. The grammar doesn't
|
|
10634
10355
|
// naturally allow for this syntax, so assignment events are parsed specially.
|
|
10635
|
-
if ((this.parseFlags & 2 /* AssignmentEvent */) && this.next.isOperator('!') &&
|
|
10356
|
+
if ((this.parseFlags & 2 /* ParseFlags.AssignmentEvent */) && this.next.isOperator('!') &&
|
|
10636
10357
|
this.peek(1).isOperator('=')) {
|
|
10637
10358
|
// First skip over the ! operator.
|
|
10638
10359
|
this.advance();
|
|
@@ -10954,7 +10675,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
|
|
|
10954
10675
|
let tokenIndex = 0;
|
|
10955
10676
|
while (tokenIndex < interpolatedTokens.length) {
|
|
10956
10677
|
const currentToken = interpolatedTokens[tokenIndex];
|
|
10957
|
-
if (currentToken.type === 9 /* ENCODED_ENTITY */) {
|
|
10678
|
+
if (currentToken.type === 9 /* MlParserTokenType.ENCODED_ENTITY */) {
|
|
10958
10679
|
const [decoded, encoded] = currentToken.parts;
|
|
10959
10680
|
consumedInOriginalTemplate += encoded.length;
|
|
10960
10681
|
consumedInInput += decoded.length;
|
|
@@ -13352,14 +13073,14 @@ class _Tokenizer {
|
|
|
13352
13073
|
else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {
|
|
13353
13074
|
// In (possibly interpolated) text the end of the text is given by `isTextEnd()`, while
|
|
13354
13075
|
// the premature end of an interpolation is given by the start of a new HTML element.
|
|
13355
|
-
this._consumeWithInterpolation(5 /* TEXT */, 8 /* INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart());
|
|
13076
|
+
this._consumeWithInterpolation(5 /* TokenType.TEXT */, 8 /* TokenType.INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart());
|
|
13356
13077
|
}
|
|
13357
13078
|
}
|
|
13358
13079
|
catch (e) {
|
|
13359
13080
|
this.handleError(e);
|
|
13360
13081
|
}
|
|
13361
13082
|
}
|
|
13362
|
-
this._beginToken(24 /* EOF */);
|
|
13083
|
+
this._beginToken(24 /* TokenType.EOF */);
|
|
13363
13084
|
this._endToken([]);
|
|
13364
13085
|
}
|
|
13365
13086
|
/**
|
|
@@ -13503,7 +13224,7 @@ class _Tokenizer {
|
|
|
13503
13224
|
return char;
|
|
13504
13225
|
}
|
|
13505
13226
|
_consumeEntity(textTokenType) {
|
|
13506
|
-
this._beginToken(9 /* ENCODED_ENTITY */);
|
|
13227
|
+
this._beginToken(9 /* TokenType.ENCODED_ENTITY */);
|
|
13507
13228
|
const start = this._cursor.clone();
|
|
13508
13229
|
this._cursor.advance();
|
|
13509
13230
|
if (this._attemptCharCode($HASH)) {
|
|
@@ -13549,7 +13270,7 @@ class _Tokenizer {
|
|
|
13549
13270
|
}
|
|
13550
13271
|
}
|
|
13551
13272
|
_consumeRawText(consumeEntities, endMarkerPredicate) {
|
|
13552
|
-
this._beginToken(consumeEntities ? 6 /* ESCAPABLE_RAW_TEXT */ : 7 /* RAW_TEXT */);
|
|
13273
|
+
this._beginToken(consumeEntities ? 6 /* TokenType.ESCAPABLE_RAW_TEXT */ : 7 /* TokenType.RAW_TEXT */);
|
|
13553
13274
|
const parts = [];
|
|
13554
13275
|
while (true) {
|
|
13555
13276
|
const tagCloseStart = this._cursor.clone();
|
|
@@ -13561,8 +13282,8 @@ class _Tokenizer {
|
|
|
13561
13282
|
if (consumeEntities && this._cursor.peek() === $AMPERSAND) {
|
|
13562
13283
|
this._endToken([this._processCarriageReturns(parts.join(''))]);
|
|
13563
13284
|
parts.length = 0;
|
|
13564
|
-
this._consumeEntity(6 /* ESCAPABLE_RAW_TEXT */);
|
|
13565
|
-
this._beginToken(6 /* ESCAPABLE_RAW_TEXT */);
|
|
13285
|
+
this._consumeEntity(6 /* TokenType.ESCAPABLE_RAW_TEXT */);
|
|
13286
|
+
this._beginToken(6 /* TokenType.ESCAPABLE_RAW_TEXT */);
|
|
13566
13287
|
}
|
|
13567
13288
|
else {
|
|
13568
13289
|
parts.push(this._readChar());
|
|
@@ -13571,25 +13292,25 @@ class _Tokenizer {
|
|
|
13571
13292
|
this._endToken([this._processCarriageReturns(parts.join(''))]);
|
|
13572
13293
|
}
|
|
13573
13294
|
_consumeComment(start) {
|
|
13574
|
-
this._beginToken(10 /* COMMENT_START */, start);
|
|
13295
|
+
this._beginToken(10 /* TokenType.COMMENT_START */, start);
|
|
13575
13296
|
this._requireCharCode($MINUS);
|
|
13576
13297
|
this._endToken([]);
|
|
13577
13298
|
this._consumeRawText(false, () => this._attemptStr('-->'));
|
|
13578
|
-
this._beginToken(11 /* COMMENT_END */);
|
|
13299
|
+
this._beginToken(11 /* TokenType.COMMENT_END */);
|
|
13579
13300
|
this._requireStr('-->');
|
|
13580
13301
|
this._endToken([]);
|
|
13581
13302
|
}
|
|
13582
13303
|
_consumeCdata(start) {
|
|
13583
|
-
this._beginToken(12 /* CDATA_START */, start);
|
|
13304
|
+
this._beginToken(12 /* TokenType.CDATA_START */, start);
|
|
13584
13305
|
this._requireStr('CDATA[');
|
|
13585
13306
|
this._endToken([]);
|
|
13586
13307
|
this._consumeRawText(false, () => this._attemptStr(']]>'));
|
|
13587
|
-
this._beginToken(13 /* CDATA_END */);
|
|
13308
|
+
this._beginToken(13 /* TokenType.CDATA_END */);
|
|
13588
13309
|
this._requireStr(']]>');
|
|
13589
13310
|
this._endToken([]);
|
|
13590
13311
|
}
|
|
13591
13312
|
_consumeDocType(start) {
|
|
13592
|
-
this._beginToken(18 /* DOC_TYPE */, start);
|
|
13313
|
+
this._beginToken(18 /* TokenType.DOC_TYPE */, start);
|
|
13593
13314
|
const contentStart = this._cursor.clone();
|
|
13594
13315
|
this._attemptUntilChar($GT);
|
|
13595
13316
|
const content = this._cursor.getChars(contentStart);
|
|
@@ -13643,12 +13364,12 @@ class _Tokenizer {
|
|
|
13643
13364
|
if (e instanceof _ControlFlowError) {
|
|
13644
13365
|
if (openTagToken) {
|
|
13645
13366
|
// We errored before we could close the opening tag, so it is incomplete.
|
|
13646
|
-
openTagToken.type = 4 /* INCOMPLETE_TAG_OPEN */;
|
|
13367
|
+
openTagToken.type = 4 /* TokenType.INCOMPLETE_TAG_OPEN */;
|
|
13647
13368
|
}
|
|
13648
13369
|
else {
|
|
13649
13370
|
// When the start tag is invalid, assume we want a "<" as text.
|
|
13650
13371
|
// Back to back text tokens are merged at the end.
|
|
13651
|
-
this._beginToken(5 /* TEXT */, start);
|
|
13372
|
+
this._beginToken(5 /* TokenType.TEXT */, start);
|
|
13652
13373
|
this._endToken(['<']);
|
|
13653
13374
|
}
|
|
13654
13375
|
return;
|
|
@@ -13675,13 +13396,13 @@ class _Tokenizer {
|
|
|
13675
13396
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
13676
13397
|
return this._attemptCharCode($GT);
|
|
13677
13398
|
});
|
|
13678
|
-
this._beginToken(3 /* TAG_CLOSE */);
|
|
13399
|
+
this._beginToken(3 /* TokenType.TAG_CLOSE */);
|
|
13679
13400
|
this._requireCharCodeUntilFn(code => code === $GT, 3);
|
|
13680
13401
|
this._cursor.advance(); // Consume the `>`
|
|
13681
13402
|
this._endToken([prefix, tagName]);
|
|
13682
13403
|
}
|
|
13683
13404
|
_consumeTagOpenStart(start) {
|
|
13684
|
-
this._beginToken(0 /* TAG_OPEN_START */, start);
|
|
13405
|
+
this._beginToken(0 /* TokenType.TAG_OPEN_START */, start);
|
|
13685
13406
|
const parts = this._consumePrefixAndName();
|
|
13686
13407
|
return this._endToken(parts);
|
|
13687
13408
|
}
|
|
@@ -13690,7 +13411,7 @@ class _Tokenizer {
|
|
|
13690
13411
|
if (attrNameStart === $SQ || attrNameStart === $DQ) {
|
|
13691
13412
|
throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());
|
|
13692
13413
|
}
|
|
13693
|
-
this._beginToken(14 /* ATTR_NAME */);
|
|
13414
|
+
this._beginToken(14 /* TokenType.ATTR_NAME */);
|
|
13694
13415
|
const prefixAndName = this._consumePrefixAndName();
|
|
13695
13416
|
this._endToken(prefixAndName);
|
|
13696
13417
|
}
|
|
@@ -13702,27 +13423,27 @@ class _Tokenizer {
|
|
|
13702
13423
|
// In an attribute then end of the attribute value and the premature end to an interpolation
|
|
13703
13424
|
// are both triggered by the `quoteChar`.
|
|
13704
13425
|
const endPredicate = () => this._cursor.peek() === quoteChar;
|
|
13705
|
-
this._consumeWithInterpolation(16 /* ATTR_VALUE_TEXT */, 17 /* ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
|
|
13426
|
+
this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
|
|
13706
13427
|
this._consumeQuote(quoteChar);
|
|
13707
13428
|
}
|
|
13708
13429
|
else {
|
|
13709
13430
|
const endPredicate = () => isNameEnd(this._cursor.peek());
|
|
13710
|
-
this._consumeWithInterpolation(16 /* ATTR_VALUE_TEXT */, 17 /* ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
|
|
13431
|
+
this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
|
|
13711
13432
|
}
|
|
13712
13433
|
}
|
|
13713
13434
|
_consumeQuote(quoteChar) {
|
|
13714
|
-
this._beginToken(15 /* ATTR_QUOTE */);
|
|
13435
|
+
this._beginToken(15 /* TokenType.ATTR_QUOTE */);
|
|
13715
13436
|
this._requireCharCode(quoteChar);
|
|
13716
13437
|
this._endToken([String.fromCodePoint(quoteChar)]);
|
|
13717
13438
|
}
|
|
13718
13439
|
_consumeTagOpenEnd() {
|
|
13719
|
-
const tokenType = this._attemptCharCode($SLASH) ? 2 /* TAG_OPEN_END_VOID */ : 1 /* TAG_OPEN_END */;
|
|
13440
|
+
const tokenType = this._attemptCharCode($SLASH) ? 2 /* TokenType.TAG_OPEN_END_VOID */ : 1 /* TokenType.TAG_OPEN_END */;
|
|
13720
13441
|
this._beginToken(tokenType);
|
|
13721
13442
|
this._requireCharCode($GT);
|
|
13722
13443
|
this._endToken([]);
|
|
13723
13444
|
}
|
|
13724
13445
|
_consumeTagClose(start) {
|
|
13725
|
-
this._beginToken(3 /* TAG_CLOSE */, start);
|
|
13446
|
+
this._beginToken(3 /* TokenType.TAG_CLOSE */, start);
|
|
13726
13447
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
13727
13448
|
const prefixAndName = this._consumePrefixAndName();
|
|
13728
13449
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
@@ -13730,11 +13451,11 @@ class _Tokenizer {
|
|
|
13730
13451
|
this._endToken(prefixAndName);
|
|
13731
13452
|
}
|
|
13732
13453
|
_consumeExpansionFormStart() {
|
|
13733
|
-
this._beginToken(19 /* EXPANSION_FORM_START */);
|
|
13454
|
+
this._beginToken(19 /* TokenType.EXPANSION_FORM_START */);
|
|
13734
13455
|
this._requireCharCode($LBRACE);
|
|
13735
13456
|
this._endToken([]);
|
|
13736
|
-
this._expansionCaseStack.push(19 /* EXPANSION_FORM_START */);
|
|
13737
|
-
this._beginToken(7 /* RAW_TEXT */);
|
|
13457
|
+
this._expansionCaseStack.push(19 /* TokenType.EXPANSION_FORM_START */);
|
|
13458
|
+
this._beginToken(7 /* TokenType.RAW_TEXT */);
|
|
13738
13459
|
const condition = this._readUntil($COMMA);
|
|
13739
13460
|
const normalizedCondition = this._processCarriageReturns(condition);
|
|
13740
13461
|
if (this._i18nNormalizeLineEndingsInICUs) {
|
|
@@ -13750,32 +13471,32 @@ class _Tokenizer {
|
|
|
13750
13471
|
}
|
|
13751
13472
|
this._requireCharCode($COMMA);
|
|
13752
13473
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
13753
|
-
this._beginToken(7 /* RAW_TEXT */);
|
|
13474
|
+
this._beginToken(7 /* TokenType.RAW_TEXT */);
|
|
13754
13475
|
const type = this._readUntil($COMMA);
|
|
13755
13476
|
this._endToken([type]);
|
|
13756
13477
|
this._requireCharCode($COMMA);
|
|
13757
13478
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
13758
13479
|
}
|
|
13759
13480
|
_consumeExpansionCaseStart() {
|
|
13760
|
-
this._beginToken(20 /* EXPANSION_CASE_VALUE */);
|
|
13481
|
+
this._beginToken(20 /* TokenType.EXPANSION_CASE_VALUE */);
|
|
13761
13482
|
const value = this._readUntil($LBRACE).trim();
|
|
13762
13483
|
this._endToken([value]);
|
|
13763
13484
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
13764
|
-
this._beginToken(21 /* EXPANSION_CASE_EXP_START */);
|
|
13485
|
+
this._beginToken(21 /* TokenType.EXPANSION_CASE_EXP_START */);
|
|
13765
13486
|
this._requireCharCode($LBRACE);
|
|
13766
13487
|
this._endToken([]);
|
|
13767
13488
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
13768
|
-
this._expansionCaseStack.push(21 /* EXPANSION_CASE_EXP_START */);
|
|
13489
|
+
this._expansionCaseStack.push(21 /* TokenType.EXPANSION_CASE_EXP_START */);
|
|
13769
13490
|
}
|
|
13770
13491
|
_consumeExpansionCaseEnd() {
|
|
13771
|
-
this._beginToken(22 /* EXPANSION_CASE_EXP_END */);
|
|
13492
|
+
this._beginToken(22 /* TokenType.EXPANSION_CASE_EXP_END */);
|
|
13772
13493
|
this._requireCharCode($RBRACE);
|
|
13773
13494
|
this._endToken([]);
|
|
13774
13495
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
13775
13496
|
this._expansionCaseStack.pop();
|
|
13776
13497
|
}
|
|
13777
13498
|
_consumeExpansionFormEnd() {
|
|
13778
|
-
this._beginToken(23 /* EXPANSION_FORM_END */);
|
|
13499
|
+
this._beginToken(23 /* TokenType.EXPANSION_FORM_END */);
|
|
13779
13500
|
this._requireCharCode($RBRACE);
|
|
13780
13501
|
this._endToken([]);
|
|
13781
13502
|
this._expansionCaseStack.pop();
|
|
@@ -13925,12 +13646,12 @@ class _Tokenizer {
|
|
|
13925
13646
|
_isInExpansionCase() {
|
|
13926
13647
|
return this._expansionCaseStack.length > 0 &&
|
|
13927
13648
|
this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
|
|
13928
|
-
21 /* EXPANSION_CASE_EXP_START */;
|
|
13649
|
+
21 /* TokenType.EXPANSION_CASE_EXP_START */;
|
|
13929
13650
|
}
|
|
13930
13651
|
_isInExpansionForm() {
|
|
13931
13652
|
return this._expansionCaseStack.length > 0 &&
|
|
13932
13653
|
this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
|
|
13933
|
-
19 /* EXPANSION_FORM_START */;
|
|
13654
|
+
19 /* TokenType.EXPANSION_FORM_START */;
|
|
13934
13655
|
}
|
|
13935
13656
|
isExpansionFormStart() {
|
|
13936
13657
|
if (this._cursor.peek() !== $LBRACE) {
|
|
@@ -13977,9 +13698,9 @@ function mergeTextTokens(srcTokens) {
|
|
|
13977
13698
|
let lastDstToken = undefined;
|
|
13978
13699
|
for (let i = 0; i < srcTokens.length; i++) {
|
|
13979
13700
|
const token = srcTokens[i];
|
|
13980
|
-
if ((lastDstToken && lastDstToken.type === 5 /* TEXT */ && token.type === 5 /* TEXT */) ||
|
|
13981
|
-
(lastDstToken && lastDstToken.type === 16 /* ATTR_VALUE_TEXT */ &&
|
|
13982
|
-
token.type === 16 /* ATTR_VALUE_TEXT */)) {
|
|
13701
|
+
if ((lastDstToken && lastDstToken.type === 5 /* TokenType.TEXT */ && token.type === 5 /* TokenType.TEXT */) ||
|
|
13702
|
+
(lastDstToken && lastDstToken.type === 16 /* TokenType.ATTR_VALUE_TEXT */ &&
|
|
13703
|
+
token.type === 16 /* TokenType.ATTR_VALUE_TEXT */)) {
|
|
13983
13704
|
lastDstToken.parts[0] += token.parts[0];
|
|
13984
13705
|
lastDstToken.sourceSpan.end = token.sourceSpan.end;
|
|
13985
13706
|
}
|
|
@@ -14272,28 +13993,28 @@ class _TreeBuilder {
|
|
|
14272
13993
|
this._advance();
|
|
14273
13994
|
}
|
|
14274
13995
|
build() {
|
|
14275
|
-
while (this._peek.type !== 24 /* EOF */) {
|
|
14276
|
-
if (this._peek.type === 0 /* TAG_OPEN_START */ ||
|
|
14277
|
-
this._peek.type === 4 /* INCOMPLETE_TAG_OPEN */) {
|
|
13996
|
+
while (this._peek.type !== 24 /* TokenType.EOF */) {
|
|
13997
|
+
if (this._peek.type === 0 /* TokenType.TAG_OPEN_START */ ||
|
|
13998
|
+
this._peek.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {
|
|
14278
13999
|
this._consumeStartTag(this._advance());
|
|
14279
14000
|
}
|
|
14280
|
-
else if (this._peek.type === 3 /* TAG_CLOSE */) {
|
|
14001
|
+
else if (this._peek.type === 3 /* TokenType.TAG_CLOSE */) {
|
|
14281
14002
|
this._consumeEndTag(this._advance());
|
|
14282
14003
|
}
|
|
14283
|
-
else if (this._peek.type === 12 /* CDATA_START */) {
|
|
14004
|
+
else if (this._peek.type === 12 /* TokenType.CDATA_START */) {
|
|
14284
14005
|
this._closeVoidElement();
|
|
14285
14006
|
this._consumeCdata(this._advance());
|
|
14286
14007
|
}
|
|
14287
|
-
else if (this._peek.type === 10 /* COMMENT_START */) {
|
|
14008
|
+
else if (this._peek.type === 10 /* TokenType.COMMENT_START */) {
|
|
14288
14009
|
this._closeVoidElement();
|
|
14289
14010
|
this._consumeComment(this._advance());
|
|
14290
14011
|
}
|
|
14291
|
-
else if (this._peek.type === 5 /* TEXT */ || this._peek.type === 7 /* RAW_TEXT */ ||
|
|
14292
|
-
this._peek.type === 6 /* ESCAPABLE_RAW_TEXT */) {
|
|
14012
|
+
else if (this._peek.type === 5 /* TokenType.TEXT */ || this._peek.type === 7 /* TokenType.RAW_TEXT */ ||
|
|
14013
|
+
this._peek.type === 6 /* TokenType.ESCAPABLE_RAW_TEXT */) {
|
|
14293
14014
|
this._closeVoidElement();
|
|
14294
14015
|
this._consumeText(this._advance());
|
|
14295
14016
|
}
|
|
14296
|
-
else if (this._peek.type === 19 /* EXPANSION_FORM_START */) {
|
|
14017
|
+
else if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */) {
|
|
14297
14018
|
this._consumeExpansion(this._advance());
|
|
14298
14019
|
}
|
|
14299
14020
|
else {
|
|
@@ -14319,11 +14040,11 @@ class _TreeBuilder {
|
|
|
14319
14040
|
}
|
|
14320
14041
|
_consumeCdata(_startToken) {
|
|
14321
14042
|
this._consumeText(this._advance());
|
|
14322
|
-
this._advanceIf(13 /* CDATA_END */);
|
|
14043
|
+
this._advanceIf(13 /* TokenType.CDATA_END */);
|
|
14323
14044
|
}
|
|
14324
14045
|
_consumeComment(token) {
|
|
14325
|
-
const text = this._advanceIf(7 /* RAW_TEXT */);
|
|
14326
|
-
this._advanceIf(11 /* COMMENT_END */);
|
|
14046
|
+
const text = this._advanceIf(7 /* TokenType.RAW_TEXT */);
|
|
14047
|
+
this._advanceIf(11 /* TokenType.COMMENT_END */);
|
|
14327
14048
|
const value = text != null ? text.parts[0].trim() : null;
|
|
14328
14049
|
this._addToParent(new Comment(value, token.sourceSpan));
|
|
14329
14050
|
}
|
|
@@ -14332,14 +14053,14 @@ class _TreeBuilder {
|
|
|
14332
14053
|
const type = this._advance();
|
|
14333
14054
|
const cases = [];
|
|
14334
14055
|
// read =
|
|
14335
|
-
while (this._peek.type === 20 /* EXPANSION_CASE_VALUE */) {
|
|
14056
|
+
while (this._peek.type === 20 /* TokenType.EXPANSION_CASE_VALUE */) {
|
|
14336
14057
|
const expCase = this._parseExpansionCase();
|
|
14337
14058
|
if (!expCase)
|
|
14338
14059
|
return; // error
|
|
14339
14060
|
cases.push(expCase);
|
|
14340
14061
|
}
|
|
14341
14062
|
// read the final }
|
|
14342
|
-
if (this._peek.type !== 23 /* EXPANSION_FORM_END */) {
|
|
14063
|
+
if (this._peek.type !== 23 /* TokenType.EXPANSION_FORM_END */) {
|
|
14343
14064
|
this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
|
|
14344
14065
|
return;
|
|
14345
14066
|
}
|
|
@@ -14350,7 +14071,7 @@ class _TreeBuilder {
|
|
|
14350
14071
|
_parseExpansionCase() {
|
|
14351
14072
|
const value = this._advance();
|
|
14352
14073
|
// read {
|
|
14353
|
-
if (this._peek.type !== 21 /* EXPANSION_CASE_EXP_START */) {
|
|
14074
|
+
if (this._peek.type !== 21 /* TokenType.EXPANSION_CASE_EXP_START */) {
|
|
14354
14075
|
this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`));
|
|
14355
14076
|
return null;
|
|
14356
14077
|
}
|
|
@@ -14360,7 +14081,7 @@ class _TreeBuilder {
|
|
|
14360
14081
|
if (!exp)
|
|
14361
14082
|
return null;
|
|
14362
14083
|
const end = this._advance();
|
|
14363
|
-
exp.push({ type: 24 /* EOF */, parts: [], sourceSpan: end.sourceSpan });
|
|
14084
|
+
exp.push({ type: 24 /* TokenType.EOF */, parts: [], sourceSpan: end.sourceSpan });
|
|
14364
14085
|
// parse everything in between { and }
|
|
14365
14086
|
const expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition);
|
|
14366
14087
|
expansionCaseParser.build();
|
|
@@ -14374,14 +14095,14 @@ class _TreeBuilder {
|
|
|
14374
14095
|
}
|
|
14375
14096
|
_collectExpansionExpTokens(start) {
|
|
14376
14097
|
const exp = [];
|
|
14377
|
-
const expansionFormStack = [21 /* EXPANSION_CASE_EXP_START */];
|
|
14098
|
+
const expansionFormStack = [21 /* TokenType.EXPANSION_CASE_EXP_START */];
|
|
14378
14099
|
while (true) {
|
|
14379
|
-
if (this._peek.type === 19 /* EXPANSION_FORM_START */ ||
|
|
14380
|
-
this._peek.type === 21 /* EXPANSION_CASE_EXP_START */) {
|
|
14100
|
+
if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */ ||
|
|
14101
|
+
this._peek.type === 21 /* TokenType.EXPANSION_CASE_EXP_START */) {
|
|
14381
14102
|
expansionFormStack.push(this._peek.type);
|
|
14382
14103
|
}
|
|
14383
|
-
if (this._peek.type === 22 /* EXPANSION_CASE_EXP_END */) {
|
|
14384
|
-
if (lastOnStack(expansionFormStack, 21 /* EXPANSION_CASE_EXP_START */)) {
|
|
14104
|
+
if (this._peek.type === 22 /* TokenType.EXPANSION_CASE_EXP_END */) {
|
|
14105
|
+
if (lastOnStack(expansionFormStack, 21 /* TokenType.EXPANSION_CASE_EXP_START */)) {
|
|
14385
14106
|
expansionFormStack.pop();
|
|
14386
14107
|
if (expansionFormStack.length === 0)
|
|
14387
14108
|
return exp;
|
|
@@ -14391,8 +14112,8 @@ class _TreeBuilder {
|
|
|
14391
14112
|
return null;
|
|
14392
14113
|
}
|
|
14393
14114
|
}
|
|
14394
|
-
if (this._peek.type === 23 /* EXPANSION_FORM_END */) {
|
|
14395
|
-
if (lastOnStack(expansionFormStack, 19 /* EXPANSION_FORM_START */)) {
|
|
14115
|
+
if (this._peek.type === 23 /* TokenType.EXPANSION_FORM_END */) {
|
|
14116
|
+
if (lastOnStack(expansionFormStack, 19 /* TokenType.EXPANSION_FORM_START */)) {
|
|
14396
14117
|
expansionFormStack.pop();
|
|
14397
14118
|
}
|
|
14398
14119
|
else {
|
|
@@ -14400,7 +14121,7 @@ class _TreeBuilder {
|
|
|
14400
14121
|
return null;
|
|
14401
14122
|
}
|
|
14402
14123
|
}
|
|
14403
|
-
if (this._peek.type === 24 /* EOF */) {
|
|
14124
|
+
if (this._peek.type === 24 /* TokenType.EOF */) {
|
|
14404
14125
|
this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
|
|
14405
14126
|
return null;
|
|
14406
14127
|
}
|
|
@@ -14419,18 +14140,18 @@ class _TreeBuilder {
|
|
|
14419
14140
|
tokens[0] = { type: token.type, sourceSpan: token.sourceSpan, parts: [text] };
|
|
14420
14141
|
}
|
|
14421
14142
|
}
|
|
14422
|
-
while (this._peek.type === 8 /* INTERPOLATION */ || this._peek.type === 5 /* TEXT */ ||
|
|
14423
|
-
this._peek.type === 9 /* ENCODED_ENTITY */) {
|
|
14143
|
+
while (this._peek.type === 8 /* TokenType.INTERPOLATION */ || this._peek.type === 5 /* TokenType.TEXT */ ||
|
|
14144
|
+
this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {
|
|
14424
14145
|
token = this._advance();
|
|
14425
14146
|
tokens.push(token);
|
|
14426
|
-
if (token.type === 8 /* INTERPOLATION */) {
|
|
14147
|
+
if (token.type === 8 /* TokenType.INTERPOLATION */) {
|
|
14427
14148
|
// For backward compatibility we decode HTML entities that appear in interpolation
|
|
14428
14149
|
// expressions. This is arguably a bug, but it could be a considerable breaking change to
|
|
14429
14150
|
// fix it. It should be addressed in a larger project to refactor the entire parser/lexer
|
|
14430
14151
|
// chain after View Engine has been removed.
|
|
14431
14152
|
text += token.parts.join('').replace(/&([^;]+);/g, decodeEntity);
|
|
14432
14153
|
}
|
|
14433
|
-
else if (token.type === 9 /* ENCODED_ENTITY */) {
|
|
14154
|
+
else if (token.type === 9 /* TokenType.ENCODED_ENTITY */) {
|
|
14434
14155
|
text += token.parts[0];
|
|
14435
14156
|
}
|
|
14436
14157
|
else {
|
|
@@ -14451,14 +14172,14 @@ class _TreeBuilder {
|
|
|
14451
14172
|
_consumeStartTag(startTagToken) {
|
|
14452
14173
|
const [prefix, name] = startTagToken.parts;
|
|
14453
14174
|
const attrs = [];
|
|
14454
|
-
while (this._peek.type === 14 /* ATTR_NAME */) {
|
|
14175
|
+
while (this._peek.type === 14 /* TokenType.ATTR_NAME */) {
|
|
14455
14176
|
attrs.push(this._consumeAttr(this._advance()));
|
|
14456
14177
|
}
|
|
14457
14178
|
const fullName = this._getElementFullName(prefix, name, this._getParentElement());
|
|
14458
14179
|
let selfClosing = false;
|
|
14459
14180
|
// Note: There could have been a tokenizer error
|
|
14460
14181
|
// so that we don't get a token for the end tag...
|
|
14461
|
-
if (this._peek.type === 2 /* TAG_OPEN_END_VOID */) {
|
|
14182
|
+
if (this._peek.type === 2 /* TokenType.TAG_OPEN_END_VOID */) {
|
|
14462
14183
|
this._advance();
|
|
14463
14184
|
selfClosing = true;
|
|
14464
14185
|
const tagDef = this.getTagDefinition(fullName);
|
|
@@ -14466,7 +14187,7 @@ class _TreeBuilder {
|
|
|
14466
14187
|
this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void and foreign elements can be self closed "${startTagToken.parts[1]}"`));
|
|
14467
14188
|
}
|
|
14468
14189
|
}
|
|
14469
|
-
else if (this._peek.type === 1 /* TAG_OPEN_END */) {
|
|
14190
|
+
else if (this._peek.type === 1 /* TokenType.TAG_OPEN_END */) {
|
|
14470
14191
|
this._advance();
|
|
14471
14192
|
selfClosing = false;
|
|
14472
14193
|
}
|
|
@@ -14481,7 +14202,7 @@ class _TreeBuilder {
|
|
|
14481
14202
|
// element start tag also represents the end tag.
|
|
14482
14203
|
this._popElement(fullName, span);
|
|
14483
14204
|
}
|
|
14484
|
-
else if (startTagToken.type === 4 /* INCOMPLETE_TAG_OPEN */) {
|
|
14205
|
+
else if (startTagToken.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {
|
|
14485
14206
|
// We already know the opening tag is not complete, so it is unlikely it has a corresponding
|
|
14486
14207
|
// close tag. Let's optimistically parse it as a full element and emit an error.
|
|
14487
14208
|
this._popElement(fullName, null);
|
|
@@ -14538,7 +14259,7 @@ class _TreeBuilder {
|
|
|
14538
14259
|
const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);
|
|
14539
14260
|
let attrEnd = attrName.sourceSpan.end;
|
|
14540
14261
|
// Consume any quote
|
|
14541
|
-
if (this._peek.type === 15 /* ATTR_QUOTE */) {
|
|
14262
|
+
if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {
|
|
14542
14263
|
this._advance();
|
|
14543
14264
|
}
|
|
14544
14265
|
// Consume the attribute value
|
|
@@ -14551,22 +14272,22 @@ class _TreeBuilder {
|
|
|
14551
14272
|
// being able to consider `ATTR_VALUE_INTERPOLATION` as an option. This is because TS is not
|
|
14552
14273
|
// able to see that `_advance()` will actually mutate `_peek`.
|
|
14553
14274
|
const nextTokenType = this._peek.type;
|
|
14554
|
-
if (nextTokenType === 16 /* ATTR_VALUE_TEXT */) {
|
|
14275
|
+
if (nextTokenType === 16 /* TokenType.ATTR_VALUE_TEXT */) {
|
|
14555
14276
|
valueStartSpan = this._peek.sourceSpan;
|
|
14556
14277
|
valueEnd = this._peek.sourceSpan.end;
|
|
14557
|
-
while (this._peek.type === 16 /* ATTR_VALUE_TEXT */ ||
|
|
14558
|
-
this._peek.type === 17 /* ATTR_VALUE_INTERPOLATION */ ||
|
|
14559
|
-
this._peek.type === 9 /* ENCODED_ENTITY */) {
|
|
14278
|
+
while (this._peek.type === 16 /* TokenType.ATTR_VALUE_TEXT */ ||
|
|
14279
|
+
this._peek.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */ ||
|
|
14280
|
+
this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {
|
|
14560
14281
|
const valueToken = this._advance();
|
|
14561
14282
|
valueTokens.push(valueToken);
|
|
14562
|
-
if (valueToken.type === 17 /* ATTR_VALUE_INTERPOLATION */) {
|
|
14283
|
+
if (valueToken.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */) {
|
|
14563
14284
|
// For backward compatibility we decode HTML entities that appear in interpolation
|
|
14564
14285
|
// expressions. This is arguably a bug, but it could be a considerable breaking change to
|
|
14565
14286
|
// fix it. It should be addressed in a larger project to refactor the entire parser/lexer
|
|
14566
14287
|
// chain after View Engine has been removed.
|
|
14567
14288
|
value += valueToken.parts.join('').replace(/&([^;]+);/g, decodeEntity);
|
|
14568
14289
|
}
|
|
14569
|
-
else if (valueToken.type === 9 /* ENCODED_ENTITY */) {
|
|
14290
|
+
else if (valueToken.type === 9 /* TokenType.ENCODED_ENTITY */) {
|
|
14570
14291
|
value += valueToken.parts[0];
|
|
14571
14292
|
}
|
|
14572
14293
|
else {
|
|
@@ -14576,7 +14297,7 @@ class _TreeBuilder {
|
|
|
14576
14297
|
}
|
|
14577
14298
|
}
|
|
14578
14299
|
// Consume any quote
|
|
14579
|
-
if (this._peek.type === 15 /* ATTR_QUOTE */) {
|
|
14300
|
+
if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {
|
|
14580
14301
|
const quoteToken = this._advance();
|
|
14581
14302
|
attrEnd = quoteToken.sourceSpan.end;
|
|
14582
14303
|
}
|
|
@@ -14706,7 +14427,7 @@ class WhitespaceVisitor {
|
|
|
14706
14427
|
(context.prev instanceof Expansion || context.next instanceof Expansion);
|
|
14707
14428
|
if (isNotBlank || hasExpansionSibling) {
|
|
14708
14429
|
// Process the whitespace in the tokens of this Text node
|
|
14709
|
-
const tokens = text.tokens.map(token => token.type === 5 /* TEXT */ ? createWhitespaceProcessedTextToken(token) : token);
|
|
14430
|
+
const tokens = text.tokens.map(token => token.type === 5 /* TokenType.TEXT */ ? createWhitespaceProcessedTextToken(token) : token);
|
|
14710
14431
|
// Process the whitespace of the value of this Text node
|
|
14711
14432
|
const value = processWhitespace(text.value);
|
|
14712
14433
|
return new Text(value, text.sourceSpan, tokens, text.i18n);
|
|
@@ -15555,7 +15276,7 @@ class BindingParser {
|
|
|
15555
15276
|
}
|
|
15556
15277
|
createBoundElementProperty(elementSelector, boundProp, skipValidation = false, mapPropertyName = true) {
|
|
15557
15278
|
if (boundProp.isAnimation) {
|
|
15558
|
-
return new BoundElementProperty(boundProp.name, 4 /* Animation */, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
|
|
15279
|
+
return new BoundElementProperty(boundProp.name, 4 /* BindingType.Animation */, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
|
|
15559
15280
|
}
|
|
15560
15281
|
let unit = null;
|
|
15561
15282
|
let bindingType = undefined;
|
|
@@ -15576,17 +15297,17 @@ class BindingParser {
|
|
|
15576
15297
|
const name = boundPropertyName.substring(nsSeparatorIdx + 1);
|
|
15577
15298
|
boundPropertyName = mergeNsAndName(ns, name);
|
|
15578
15299
|
}
|
|
15579
|
-
bindingType = 1 /* Attribute */;
|
|
15300
|
+
bindingType = 1 /* BindingType.Attribute */;
|
|
15580
15301
|
}
|
|
15581
15302
|
else if (parts[0] == CLASS_PREFIX) {
|
|
15582
15303
|
boundPropertyName = parts[1];
|
|
15583
|
-
bindingType = 2 /* Class */;
|
|
15304
|
+
bindingType = 2 /* BindingType.Class */;
|
|
15584
15305
|
securityContexts = [SecurityContext.NONE];
|
|
15585
15306
|
}
|
|
15586
15307
|
else if (parts[0] == STYLE_PREFIX) {
|
|
15587
15308
|
unit = parts.length > 2 ? parts[2] : null;
|
|
15588
15309
|
boundPropertyName = parts[1];
|
|
15589
|
-
bindingType = 3 /* Style */;
|
|
15310
|
+
bindingType = 3 /* BindingType.Style */;
|
|
15590
15311
|
securityContexts = [SecurityContext.STYLE];
|
|
15591
15312
|
}
|
|
15592
15313
|
}
|
|
@@ -15595,7 +15316,7 @@ class BindingParser {
|
|
|
15595
15316
|
const mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name);
|
|
15596
15317
|
boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name;
|
|
15597
15318
|
securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, mappedPropName, false);
|
|
15598
|
-
bindingType = 0 /* Property */;
|
|
15319
|
+
bindingType = 0 /* BindingType.Property */;
|
|
15599
15320
|
if (!skipValidation) {
|
|
15600
15321
|
this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false);
|
|
15601
15322
|
}
|
|
@@ -15627,7 +15348,7 @@ class BindingParser {
|
|
|
15627
15348
|
const eventName = matches[0];
|
|
15628
15349
|
const phase = matches[1].toLowerCase();
|
|
15629
15350
|
const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
|
|
15630
|
-
targetEvents.push(new ParsedEvent(eventName, phase, 1 /* Animation */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15351
|
+
targetEvents.push(new ParsedEvent(eventName, phase, 1 /* ParsedEventType.Animation */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15631
15352
|
if (eventName.length === 0) {
|
|
15632
15353
|
this._reportError(`Animation event name is missing in binding`, sourceSpan);
|
|
15633
15354
|
}
|
|
@@ -15645,7 +15366,7 @@ class BindingParser {
|
|
|
15645
15366
|
const [target, eventName] = splitAtColon(name, [null, name]);
|
|
15646
15367
|
const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
|
|
15647
15368
|
targetMatchableAttrs.push([name, ast.source]);
|
|
15648
|
-
targetEvents.push(new ParsedEvent(eventName, target, 0 /* Regular */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15369
|
+
targetEvents.push(new ParsedEvent(eventName, target, 0 /* ParsedEventType.Regular */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15649
15370
|
// Don't detect directives for event names for now,
|
|
15650
15371
|
// so don't add the event name to the matchableAttrs
|
|
15651
15372
|
}
|
|
@@ -16726,8 +16447,8 @@ class _I18nVisitor {
|
|
|
16726
16447
|
let hasInterpolation = false;
|
|
16727
16448
|
for (const token of tokens) {
|
|
16728
16449
|
switch (token.type) {
|
|
16729
|
-
case 8 /* INTERPOLATION */:
|
|
16730
|
-
case 17 /* ATTR_VALUE_INTERPOLATION */:
|
|
16450
|
+
case 8 /* TokenType.INTERPOLATION */:
|
|
16451
|
+
case 17 /* TokenType.ATTR_VALUE_INTERPOLATION */:
|
|
16731
16452
|
hasInterpolation = true;
|
|
16732
16453
|
const expression = token.parts[1];
|
|
16733
16454
|
const baseName = extractPlaceholderName(expression) || 'INTERPOLATION';
|
|
@@ -17056,14 +16777,14 @@ function parseI18nMeta(meta = '') {
|
|
|
17056
16777
|
function i18nMetaToJSDoc(meta) {
|
|
17057
16778
|
const tags = [];
|
|
17058
16779
|
if (meta.description) {
|
|
17059
|
-
tags.push({ tagName: "desc" /* Desc */, text: meta.description });
|
|
16780
|
+
tags.push({ tagName: "desc" /* o.JSDocTagName.Desc */, text: meta.description });
|
|
17060
16781
|
}
|
|
17061
16782
|
else {
|
|
17062
16783
|
// Suppress the JSCompiler warning that a `@desc` was not given for this message.
|
|
17063
|
-
tags.push({ tagName: "suppress" /* Suppress */, text: '{msgDescriptions}' });
|
|
16784
|
+
tags.push({ tagName: "suppress" /* o.JSDocTagName.Suppress */, text: '{msgDescriptions}' });
|
|
17064
16785
|
}
|
|
17065
16786
|
if (meta.meaning) {
|
|
17066
|
-
tags.push({ tagName: "meaning" /* Meaning */, text: meta.meaning });
|
|
16787
|
+
tags.push({ tagName: "meaning" /* o.JSDocTagName.Meaning */, text: meta.meaning });
|
|
17067
16788
|
}
|
|
17068
16789
|
return jsDocComment(tags);
|
|
17069
16790
|
}
|
|
@@ -17337,7 +17058,7 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
|
|
|
17337
17058
|
statements.push(new ExpressionStatement(invokeInstruction(null, Identifiers.resetView, [])));
|
|
17338
17059
|
}
|
|
17339
17060
|
}
|
|
17340
|
-
const eventName = type === 1 /* Animation */ ? prepareSyntheticListenerName(name, phase) : name;
|
|
17061
|
+
const eventName = type === 1 /* ParsedEventType.Animation */ ? prepareSyntheticListenerName(name, phase) : name;
|
|
17341
17062
|
const fnName = handlerName && sanitizeIdentifier(handlerName);
|
|
17342
17063
|
const fnArgs = [];
|
|
17343
17064
|
if (implicitReceiverAccesses.has(eventArgumentName)) {
|
|
@@ -17489,10 +17210,10 @@ class TemplateDefinitionBuilder {
|
|
|
17489
17210
|
const creationVariables = this._bindingScope.viewSnapshotStatements();
|
|
17490
17211
|
const updateVariables = this._bindingScope.variableDeclarations().concat(this._tempVariables);
|
|
17491
17212
|
const creationBlock = creationStatements.length > 0 ?
|
|
17492
|
-
[renderFlagCheckIfStmt(1 /* Create */, creationVariables.concat(creationStatements))] :
|
|
17213
|
+
[renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, creationVariables.concat(creationStatements))] :
|
|
17493
17214
|
[];
|
|
17494
17215
|
const updateBlock = updateStatements.length > 0 ?
|
|
17495
|
-
[renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(updateStatements))] :
|
|
17216
|
+
[renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateVariables.concat(updateStatements))] :
|
|
17496
17217
|
[];
|
|
17497
17218
|
return fn(
|
|
17498
17219
|
// i.e. (rf: RenderFlags, ctx: any)
|
|
@@ -17530,7 +17251,7 @@ class TemplateDefinitionBuilder {
|
|
|
17530
17251
|
const scopedName = this._bindingScope.freshReferenceName();
|
|
17531
17252
|
const retrievalLevel = this.level;
|
|
17532
17253
|
const lhs = variable(variable$1.name + scopedName);
|
|
17533
|
-
this._bindingScope.set(retrievalLevel, variable$1.name, lhs, 1 /* CONTEXT */, (scope, relativeLevel) => {
|
|
17254
|
+
this._bindingScope.set(retrievalLevel, variable$1.name, lhs, 1 /* DeclarationPriority.CONTEXT */, (scope, relativeLevel) => {
|
|
17534
17255
|
let rhs;
|
|
17535
17256
|
if (scope.bindingLevel === retrievalLevel) {
|
|
17536
17257
|
if (scope.isListenerScope() && scope.hasRestoreViewVariable()) {
|
|
@@ -17783,7 +17504,7 @@ class TemplateDefinitionBuilder {
|
|
|
17783
17504
|
element.inputs.forEach(input => {
|
|
17784
17505
|
const stylingInputWasSet = stylingBuilder.registerBoundInput(input);
|
|
17785
17506
|
if (!stylingInputWasSet) {
|
|
17786
|
-
if (input.type === 0 /* Property */ && input.i18n) {
|
|
17507
|
+
if (input.type === 0 /* BindingType.Property */ && input.i18n) {
|
|
17787
17508
|
boundI18nAttrs.push(input);
|
|
17788
17509
|
}
|
|
17789
17510
|
else {
|
|
@@ -17856,7 +17577,7 @@ class TemplateDefinitionBuilder {
|
|
|
17856
17577
|
// Generate element input bindings
|
|
17857
17578
|
allOtherInputs.forEach(input => {
|
|
17858
17579
|
const inputType = input.type;
|
|
17859
|
-
if (inputType === 4 /* Animation */) {
|
|
17580
|
+
if (inputType === 4 /* BindingType.Animation */) {
|
|
17860
17581
|
const value = input.value.visit(this._valueConverter);
|
|
17861
17582
|
// animation bindings can be presented in the following formats:
|
|
17862
17583
|
// 1. [@binding]="fooExp"
|
|
@@ -17883,7 +17604,7 @@ class TemplateDefinitionBuilder {
|
|
|
17883
17604
|
if (value !== undefined) {
|
|
17884
17605
|
const params = [];
|
|
17885
17606
|
const [attrNamespace, attrName] = splitNsName(input.name);
|
|
17886
|
-
const isAttributeBinding = inputType === 1 /* Attribute */;
|
|
17607
|
+
const isAttributeBinding = inputType === 1 /* BindingType.Attribute */;
|
|
17887
17608
|
const sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
|
|
17888
17609
|
if (sanitizationRef)
|
|
17889
17610
|
params.push(sanitizationRef);
|
|
@@ -17899,7 +17620,7 @@ class TemplateDefinitionBuilder {
|
|
|
17899
17620
|
}
|
|
17900
17621
|
}
|
|
17901
17622
|
this.allocateBindingSlots(value);
|
|
17902
|
-
if (inputType === 0 /* Property */) {
|
|
17623
|
+
if (inputType === 0 /* BindingType.Property */) {
|
|
17903
17624
|
if (value instanceof Interpolation) {
|
|
17904
17625
|
// prop="{{value}}" and friends
|
|
17905
17626
|
this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value), elementIndex, attrName, input, value, params);
|
|
@@ -17913,7 +17634,7 @@ class TemplateDefinitionBuilder {
|
|
|
17913
17634
|
});
|
|
17914
17635
|
}
|
|
17915
17636
|
}
|
|
17916
|
-
else if (inputType === 1 /* Attribute */) {
|
|
17637
|
+
else if (inputType === 1 /* BindingType.Attribute */) {
|
|
17917
17638
|
if (value instanceof Interpolation && getInterpolationArgsLength(value) > 1) {
|
|
17918
17639
|
// attr.name="text{{value}}" and friends
|
|
17919
17640
|
this.interpolatedUpdateInstruction(getAttributeInterpolationExpression(value), elementIndex, attrName, input, value, params);
|
|
@@ -18309,13 +18030,13 @@ class TemplateDefinitionBuilder {
|
|
|
18309
18030
|
const input = inputs[i];
|
|
18310
18031
|
// We don't want the animation and attribute bindings in the
|
|
18311
18032
|
// attributes array since they aren't used for directive matching.
|
|
18312
|
-
if (input.type !== 4 /* Animation */ && input.type !== 1 /* Attribute */) {
|
|
18033
|
+
if (input.type !== 4 /* BindingType.Animation */ && input.type !== 1 /* BindingType.Attribute */) {
|
|
18313
18034
|
addAttrExpr(input.name);
|
|
18314
18035
|
}
|
|
18315
18036
|
}
|
|
18316
18037
|
for (let i = 0; i < outputs.length; i++) {
|
|
18317
18038
|
const output = outputs[i];
|
|
18318
|
-
if (output.type !== 1 /* Animation */) {
|
|
18039
|
+
if (output.type !== 1 /* ParsedEventType.Animation */) {
|
|
18319
18040
|
addAttrExpr(output.name);
|
|
18320
18041
|
}
|
|
18321
18042
|
}
|
|
@@ -18324,15 +18045,15 @@ class TemplateDefinitionBuilder {
|
|
|
18324
18045
|
// to the expressions. The marker is important because it tells the runtime
|
|
18325
18046
|
// code that this is where attributes without values start...
|
|
18326
18047
|
if (attrExprs.length !== attrsLengthBeforeInputs) {
|
|
18327
|
-
attrExprs.splice(attrsLengthBeforeInputs, 0, literal(3 /* Bindings */));
|
|
18048
|
+
attrExprs.splice(attrsLengthBeforeInputs, 0, literal(3 /* core.AttributeMarker.Bindings */));
|
|
18328
18049
|
}
|
|
18329
18050
|
}
|
|
18330
18051
|
if (templateAttrs.length) {
|
|
18331
|
-
attrExprs.push(literal(4 /* Template */));
|
|
18052
|
+
attrExprs.push(literal(4 /* core.AttributeMarker.Template */));
|
|
18332
18053
|
templateAttrs.forEach(attr => addAttrExpr(attr.name));
|
|
18333
18054
|
}
|
|
18334
18055
|
if (boundI18nAttrs.length) {
|
|
18335
|
-
attrExprs.push(literal(6 /* I18n */));
|
|
18056
|
+
attrExprs.push(literal(6 /* core.AttributeMarker.I18n */));
|
|
18336
18057
|
boundI18nAttrs.forEach(attr => addAttrExpr(attr.name));
|
|
18337
18058
|
}
|
|
18338
18059
|
return attrExprs;
|
|
@@ -18363,7 +18084,7 @@ class TemplateDefinitionBuilder {
|
|
|
18363
18084
|
const variableName = this._bindingScope.freshReferenceName();
|
|
18364
18085
|
const retrievalLevel = this.level;
|
|
18365
18086
|
const lhs = variable(variableName);
|
|
18366
|
-
this._bindingScope.set(retrievalLevel, reference.name, lhs, 0 /* DEFAULT */, (scope, relativeLevel) => {
|
|
18087
|
+
this._bindingScope.set(retrievalLevel, reference.name, lhs, 0 /* DeclarationPriority.DEFAULT */, (scope, relativeLevel) => {
|
|
18367
18088
|
// e.g. nextContext(2);
|
|
18368
18089
|
const nextContextStmt = relativeLevel > 0 ? [generateNextContextExpr(relativeLevel).toStmt()] : [];
|
|
18369
18090
|
// e.g. const $foo$ = reference(1);
|
|
@@ -18377,7 +18098,7 @@ class TemplateDefinitionBuilder {
|
|
|
18377
18098
|
prepareListenerParameter(tagName, outputAst, index) {
|
|
18378
18099
|
return () => {
|
|
18379
18100
|
const eventName = outputAst.name;
|
|
18380
|
-
const bindingFnName = outputAst.type === 1 /* Animation */ ?
|
|
18101
|
+
const bindingFnName = outputAst.type === 1 /* ParsedEventType.Animation */ ?
|
|
18381
18102
|
// synthetic @listener.foo values are treated the exact same as are standard listeners
|
|
18382
18103
|
prepareSyntheticListenerFunctionName(eventName, outputAst.phase) :
|
|
18383
18104
|
sanitizeIdentifier(eventName);
|
|
@@ -18497,7 +18218,7 @@ function getAttributeNameLiterals(name) {
|
|
|
18497
18218
|
const nameLiteral = literal(attributeName);
|
|
18498
18219
|
if (attributeNamespace) {
|
|
18499
18220
|
return [
|
|
18500
|
-
literal(0 /* NamespaceURI */), literal(attributeNamespace), nameLiteral
|
|
18221
|
+
literal(0 /* core.AttributeMarker.NamespaceURI */), literal(attributeNamespace), nameLiteral
|
|
18501
18222
|
];
|
|
18502
18223
|
}
|
|
18503
18224
|
return [nameLiteral];
|
|
@@ -18566,7 +18287,7 @@ class BindingScope {
|
|
|
18566
18287
|
* @param declareLocalCallback The callback to invoke when declaring this local var
|
|
18567
18288
|
* @param localRef Whether or not this is a local ref
|
|
18568
18289
|
*/
|
|
18569
|
-
set(retrievalLevel, name, lhs, priority = 0 /* DEFAULT */, declareLocalCallback, localRef) {
|
|
18290
|
+
set(retrievalLevel, name, lhs, priority = 0 /* DeclarationPriority.DEFAULT */, declareLocalCallback, localRef) {
|
|
18570
18291
|
if (this.map.has(name)) {
|
|
18571
18292
|
if (localRef) {
|
|
18572
18293
|
// Do not throw an error if it's a local ref and do not update existing value,
|
|
@@ -18622,7 +18343,7 @@ class BindingScope {
|
|
|
18622
18343
|
return sharedCtxObj && sharedCtxObj.declare ? sharedCtxObj.lhs : null;
|
|
18623
18344
|
}
|
|
18624
18345
|
maybeGenerateSharedContextVar(value) {
|
|
18625
|
-
if (value.priority === 1 /* CONTEXT */ &&
|
|
18346
|
+
if (value.priority === 1 /* DeclarationPriority.CONTEXT */ &&
|
|
18626
18347
|
value.retrievalLevel < this.bindingLevel) {
|
|
18627
18348
|
const sharedCtxObj = this.map.get(SHARED_CONTEXT_KEY + value.retrievalLevel);
|
|
18628
18349
|
if (sharedCtxObj) {
|
|
@@ -18643,7 +18364,7 @@ class BindingScope {
|
|
|
18643
18364
|
return [lhs.set(generateNextContextExpr(relativeLevel)).toConstDecl()];
|
|
18644
18365
|
},
|
|
18645
18366
|
declare: false,
|
|
18646
|
-
priority: 2 /* SHARED_CONTEXT */,
|
|
18367
|
+
priority: 2 /* DeclarationPriority.SHARED_CONTEXT */,
|
|
18647
18368
|
});
|
|
18648
18369
|
}
|
|
18649
18370
|
getComponentProperty(name) {
|
|
@@ -18740,7 +18461,7 @@ function getNgProjectAsLiteral(attribute) {
|
|
|
18740
18461
|
// Parse the attribute value into a CssSelectorList. Note that we only take the
|
|
18741
18462
|
// first selector, because we don't support multiple selectors in ngProjectAs.
|
|
18742
18463
|
const parsedR3Selector = parseSelectorToR3Selector(attribute.value)[0];
|
|
18743
|
-
return [literal(5 /* ProjectAs */), asLiteral(parsedR3Selector)];
|
|
18464
|
+
return [literal(5 /* core.AttributeMarker.ProjectAs */), asLiteral(parsedR3Selector)];
|
|
18744
18465
|
}
|
|
18745
18466
|
/**
|
|
18746
18467
|
* Gets the instruction to generate for an interpolated property
|
|
@@ -19171,8 +18892,15 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
19171
18892
|
const styleValues = meta.encapsulation == ViewEncapsulation.Emulated ?
|
|
19172
18893
|
compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) :
|
|
19173
18894
|
meta.styles;
|
|
19174
|
-
const
|
|
19175
|
-
|
|
18895
|
+
const styleNodes = styleValues.reduce((result, style) => {
|
|
18896
|
+
if (style.trim().length > 0) {
|
|
18897
|
+
result.push(constantPool.getConstLiteral(literal(style)));
|
|
18898
|
+
}
|
|
18899
|
+
return result;
|
|
18900
|
+
}, []);
|
|
18901
|
+
if (styleNodes.length > 0) {
|
|
18902
|
+
definitionMap.set('styles', literalArr(styleNodes));
|
|
18903
|
+
}
|
|
19176
18904
|
}
|
|
19177
18905
|
else if (meta.encapsulation === ViewEncapsulation.Emulated) {
|
|
19178
18906
|
// If there is no style, don't generate css selectors on elements
|
|
@@ -19210,13 +18938,13 @@ function createComponentType(meta) {
|
|
|
19210
18938
|
*/
|
|
19211
18939
|
function compileDeclarationList(list, mode) {
|
|
19212
18940
|
switch (mode) {
|
|
19213
|
-
case 0 /* Direct */:
|
|
18941
|
+
case 0 /* DeclarationListEmitMode.Direct */:
|
|
19214
18942
|
// directives: [MyDir],
|
|
19215
18943
|
return list;
|
|
19216
|
-
case 1 /* Closure */:
|
|
18944
|
+
case 1 /* DeclarationListEmitMode.Closure */:
|
|
19217
18945
|
// directives: function () { return [MyDir]; }
|
|
19218
18946
|
return fn([], [new ReturnStatement(list)]);
|
|
19219
|
-
case 2 /* ClosureResolved */:
|
|
18947
|
+
case 2 /* DeclarationListEmitMode.ClosureResolved */:
|
|
19220
18948
|
// directives: function () { return [MyDir].map(ng.resolveForwardRef); }
|
|
19221
18949
|
const resolvedList = list.prop('map').callFn([importExpr(Identifiers.resolveForwardRef)]);
|
|
19222
18950
|
return fn([], [new ReturnStatement(resolvedList)]);
|
|
@@ -19234,9 +18962,9 @@ function prepareQueryParams(query, constantPool) {
|
|
|
19234
18962
|
* @param query
|
|
19235
18963
|
*/
|
|
19236
18964
|
function toQueryFlags(query) {
|
|
19237
|
-
return (query.descendants ? 1 /* descendants */ : 0 /* none */) |
|
|
19238
|
-
(query.static ? 2 /* isStatic */ : 0 /* none */) |
|
|
19239
|
-
(query.emitDistinctChangesOnly ? 4 /* emitDistinctChangesOnly */ : 0 /* none */);
|
|
18965
|
+
return (query.descendants ? 1 /* QueryFlags.descendants */ : 0 /* QueryFlags.none */) |
|
|
18966
|
+
(query.static ? 2 /* QueryFlags.isStatic */ : 0 /* QueryFlags.none */) |
|
|
18967
|
+
(query.emitDistinctChangesOnly ? 4 /* QueryFlags.emitDistinctChangesOnly */ : 0 /* QueryFlags.none */);
|
|
19240
18968
|
}
|
|
19241
18969
|
function convertAttributesToExpressions(attributes) {
|
|
19242
18970
|
const values = [];
|
|
@@ -19270,8 +18998,8 @@ function createContentQueriesFunction(queries, constantPool, name) {
|
|
|
19270
18998
|
new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null),
|
|
19271
18999
|
new FnParam('dirIndex', null)
|
|
19272
19000
|
], [
|
|
19273
|
-
renderFlagCheckIfStmt(1 /* Create */, createStatements),
|
|
19274
|
-
renderFlagCheckIfStmt(2 /* Update */, updateStatements)
|
|
19001
|
+
renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements),
|
|
19002
|
+
renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateStatements)
|
|
19275
19003
|
], INFERRED_TYPE, null, contentQueriesFnName);
|
|
19276
19004
|
}
|
|
19277
19005
|
function stringAsType(str) {
|
|
@@ -19337,8 +19065,8 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
|
19337
19065
|
});
|
|
19338
19066
|
const viewQueryFnName = name ? `${name}_Query` : null;
|
|
19339
19067
|
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
|
|
19340
|
-
renderFlagCheckIfStmt(1 /* Create */, createStatements),
|
|
19341
|
-
renderFlagCheckIfStmt(2 /* Update */, updateStatements)
|
|
19068
|
+
renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements),
|
|
19069
|
+
renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateStatements)
|
|
19342
19070
|
], INFERRED_TYPE, null, viewQueryFnName);
|
|
19343
19071
|
}
|
|
19344
19072
|
// Return a host binding function or null if one is not necessary.
|
|
@@ -19478,10 +19206,10 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19478
19206
|
const hostBindingsFnName = name ? `${name}_HostBindings` : null;
|
|
19479
19207
|
const statements = [];
|
|
19480
19208
|
if (createInstructions.length > 0) {
|
|
19481
|
-
statements.push(renderFlagCheckIfStmt(1 /* Create */, getInstructionStatements(createInstructions)));
|
|
19209
|
+
statements.push(renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, getInstructionStatements(createInstructions)));
|
|
19482
19210
|
}
|
|
19483
19211
|
if (updateInstructions.length > 0) {
|
|
19484
|
-
statements.push(renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(getInstructionStatements(updateInstructions))));
|
|
19212
|
+
statements.push(renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateVariables.concat(getInstructionStatements(updateInstructions))));
|
|
19485
19213
|
}
|
|
19486
19214
|
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], statements, INFERRED_TYPE, null, hostBindingsFnName);
|
|
19487
19215
|
}
|
|
@@ -19522,12 +19250,12 @@ function createHostListeners(eventBindings, name) {
|
|
|
19522
19250
|
const instructions = [];
|
|
19523
19251
|
for (const binding of eventBindings) {
|
|
19524
19252
|
let bindingName = binding.name && sanitizeIdentifier(binding.name);
|
|
19525
|
-
const bindingFnName = binding.type === 1 /* Animation */ ?
|
|
19253
|
+
const bindingFnName = binding.type === 1 /* ParsedEventType.Animation */ ?
|
|
19526
19254
|
prepareSyntheticListenerFunctionName(bindingName, binding.targetOrPhase) :
|
|
19527
19255
|
bindingName;
|
|
19528
19256
|
const handlerName = name && bindingName ? `${name}_${bindingFnName}_HostBindingHandler` : null;
|
|
19529
19257
|
const params = prepareEventListenerParameters(BoundEvent.fromParsedEvent(binding), handlerName);
|
|
19530
|
-
if (binding.type == 1 /* Animation */) {
|
|
19258
|
+
if (binding.type == 1 /* ParsedEventType.Animation */) {
|
|
19531
19259
|
syntheticListenerParams.push(params);
|
|
19532
19260
|
}
|
|
19533
19261
|
else {
|
|
@@ -19576,7 +19304,7 @@ function parseHostBindings(host) {
|
|
|
19576
19304
|
}
|
|
19577
19305
|
}
|
|
19578
19306
|
}
|
|
19579
|
-
else if (matches[1 /* Binding */] != null) {
|
|
19307
|
+
else if (matches[1 /* HostBindingGroup.Binding */] != null) {
|
|
19580
19308
|
if (typeof value !== 'string') {
|
|
19581
19309
|
// TODO(alxhub): make this a diagnostic.
|
|
19582
19310
|
throw new Error(`Property binding must be string`);
|
|
@@ -19584,14 +19312,14 @@ function parseHostBindings(host) {
|
|
|
19584
19312
|
// synthetic properties (the ones that have a `@` as a prefix)
|
|
19585
19313
|
// are still treated the same as regular properties. Therefore
|
|
19586
19314
|
// there is no point in storing them in a separate map.
|
|
19587
|
-
properties[matches[1 /* Binding */]] = value;
|
|
19315
|
+
properties[matches[1 /* HostBindingGroup.Binding */]] = value;
|
|
19588
19316
|
}
|
|
19589
|
-
else if (matches[2 /* Event */] != null) {
|
|
19317
|
+
else if (matches[2 /* HostBindingGroup.Event */] != null) {
|
|
19590
19318
|
if (typeof value !== 'string') {
|
|
19591
19319
|
// TODO(alxhub): make this a diagnostic.
|
|
19592
19320
|
throw new Error(`Event binding must be string`);
|
|
19593
19321
|
}
|
|
19594
|
-
listeners[matches[2 /* Event */]] = value;
|
|
19322
|
+
listeners[matches[2 /* HostBindingGroup.Event */]] = value;
|
|
19595
19323
|
}
|
|
19596
19324
|
}
|
|
19597
19325
|
return { attributes, listeners, properties, specialAttributes };
|
|
@@ -19763,7 +19491,7 @@ class CompilerFacadeImpl {
|
|
|
19763
19491
|
selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(),
|
|
19764
19492
|
template,
|
|
19765
19493
|
declarations: facade.declarations.map(convertDeclarationFacadeToMetadata),
|
|
19766
|
-
declarationListEmitMode: 0 /* Direct */,
|
|
19494
|
+
declarationListEmitMode: 0 /* DeclarationListEmitMode.Direct */,
|
|
19767
19495
|
styles: [...facade.styles, ...template.styles],
|
|
19768
19496
|
encapsulation: facade.encapsulation,
|
|
19769
19497
|
interpolation,
|
|
@@ -19860,7 +19588,7 @@ function convertQueryPredicate(predicate) {
|
|
|
19860
19588
|
// The predicate is an array of strings so pass it through.
|
|
19861
19589
|
predicate :
|
|
19862
19590
|
// The predicate is a type - assume that we will need to unwrap any `forwardRef()` calls.
|
|
19863
|
-
createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* Wrapped */);
|
|
19591
|
+
createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* ForwardRefHandling.Wrapped */);
|
|
19864
19592
|
}
|
|
19865
19593
|
function convertDirectiveFacadeToMetadata(facade) {
|
|
19866
19594
|
const inputsFromMetadata = parseInputOutputs(facade.inputs || []);
|
|
@@ -19974,7 +19702,7 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
|
|
|
19974
19702
|
changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default,
|
|
19975
19703
|
encapsulation: decl.encapsulation ?? ViewEncapsulation.Emulated,
|
|
19976
19704
|
interpolation,
|
|
19977
|
-
declarationListEmitMode: 2 /* ClosureResolved */,
|
|
19705
|
+
declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */,
|
|
19978
19706
|
relativeContextFilePath: '',
|
|
19979
19707
|
i18nUseExternalIds: true,
|
|
19980
19708
|
};
|
|
@@ -20035,7 +19763,7 @@ function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces,
|
|
|
20035
19763
|
*/
|
|
20036
19764
|
function convertToProviderExpression(obj, property) {
|
|
20037
19765
|
if (obj.hasOwnProperty(property)) {
|
|
20038
|
-
return createMayBeForwardRefExpression(new WrappedNodeExpr(obj[property]), 0 /* None */);
|
|
19766
|
+
return createMayBeForwardRefExpression(new WrappedNodeExpr(obj[property]), 0 /* ForwardRefHandling.None */);
|
|
20039
19767
|
}
|
|
20040
19768
|
else {
|
|
20041
19769
|
return undefined;
|
|
@@ -20053,7 +19781,7 @@ function computeProvidedIn(providedIn) {
|
|
|
20053
19781
|
const expression = typeof providedIn === 'function' ? new WrappedNodeExpr(providedIn) :
|
|
20054
19782
|
new LiteralExpr(providedIn ?? null);
|
|
20055
19783
|
// See `convertToProviderExpression()` for why this uses `ForwardRefHandling.None`.
|
|
20056
|
-
return createMayBeForwardRefExpression(expression, 0 /* None */);
|
|
19784
|
+
return createMayBeForwardRefExpression(expression, 0 /* ForwardRefHandling.None */);
|
|
20057
19785
|
}
|
|
20058
19786
|
function convertR3DependencyMetadataArray(facades) {
|
|
20059
19787
|
return facades == null ? null : facades.map(convertR3DependencyMetadata);
|
|
@@ -20160,7 +19888,7 @@ function publishFacade(global) {
|
|
|
20160
19888
|
* Use of this source code is governed by an MIT-style license that can be
|
|
20161
19889
|
* found in the LICENSE file at https://angular.io/license
|
|
20162
19890
|
*/
|
|
20163
|
-
const VERSION = new Version('14.0.0-next.
|
|
19891
|
+
const VERSION = new Version('14.0.0-next.16');
|
|
20164
19892
|
|
|
20165
19893
|
/**
|
|
20166
19894
|
* @license
|
|
@@ -22193,7 +21921,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
22193
21921
|
function compileDeclareClassMetadata(metadata) {
|
|
22194
21922
|
const definitionMap = new DefinitionMap();
|
|
22195
21923
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
22196
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
21924
|
+
definitionMap.set('version', literal('14.0.0-next.16'));
|
|
22197
21925
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22198
21926
|
definitionMap.set('type', metadata.type);
|
|
22199
21927
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -22293,7 +22021,7 @@ function compileDependency(dep) {
|
|
|
22293
22021
|
*
|
|
22294
22022
|
* Do not include any prerelease in these versions as they are ignored.
|
|
22295
22023
|
*/
|
|
22296
|
-
const MINIMUM_PARTIAL_LINKER_VERSION$5 = '
|
|
22024
|
+
const MINIMUM_PARTIAL_LINKER_VERSION$5 = '14.0.0';
|
|
22297
22025
|
/**
|
|
22298
22026
|
* Compile a directive declaration defined by the `R3DirectiveMetadata`.
|
|
22299
22027
|
*/
|
|
@@ -22310,7 +22038,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
|
|
|
22310
22038
|
function createDirectiveDefinitionMap(meta) {
|
|
22311
22039
|
const definitionMap = new DefinitionMap();
|
|
22312
22040
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
22313
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22041
|
+
definitionMap.set('version', literal('14.0.0-next.16'));
|
|
22314
22042
|
// e.g. `type: MyDirective`
|
|
22315
22043
|
definitionMap.set('type', meta.internalType);
|
|
22316
22044
|
if (meta.isStandalone) {
|
|
@@ -22477,7 +22205,7 @@ function computeEndLocation(file, contents) {
|
|
|
22477
22205
|
return new ParseLocation(file, length, line, length - lastLineStart);
|
|
22478
22206
|
}
|
|
22479
22207
|
function compileUsedDependenciesMetadata(meta) {
|
|
22480
|
-
const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?
|
|
22208
|
+
const wrapType = meta.declarationListEmitMode !== 0 /* DeclarationListEmitMode.Direct */ ?
|
|
22481
22209
|
generateForwardRef :
|
|
22482
22210
|
(expr) => expr;
|
|
22483
22211
|
return toOptionalLiteralArray(meta.declarations, decl => {
|
|
@@ -22524,7 +22252,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22524
22252
|
function compileDeclareFactoryFunction(meta) {
|
|
22525
22253
|
const definitionMap = new DefinitionMap();
|
|
22526
22254
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22527
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22255
|
+
definitionMap.set('version', literal('14.0.0-next.16'));
|
|
22528
22256
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22529
22257
|
definitionMap.set('type', meta.internalType);
|
|
22530
22258
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -22566,7 +22294,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22566
22294
|
function createInjectableDefinitionMap(meta) {
|
|
22567
22295
|
const definitionMap = new DefinitionMap();
|
|
22568
22296
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22569
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22297
|
+
definitionMap.set('version', literal('14.0.0-next.16'));
|
|
22570
22298
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22571
22299
|
definitionMap.set('type', meta.internalType);
|
|
22572
22300
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -22624,7 +22352,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22624
22352
|
function createInjectorDefinitionMap(meta) {
|
|
22625
22353
|
const definitionMap = new DefinitionMap();
|
|
22626
22354
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22627
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22355
|
+
definitionMap.set('version', literal('14.0.0-next.16'));
|
|
22628
22356
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22629
22357
|
definitionMap.set('type', meta.internalType);
|
|
22630
22358
|
definitionMap.set('providers', meta.providers);
|
|
@@ -22648,7 +22376,7 @@ function createInjectorDefinitionMap(meta) {
|
|
|
22648
22376
|
*
|
|
22649
22377
|
* Do not include any prerelease in these versions as they are ignored.
|
|
22650
22378
|
*/
|
|
22651
|
-
const MINIMUM_PARTIAL_LINKER_VERSION$1 = '
|
|
22379
|
+
const MINIMUM_PARTIAL_LINKER_VERSION$1 = '14.0.0';
|
|
22652
22380
|
function compileDeclareNgModuleFromMetadata(meta) {
|
|
22653
22381
|
const definitionMap = createNgModuleDefinitionMap(meta);
|
|
22654
22382
|
const expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]);
|
|
@@ -22661,7 +22389,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22661
22389
|
function createNgModuleDefinitionMap(meta) {
|
|
22662
22390
|
const definitionMap = new DefinitionMap();
|
|
22663
22391
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22664
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22392
|
+
definitionMap.set('version', literal('14.0.0-next.16'));
|
|
22665
22393
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22666
22394
|
definitionMap.set('type', meta.internalType);
|
|
22667
22395
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -22703,7 +22431,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
22703
22431
|
*
|
|
22704
22432
|
* Do not include any prerelease in these versions as they are ignored.
|
|
22705
22433
|
*/
|
|
22706
|
-
const MINIMUM_PARTIAL_LINKER_VERSION = '
|
|
22434
|
+
const MINIMUM_PARTIAL_LINKER_VERSION = '14.0.0';
|
|
22707
22435
|
/**
|
|
22708
22436
|
* Compile a Pipe declaration defined by the `R3PipeMetadata`.
|
|
22709
22437
|
*/
|
|
@@ -22719,7 +22447,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22719
22447
|
function createPipeDefinitionMap(meta) {
|
|
22720
22448
|
const definitionMap = new DefinitionMap();
|
|
22721
22449
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22722
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22450
|
+
definitionMap.set('version', literal('14.0.0-next.16'));
|
|
22723
22451
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22724
22452
|
// e.g. `type: MyPipe`
|
|
22725
22453
|
definitionMap.set('type', meta.internalType);
|