scratch-paint 3.0.294 → 3.0.295
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 +7 -0
- package/dist/scratch-paint.js +94 -15
- package/dist/scratch-paint.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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
|
+
## [3.0.295](https://github.com/scratchfoundation/scratch-paint/compare/v3.0.294...v3.0.295) (2025-06-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** lock file maintenance ([#3287](https://github.com/scratchfoundation/scratch-paint/issues/3287)) ([0ee07be](https://github.com/scratchfoundation/scratch-paint/commit/0ee07bec7e8a9d4bc0b77e5f2417fca4f6d1ac90))
|
|
12
|
+
|
|
6
13
|
## [3.0.294](https://github.com/scratchfoundation/scratch-paint/compare/v3.0.293...v3.0.294) (2025-06-17)
|
|
7
14
|
|
|
8
15
|
|
package/dist/scratch-paint.js
CHANGED
|
@@ -23119,6 +23119,49 @@ pp$8.isAsyncFunction = function() {
|
|
|
23119
23119
|
!(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))
|
|
23120
23120
|
};
|
|
23121
23121
|
|
|
23122
|
+
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
23123
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using"))
|
|
23124
|
+
{ return false }
|
|
23125
|
+
|
|
23126
|
+
skipWhiteSpace.lastIndex = this.pos;
|
|
23127
|
+
var skip = skipWhiteSpace.exec(this.input);
|
|
23128
|
+
var next = this.pos + skip[0].length;
|
|
23129
|
+
|
|
23130
|
+
if (lineBreak.test(this.input.slice(this.pos, next))) { return false }
|
|
23131
|
+
|
|
23132
|
+
if (isAwaitUsing) {
|
|
23133
|
+
var awaitEndPos = next + 5 /* await */, after;
|
|
23134
|
+
if (this.input.slice(next, awaitEndPos) !== "using" ||
|
|
23135
|
+
awaitEndPos === this.input.length ||
|
|
23136
|
+
isIdentifierChar(after = this.input.charCodeAt(awaitEndPos)) ||
|
|
23137
|
+
(after > 0xd7ff && after < 0xdc00)
|
|
23138
|
+
) { return false }
|
|
23139
|
+
|
|
23140
|
+
skipWhiteSpace.lastIndex = awaitEndPos;
|
|
23141
|
+
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
23142
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(awaitEndPos, awaitEndPos + skipAfterUsing[0].length))) { return false }
|
|
23143
|
+
}
|
|
23144
|
+
|
|
23145
|
+
if (isFor) {
|
|
23146
|
+
var ofEndPos = next + 2 /* of */, after$1;
|
|
23147
|
+
if (this.input.slice(next, ofEndPos) === "of") {
|
|
23148
|
+
if (ofEndPos === this.input.length ||
|
|
23149
|
+
(!isIdentifierChar(after$1 = this.input.charCodeAt(ofEndPos)) && !(after$1 > 0xd7ff && after$1 < 0xdc00))) { return false }
|
|
23150
|
+
}
|
|
23151
|
+
}
|
|
23152
|
+
|
|
23153
|
+
var ch = this.input.charCodeAt(next);
|
|
23154
|
+
return isIdentifierStart(ch, true) || ch === 92 // '\'
|
|
23155
|
+
};
|
|
23156
|
+
|
|
23157
|
+
pp$8.isAwaitUsing = function(isFor) {
|
|
23158
|
+
return this.isUsingKeyword(true, isFor)
|
|
23159
|
+
};
|
|
23160
|
+
|
|
23161
|
+
pp$8.isUsing = function(isFor) {
|
|
23162
|
+
return this.isUsingKeyword(false, isFor)
|
|
23163
|
+
};
|
|
23164
|
+
|
|
23122
23165
|
// Parse a single statement.
|
|
23123
23166
|
//
|
|
23124
23167
|
// If expecting a statement and finding a slash operator, parse a
|
|
@@ -23195,6 +23238,23 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
23195
23238
|
return this.parseFunctionStatement(node, true, !context)
|
|
23196
23239
|
}
|
|
23197
23240
|
|
|
23241
|
+
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
23242
|
+
if (usingKind) {
|
|
23243
|
+
if (topLevel && this.options.sourceType === "script") {
|
|
23244
|
+
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`");
|
|
23245
|
+
}
|
|
23246
|
+
if (usingKind === "await using") {
|
|
23247
|
+
if (!this.canAwait) {
|
|
23248
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
23249
|
+
}
|
|
23250
|
+
this.next();
|
|
23251
|
+
}
|
|
23252
|
+
this.next();
|
|
23253
|
+
this.parseVar(node, false, usingKind);
|
|
23254
|
+
this.semicolon();
|
|
23255
|
+
return this.finishNode(node, "VariableDeclaration")
|
|
23256
|
+
}
|
|
23257
|
+
|
|
23198
23258
|
var maybeName = this.value, expr = this.parseExpression();
|
|
23199
23259
|
if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
|
|
23200
23260
|
{ return this.parseLabeledStatement(node, maybeName, expr, context) }
|
|
@@ -23270,18 +23330,19 @@ pp$8.parseForStatement = function(node) {
|
|
|
23270
23330
|
this.next();
|
|
23271
23331
|
this.parseVar(init$1, true, kind);
|
|
23272
23332
|
this.finishNode(init$1, "VariableDeclaration");
|
|
23273
|
-
|
|
23274
|
-
if (this.options.ecmaVersion >= 9) {
|
|
23275
|
-
if (this.type === types$1._in) {
|
|
23276
|
-
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
23277
|
-
} else { node.await = awaitAt > -1; }
|
|
23278
|
-
}
|
|
23279
|
-
return this.parseForIn(node, init$1)
|
|
23280
|
-
}
|
|
23281
|
-
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
23282
|
-
return this.parseFor(node, init$1)
|
|
23333
|
+
return this.parseForAfterInit(node, init$1, awaitAt)
|
|
23283
23334
|
}
|
|
23284
23335
|
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
23336
|
+
|
|
23337
|
+
var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
|
|
23338
|
+
if (usingKind) {
|
|
23339
|
+
var init$2 = this.startNode();
|
|
23340
|
+
this.next();
|
|
23341
|
+
if (usingKind === "await using") { this.next(); }
|
|
23342
|
+
this.parseVar(init$2, true, usingKind);
|
|
23343
|
+
this.finishNode(init$2, "VariableDeclaration");
|
|
23344
|
+
return this.parseForAfterInit(node, init$2, awaitAt)
|
|
23345
|
+
}
|
|
23285
23346
|
var containsEsc = this.containsEsc;
|
|
23286
23347
|
var refDestructuringErrors = new DestructuringErrors;
|
|
23287
23348
|
var initPos = this.start;
|
|
@@ -23307,6 +23368,20 @@ pp$8.parseForStatement = function(node) {
|
|
|
23307
23368
|
return this.parseFor(node, init)
|
|
23308
23369
|
};
|
|
23309
23370
|
|
|
23371
|
+
// Helper method to parse for loop after variable initialization
|
|
23372
|
+
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
23373
|
+
if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) {
|
|
23374
|
+
if (this.options.ecmaVersion >= 9) {
|
|
23375
|
+
if (this.type === types$1._in) {
|
|
23376
|
+
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
23377
|
+
} else { node.await = awaitAt > -1; }
|
|
23378
|
+
}
|
|
23379
|
+
return this.parseForIn(node, init)
|
|
23380
|
+
}
|
|
23381
|
+
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
23382
|
+
return this.parseFor(node, init)
|
|
23383
|
+
};
|
|
23384
|
+
|
|
23310
23385
|
pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
|
|
23311
23386
|
this.next();
|
|
23312
23387
|
return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
|
|
@@ -23563,6 +23638,8 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
23563
23638
|
decl.init = this.parseMaybeAssign(isFor);
|
|
23564
23639
|
} else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
|
|
23565
23640
|
this.unexpected();
|
|
23641
|
+
} else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) {
|
|
23642
|
+
this.raise(this.lastTokEnd, ("Missing initializer in " + kind + " declaration"));
|
|
23566
23643
|
} else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
|
|
23567
23644
|
this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
|
|
23568
23645
|
} else {
|
|
@@ -23575,7 +23652,10 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
23575
23652
|
};
|
|
23576
23653
|
|
|
23577
23654
|
pp$8.parseVarId = function(decl, kind) {
|
|
23578
|
-
decl.id =
|
|
23655
|
+
decl.id = kind === "using" || kind === "await using"
|
|
23656
|
+
? this.parseIdent()
|
|
23657
|
+
: this.parseBindingAtom();
|
|
23658
|
+
|
|
23579
23659
|
this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
|
|
23580
23660
|
};
|
|
23581
23661
|
|
|
@@ -25306,7 +25386,8 @@ pp$5.parseLiteral = function(value) {
|
|
|
25306
25386
|
var node = this.startNode();
|
|
25307
25387
|
node.value = value;
|
|
25308
25388
|
node.raw = this.input.slice(this.start, this.end);
|
|
25309
|
-
if (node.raw.charCodeAt(node.raw.length - 1) === 110)
|
|
25389
|
+
if (node.raw.charCodeAt(node.raw.length - 1) === 110)
|
|
25390
|
+
{ node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, ""); }
|
|
25310
25391
|
this.next();
|
|
25311
25392
|
return this.finishNode(node, "Literal")
|
|
25312
25393
|
};
|
|
@@ -28336,11 +28417,9 @@ pp.readWord = function() {
|
|
|
28336
28417
|
// Please use the [github bug tracker][ghbt] to report issues.
|
|
28337
28418
|
//
|
|
28338
28419
|
// [ghbt]: https://github.com/acornjs/acorn/issues
|
|
28339
|
-
//
|
|
28340
|
-
// [walk]: util/walk.js
|
|
28341
28420
|
|
|
28342
28421
|
|
|
28343
|
-
var version = "8.
|
|
28422
|
+
var version = "8.15.0";
|
|
28344
28423
|
|
|
28345
28424
|
Parser.acorn = {
|
|
28346
28425
|
Parser: Parser,
|