@next-core/brick-kit 2.154.15 → 2.154.17

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.
@@ -10974,7 +10974,7 @@
10974
10974
  return _asyncToGenerator__default["default"](function* () {
10975
10975
  for (var brickConf of bricks) {
10976
10976
  try {
10977
- yield _this5.mountBrick(brickConf, match, slotId, mountRoutesResult, tplStack === null || tplStack === void 0 ? void 0 : tplStack.slice());
10977
+ yield _this5.mountBrick(brickConf, match, slotId, mountRoutesResult, tplStack && new Map(tplStack));
10978
10978
  } catch (error) {
10979
10979
  if (error instanceof ResolveRequestError) {
10980
10980
  var errorMessage = httpErrorToString(error.rawError);
@@ -11033,7 +11033,7 @@
11033
11033
  return _asyncToGenerator__default["default"](function* () {
11034
11034
  var _this7$kernel$nextApp, _brickConf$lifeCycle, _brick$lifeCycle;
11035
11035
 
11036
- var tplStack = _arguments.length > 4 && _arguments[4] !== undefined ? _arguments[4] : [];
11036
+ var tplStack = _arguments.length > 4 && _arguments[4] !== undefined ? _arguments[4] : new Map();
11037
11037
  var tplContextId = brickConf[symbolForTplContextId];
11038
11038
  var formContextId = brickConf[symbolForFormContextId];
11039
11039
 
@@ -11063,11 +11063,15 @@
11063
11063
  var tplTagName = getTagNameOfCustomTemplate(brickConf.brick, (_this7$kernel$nextApp = _this7.kernel.nextApp) === null || _this7$kernel$nextApp === void 0 ? void 0 : _this7$kernel$nextApp.id);
11064
11064
 
11065
11065
  if (tplTagName) {
11066
- if (tplStack.includes(tplTagName)) {
11067
- throw new Error("Circular custom template: \"".concat(tplTagName, "\""));
11066
+ var _tplStack$get;
11067
+
11068
+ var tplCount = (_tplStack$get = tplStack.get(tplTagName)) !== null && _tplStack$get !== void 0 ? _tplStack$get : 0;
11069
+
11070
+ if (tplCount >= 10) {
11071
+ throw new Error("Maximum custom template stack overflowed: \"".concat(tplTagName, "\""));
11068
11072
  }
11069
11073
 
11070
- tplStack.push(tplTagName);
11074
+ tplStack.set(tplTagName, tplCount + 1);
11071
11075
  }
11072
11076
 
11073
11077
  if (brickConf.brick === formRenderer) {