@angular/compiler 13.3.2 → 13.3.5

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.3.2
2
+ * @license Angular v13.3.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.3.2
2
+ * @license Angular v13.3.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4872,6 +4872,12 @@ const IMPLICIT_REFERENCE = '$implicit';
4872
4872
  const NON_BINDABLE_ATTR = 'ngNonBindable';
4873
4873
  /** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */
4874
4874
  const RESTORED_VIEW_CONTEXT_NAME = 'restoredCtx';
4875
+ /**
4876
+ * Maximum length of a single instruction chain. Because our output AST uses recursion, we're
4877
+ * limited in how many expressions we can nest before we reach the call stack limit. This
4878
+ * length is set very conservatively in order to reduce the chance of problems.
4879
+ */
4880
+ const MAX_CHAIN_LENGTH = 500;
4875
4881
  /** Instructions that support chaining. */
4876
4882
  const CHAINABLE_INSTRUCTIONS = new Set([
4877
4883
  Identifiers.element,
@@ -5097,16 +5103,18 @@ function getInstructionStatements(instructions) {
5097
5103
  const statements = [];
5098
5104
  let pendingExpression = null;
5099
5105
  let pendingExpressionType = null;
5106
+ let chainLength = 0;
5100
5107
  for (const current of instructions) {
5101
5108
  const resolvedParams = (typeof current.paramsOrFn === 'function' ? current.paramsOrFn() : current.paramsOrFn) ??
5102
5109
  [];
5103
5110
  const params = Array.isArray(resolvedParams) ? resolvedParams : [resolvedParams];
5104
5111
  // If the current instruction is the same as the previous one
5105
5112
  // and it can be chained, add another call to the chain.
5106
- if (pendingExpressionType === current.reference &&
5113
+ if (chainLength < MAX_CHAIN_LENGTH && pendingExpressionType === current.reference &&
5107
5114
  CHAINABLE_INSTRUCTIONS.has(pendingExpressionType)) {
5108
5115
  // We'll always have a pending expression when there's a pending expression type.
5109
5116
  pendingExpression = pendingExpression.callFn(params, pendingExpression.sourceSpan);
5117
+ chainLength++;
5110
5118
  }
5111
5119
  else {
5112
5120
  if (pendingExpression !== null) {
@@ -5114,6 +5122,7 @@ function getInstructionStatements(instructions) {
5114
5122
  }
5115
5123
  pendingExpression = invokeInstruction(current.span, current.reference, params);
5116
5124
  pendingExpressionType = current.reference;
5125
+ chainLength = 0;
5117
5126
  }
5118
5127
  }
5119
5128
  // Since the current instruction adds the previous one to the statements,
@@ -19774,7 +19783,7 @@ function publishFacade(global) {
19774
19783
  * Use of this source code is governed by an MIT-style license that can be
19775
19784
  * found in the LICENSE file at https://angular.io/license
19776
19785
  */
19777
- const VERSION = new Version('13.3.2');
19786
+ const VERSION = new Version('13.3.5');
19778
19787
 
19779
19788
  /**
19780
19789
  * @license
@@ -21815,7 +21824,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21815
21824
  function compileDeclareClassMetadata(metadata) {
21816
21825
  const definitionMap = new DefinitionMap();
21817
21826
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21818
- definitionMap.set('version', literal('13.3.2'));
21827
+ definitionMap.set('version', literal('13.3.5'));
21819
21828
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21820
21829
  definitionMap.set('type', metadata.type);
21821
21830
  definitionMap.set('decorators', metadata.decorators);
@@ -21932,7 +21941,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
21932
21941
  function createDirectiveDefinitionMap(meta) {
21933
21942
  const definitionMap = new DefinitionMap();
21934
21943
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21935
- definitionMap.set('version', literal('13.3.2'));
21944
+ definitionMap.set('version', literal('13.3.5'));
21936
21945
  // e.g. `type: MyDirective`
21937
21946
  definitionMap.set('type', meta.internalType);
21938
21947
  // e.g. `selector: 'some-dir'`
@@ -22153,7 +22162,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22153
22162
  function compileDeclareFactoryFunction(meta) {
22154
22163
  const definitionMap = new DefinitionMap();
22155
22164
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22156
- definitionMap.set('version', literal('13.3.2'));
22165
+ definitionMap.set('version', literal('13.3.5'));
22157
22166
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22158
22167
  definitionMap.set('type', meta.internalType);
22159
22168
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22195,7 +22204,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22195
22204
  function createInjectableDefinitionMap(meta) {
22196
22205
  const definitionMap = new DefinitionMap();
22197
22206
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22198
- definitionMap.set('version', literal('13.3.2'));
22207
+ definitionMap.set('version', literal('13.3.5'));
22199
22208
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22200
22209
  definitionMap.set('type', meta.internalType);
22201
22210
  // Only generate providedIn property if it has a non-null value
@@ -22253,7 +22262,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22253
22262
  function createInjectorDefinitionMap(meta) {
22254
22263
  const definitionMap = new DefinitionMap();
22255
22264
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22256
- definitionMap.set('version', literal('13.3.2'));
22265
+ definitionMap.set('version', literal('13.3.5'));
22257
22266
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22258
22267
  definitionMap.set('type', meta.internalType);
22259
22268
  definitionMap.set('providers', meta.providers);
@@ -22290,7 +22299,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22290
22299
  function createNgModuleDefinitionMap(meta) {
22291
22300
  const definitionMap = new DefinitionMap();
22292
22301
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22293
- definitionMap.set('version', literal('13.3.2'));
22302
+ definitionMap.set('version', literal('13.3.5'));
22294
22303
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22295
22304
  definitionMap.set('type', meta.internalType);
22296
22305
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22348,7 +22357,7 @@ function compileDeclarePipeFromMetadata(meta) {
22348
22357
  function createPipeDefinitionMap(meta) {
22349
22358
  const definitionMap = new DefinitionMap();
22350
22359
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22351
- definitionMap.set('version', literal('13.3.2'));
22360
+ definitionMap.set('version', literal('13.3.5'));
22352
22361
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22353
22362
  // e.g. `type: MyPipe`
22354
22363
  definitionMap.set('type', meta.internalType);