@poe-platform/safe-js 0.1.489 → 0.1.490

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-3IBFK7UI.js";
30
+ } from "./chunk-TEVQUSEL.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-Y2KLKO2Y.js.map
8252
+ //# sourceMappingURL=chunk-MLSCJH5R.js.map
@@ -1390,6 +1390,23 @@ var Lexer = class {
1390
1390
  return this.source.slice(start.offset, this.index);
1391
1391
  }
1392
1392
  if (isDecimalDigit(prefix)) {
1393
+ if (this.options.allowLegacyNumbers) {
1394
+ let octal = true;
1395
+ while (isDecimalDigit(this.currentChar())) {
1396
+ if (!isOctalDigit(this.currentChar())) octal = false;
1397
+ this.advance();
1398
+ }
1399
+ if (!octal) {
1400
+ if (this.currentChar() === ".") {
1401
+ this.advance();
1402
+ this.consumeOptionalDecimalDigits();
1403
+ }
1404
+ this.consumeExponent();
1405
+ }
1406
+ this.rejectBigIntSuffix();
1407
+ this.rejectInvalidNumericLiteralContinuation();
1408
+ return this.source.slice(start.offset, this.index);
1409
+ }
1393
1410
  this.advance();
1394
1411
  this.syntaxError("Legacy octal numeric literals are not supported in strict mode", start);
1395
1412
  }
@@ -5987,7 +6004,10 @@ var Parser = class {
5987
6004
  }
5988
6005
  }
5989
6006
  currentToken() {
5990
- return this.tokens[this.index] ?? this.tokens[this.tokens.length - 1];
6007
+ const token = this.tokens[this.index] ?? this.tokens[this.tokens.length - 1];
6008
+ if (this.lexicalContext.grammar?.strict !== false && token.type === "numeric" && token.value[0] === "0" && isDecimalDigit3(token.value[1] ?? ""))
6009
+ throw new Error("Legacy numeric literals are not supported in strict mode.");
6010
+ return token;
5991
6011
  }
5992
6012
  peekToken(offset) {
5993
6013
  return this.tokens[this.index + offset] ?? this.tokens[this.tokens.length - 1];
@@ -6227,7 +6247,7 @@ function createNumericLiteral(token) {
6227
6247
  return {
6228
6248
  type: "NumericLiteral",
6229
6249
  raw: token.value,
6230
- value: Number(token.value.replaceAll("_", "")),
6250
+ value: token.value.length > 1 && token.value[0] === "0" && [...token.value].every(isOctalDigit2) ? Number.parseInt(token.value, 8) : Number(token.value.replaceAll("_", "")),
6231
6251
  span: createTokenSpan(token)
6232
6252
  };
6233
6253
  }
@@ -6702,7 +6722,11 @@ function decodeHexEscape(value, start) {
6702
6722
  };
6703
6723
  }
6704
6724
  function parseEmbeddedExpression(source, base, functionContext, lexicalContext, fullSource, compilation) {
6705
- const tokens = tokenize(source, { allowRegexLiterals: true, compilation }).map((token) => ({
6725
+ const tokens = tokenize(source, {
6726
+ allowRegexLiterals: true,
6727
+ allowLegacyNumbers: lexicalContext.grammar?.strict === false,
6728
+ compilation
6729
+ }).map((token) => ({
6706
6730
  ...token,
6707
6731
  start: rebasePosition(token.start, base),
6708
6732
  end: rebasePosition(token.end, base)
@@ -57278,4 +57302,4 @@ authorization of the copyright holder.
57278
57302
  SPDX-License-Identifier: Unicode-3.0
57279
57303
 
57280
57304
  */
57281
- //# sourceMappingURL=chunk-3IBFK7UI.js.map
57305
+ //# sourceMappingURL=chunk-TEVQUSEL.js.map