fix large numbers

Forwarded: not-needed
Last-Update: 2020-05-19

Gbp-Pq: Name fix-large-numbers.diff
This commit is contained in:
Xavier Guimard 2022-05-19 14:59:04 +08:00 committed by openKylinBot
parent 6a863e4817
commit fb3ae96bd2
3 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ import File from "./file/file";
import parser from "../parser"; import parser from "../parser";
const debug = buildDebug("babel:transform:file"); const debug = buildDebug("babel:transform:file");
const LARGE_INPUT_SOURCEMAP_THRESHOLD = 1_000_000; const LARGE_INPUT_SOURCEMAP_THRESHOLD = 1000000;
export type NormalizedFile = { export type NormalizedFile = {
code: string, code: string,

View File

@ -79,7 +79,7 @@ function normalizeOptions(code, opts): Format {
} }
if (format.compact === "auto") { if (format.compact === "auto") {
format.compact = code.length > 500_000; // 500KB format.compact = code.length > 500000; // 500KB
if (format.compact) { if (format.compact) {
console.error( console.error(

View File

@ -117,7 +117,7 @@ export default class TraversalContext {
// this path no longer belongs to the tree // this path no longer belongs to the tree
if (path.key === null) continue; if (path.key === null) continue;
if (testing && queue.length >= 10_000) { if (testing && queue.length >= 10000) {
this.trap = true; this.trap = true;
} }