scratch-paint 2.2.239 → 2.2.240

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.240](https://github.com/scratchfoundation/scratch-paint/compare/v2.2.239...v2.2.240) (2024-06-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** lock file maintenance ([#2608](https://github.com/scratchfoundation/scratch-paint/issues/2608)) ([c69a173](https://github.com/scratchfoundation/scratch-paint/commit/c69a17302f0bc0bb45abd3a05f21fda89ef9f9fb))
12
+ * **deps:** update dependency scratch-l10n to v3.18.186 ([#2607](https://github.com/scratchfoundation/scratch-paint/issues/2607)) ([8b68b76](https://github.com/scratchfoundation/scratch-paint/commit/8b68b768142ace906f940e25460453ecaef64f1b))
13
+
6
14
  ## [2.2.239](https://github.com/scratchfoundation/scratch-paint/compare/v2.2.238...v2.2.239) (2024-06-16)
7
15
 
8
16
 
@@ -22899,7 +22899,7 @@ var pp$9 = Parser.prototype;
22899
22899
 
22900
22900
  // ## Parser utilities
22901
22901
 
22902
- var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
22902
+ var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/s;
22903
22903
  pp$9.strictDirective = function(start) {
22904
22904
  if (this.options.ecmaVersion < 5) { return false }
22905
22905
  for (;;) {
@@ -23085,7 +23085,7 @@ pp$8.isLet = function(context) {
23085
23085
  // Statement) is allowed here. If context is not empty then only a Statement
23086
23086
  // is allowed. However, `let [` is an explicit negative lookahead for
23087
23087
  // ExpressionStatement, so special-case it first.
23088
- if (nextCh === 91 || nextCh === 92) { return true } // '[', '/'
23088
+ if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
23089
23089
  if (context) { return false }
23090
23090
 
23091
23091
  if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral
@@ -23278,13 +23278,19 @@ pp$8.parseForStatement = function(node) {
23278
23278
  return this.parseFor(node, init$1)
23279
23279
  }
23280
23280
  var startsWithLet = this.isContextual("let"), isForOf = false;
23281
+ var containsEsc = this.containsEsc;
23281
23282
  var refDestructuringErrors = new DestructuringErrors;
23282
- var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors);
23283
+ var initPos = this.start;
23284
+ var init = awaitAt > -1
23285
+ ? this.parseExprSubscripts(refDestructuringErrors, "await")
23286
+ : this.parseExpression(true, refDestructuringErrors);
23283
23287
  if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
23284
- if (this.options.ecmaVersion >= 9) {
23285
- if (this.type === types$1._in) {
23286
- if (awaitAt > -1) { this.unexpected(awaitAt); }
23287
- } else { node.await = awaitAt > -1; }
23288
+ if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
23289
+ if (this.type === types$1._in) { this.unexpected(awaitAt); }
23290
+ node.await = true;
23291
+ } else if (isForOf && this.options.ecmaVersion >= 8) {
23292
+ if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
23293
+ else if (this.options.ecmaVersion >= 9) { node.await = false; }
23288
23294
  }
23289
23295
  if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
23290
23296
  this.toAssignable(init, false, refDestructuringErrors);
@@ -24897,8 +24903,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
24897
24903
  node.argument = this.parseMaybeUnary(null, true, update, forInit);
24898
24904
  this.checkExpressionErrors(refDestructuringErrors, true);
24899
24905
  if (update) { this.checkLValSimple(node.argument); }
24900
- else if (this.strict && node.operator === "delete" &&
24901
- node.argument.type === "Identifier")
24906
+ else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
24902
24907
  { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
24903
24908
  else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
24904
24909
  { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
@@ -24933,10 +24938,18 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
24933
24938
  }
24934
24939
  };
24935
24940
 
24941
+ function isLocalVariableAccess(node) {
24942
+ return (
24943
+ node.type === "Identifier" ||
24944
+ node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
24945
+ )
24946
+ }
24947
+
24936
24948
  function isPrivateFieldAccess(node) {
24937
24949
  return (
24938
24950
  node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
24939
- node.type === "ChainExpression" && isPrivateFieldAccess(node.expression)
24951
+ node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
24952
+ node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
24940
24953
  )
24941
24954
  }
24942
24955
 
@@ -25363,7 +25376,7 @@ pp$5.parseTemplateElement = function(ref) {
25363
25376
  this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
25364
25377
  }
25365
25378
  elem.value = {
25366
- raw: this.value,
25379
+ raw: this.value.replace(/\r\n?/g, "\n"),
25367
25380
  cooked: null
25368
25381
  };
25369
25382
  } else {
@@ -26038,6 +26051,30 @@ for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
26038
26051
 
26039
26052
  var pp$1 = Parser.prototype;
26040
26053
 
26054
+ // Track disjunction structure to determine whether a duplicate
26055
+ // capture group name is allowed because it is in a separate branch.
26056
+ var BranchID = function BranchID(parent, base) {
26057
+ // Parent disjunction branch
26058
+ this.parent = parent;
26059
+ // Identifies this set of sibling branches
26060
+ this.base = base || this;
26061
+ };
26062
+
26063
+ BranchID.prototype.separatedFrom = function separatedFrom (alt) {
26064
+ // A branch is separate from another branch if they or any of
26065
+ // their parents are siblings in a given disjunction
26066
+ for (var self = this; self; self = self.parent) {
26067
+ for (var other = alt; other; other = other.parent) {
26068
+ if (self.base === other.base && self !== other) { return true }
26069
+ }
26070
+ }
26071
+ return false
26072
+ };
26073
+
26074
+ BranchID.prototype.sibling = function sibling () {
26075
+ return new BranchID(this.parent, this.base)
26076
+ };
26077
+
26041
26078
  var RegExpValidationState = function RegExpValidationState(parser) {
26042
26079
  this.parser = parser;
26043
26080
  this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
@@ -26054,8 +26091,9 @@ var RegExpValidationState = function RegExpValidationState(parser) {
26054
26091
  this.lastAssertionIsQuantifiable = false;
26055
26092
  this.numCapturingParens = 0;
26056
26093
  this.maxBackReference = 0;
26057
- this.groupNames = [];
26094
+ this.groupNames = Object.create(null);
26058
26095
  this.backReferenceNames = [];
26096
+ this.branchID = null;
26059
26097
  };
26060
26098
 
26061
26099
  RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
@@ -26187,6 +26225,11 @@ pp$1.validateRegExpFlags = function(state) {
26187
26225
  }
26188
26226
  };
26189
26227
 
26228
+ function hasProp(obj) {
26229
+ for (var _ in obj) { return true }
26230
+ return false
26231
+ }
26232
+
26190
26233
  /**
26191
26234
  * Validate the pattern part of a given RegExpLiteral.
26192
26235
  *
@@ -26201,7 +26244,7 @@ pp$1.validateRegExpPattern = function(state) {
26201
26244
  // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
26202
26245
  // exception if _P_ did not conform to the grammar, if any elements of _P_
26203
26246
  // were not matched by the parse, or if any Early Error conditions exist.
26204
- if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
26247
+ if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
26205
26248
  state.switchN = true;
26206
26249
  this.regexp_pattern(state);
26207
26250
  }
@@ -26215,8 +26258,9 @@ pp$1.regexp_pattern = function(state) {
26215
26258
  state.lastAssertionIsQuantifiable = false;
26216
26259
  state.numCapturingParens = 0;
26217
26260
  state.maxBackReference = 0;
26218
- state.groupNames.length = 0;
26261
+ state.groupNames = Object.create(null);
26219
26262
  state.backReferenceNames.length = 0;
26263
+ state.branchID = null;
26220
26264
 
26221
26265
  this.regexp_disjunction(state);
26222
26266
 
@@ -26235,7 +26279,7 @@ pp$1.regexp_pattern = function(state) {
26235
26279
  for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
26236
26280
  var name = list[i];
26237
26281
 
26238
- if (state.groupNames.indexOf(name) === -1) {
26282
+ if (!state.groupNames[name]) {
26239
26283
  state.raise("Invalid named capture referenced");
26240
26284
  }
26241
26285
  }
@@ -26243,10 +26287,14 @@ pp$1.regexp_pattern = function(state) {
26243
26287
 
26244
26288
  // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
26245
26289
  pp$1.regexp_disjunction = function(state) {
26290
+ var trackDisjunction = this.options.ecmaVersion >= 16;
26291
+ if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
26246
26292
  this.regexp_alternative(state);
26247
26293
  while (state.eat(0x7C /* | */)) {
26294
+ if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
26248
26295
  this.regexp_alternative(state);
26249
26296
  }
26297
+ if (trackDisjunction) { state.branchID = state.branchID.parent; }
26250
26298
 
26251
26299
  // Make the same message as V8.
26252
26300
  if (this.regexp_eatQuantifier(state, true)) {
@@ -26259,8 +26307,7 @@ pp$1.regexp_disjunction = function(state) {
26259
26307
 
26260
26308
  // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
26261
26309
  pp$1.regexp_alternative = function(state) {
26262
- while (state.pos < state.source.length && this.regexp_eatTerm(state))
26263
- { }
26310
+ while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
26264
26311
  };
26265
26312
 
26266
26313
  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
@@ -26498,14 +26545,26 @@ pp$1.regexp_eatExtendedPatternCharacter = function(state) {
26498
26545
  // `?` GroupName
26499
26546
  pp$1.regexp_groupSpecifier = function(state) {
26500
26547
  if (state.eat(0x3F /* ? */)) {
26501
- if (this.regexp_eatGroupName(state)) {
26502
- if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
26548
+ if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
26549
+ var trackDisjunction = this.options.ecmaVersion >= 16;
26550
+ var known = state.groupNames[state.lastStringValue];
26551
+ if (known) {
26552
+ if (trackDisjunction) {
26553
+ for (var i = 0, list = known; i < list.length; i += 1) {
26554
+ var altID = list[i];
26555
+
26556
+ if (!altID.separatedFrom(state.branchID))
26557
+ { state.raise("Duplicate capture group name"); }
26558
+ }
26559
+ } else {
26503
26560
  state.raise("Duplicate capture group name");
26504
26561
  }
26505
- state.groupNames.push(state.lastStringValue);
26506
- return
26507
26562
  }
26508
- state.raise("Invalid group");
26563
+ if (trackDisjunction) {
26564
+ (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
26565
+ } else {
26566
+ state.groupNames[state.lastStringValue] = true;
26567
+ }
26509
26568
  }
26510
26569
  };
26511
26570
 
@@ -28010,15 +28069,18 @@ pp.readInvalidTemplateToken = function() {
28010
28069
  break
28011
28070
 
28012
28071
  case "$":
28013
- if (this.input[this.pos + 1] !== "{") {
28014
- break
28015
- }
28016
-
28017
- // falls through
28072
+ if (this.input[this.pos + 1] !== "{") { break }
28073
+ // fall through
28018
28074
  case "`":
28019
28075
  return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))
28020
28076
 
28021
- // no default
28077
+ case "\r":
28078
+ if (this.input[this.pos + 1] === "\n") { ++this.pos; }
28079
+ // fall through
28080
+ case "\n": case "\u2028": case "\u2029":
28081
+ ++this.curLine;
28082
+ this.lineStart = this.pos + 1;
28083
+ break
28022
28084
  }
28023
28085
  }
28024
28086
  this.raise(this.start, "Unterminated template");
@@ -28081,6 +28143,7 @@ pp.readEscapedChar = function(inTemplate) {
28081
28143
  if (isNewLine(ch)) {
28082
28144
  // Unicode new line characters after \ get removed from output in both
28083
28145
  // template literals and strings
28146
+ if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
28084
28147
  return ""
28085
28148
  }
28086
28149
  return String.fromCharCode(ch)
@@ -28159,7 +28222,7 @@ pp.readWord = function() {
28159
28222
  // [walk]: util/walk.js
28160
28223
 
28161
28224
 
28162
- var version = "8.11.3";
28225
+ var version = "8.12.0";
28163
28226
 
28164
28227
  Parser.acorn = {
28165
28228
  Parser: Parser,