@lwc/engine-core 7.2.4 → 7.2.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.
package/dist/index.cjs.js CHANGED
@@ -5856,6 +5856,12 @@ function getVMBeingRendered() {
5856
5856
  function setVMBeingRendered(vm) {
5857
5857
  vmBeingRendered = vm;
5858
5858
  }
5859
+ const VALID_SCOPE_TOKEN_REGEX = /^[a-zA-Z0-9\-_.]+$/;
5860
+ // See W-16614556
5861
+ // TODO [#2826]: freeze the template object
5862
+ function isValidScopeToken(token) {
5863
+ return shared.isString(token) && VALID_SCOPE_TOKEN_REGEX.test(token);
5864
+ }
5859
5865
  function validateSlots(vm) {
5860
5866
  assertNotProd(); // this method should never leak to prod
5861
5867
  const { cmpSlots } = vm;
@@ -6008,9 +6014,9 @@ function buildParseFragmentFn(createFragmentFn) {
6008
6014
  }
6009
6015
  }
6010
6016
  // See W-16614556
6011
- if ((hasStyleToken && !shared.isString(stylesheetToken)) ||
6012
- (hasLegacyToken && !shared.isString(legacyStylesheetToken))) {
6013
- throw new Error('stylesheet token must be a string');
6017
+ if ((hasStyleToken && !isValidScopeToken(stylesheetToken)) ||
6018
+ (hasLegacyToken && !isValidScopeToken(legacyStylesheetToken))) {
6019
+ throw new Error('stylesheet token must be a valid string');
6014
6020
  }
6015
6021
  // If legacy stylesheet tokens are required, then add them to the rendered string
6016
6022
  const stylesheetTokenToRender = stylesheetToken + (hasLegacyToken ? ` ${legacyStylesheetToken}` : '');
@@ -8134,5 +8140,5 @@ exports.swapTemplate = swapTemplate;
8134
8140
  exports.track = track;
8135
8141
  exports.unwrap = unwrap;
8136
8142
  exports.wire = wire;
8137
- /** version: 7.2.4 */
8143
+ /** version: 7.2.5 */
8138
8144
  //# sourceMappingURL=index.cjs.js.map