lilact 0.26.13 → 0.26.14

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.
@@ -3659,7 +3659,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, { isInline, i
3659
3659
  if (!isEmpty(module.exports)) return module.exports;
3660
3660
  return res;
3661
3661
  } catch (e) {
3662
- e = lilact_default.traceError(e);
3662
+ e = lilact_default.traceError(e, path);
3663
3663
  throw e;
3664
3664
  }
3665
3665
  }
@@ -4509,14 +4509,14 @@ function scanBlockLabels(code2, path2) {
4509
4509
  }
4510
4510
  );
4511
4511
  }
4512
- function traceError(error2) {
4512
+ function traceError(error2, run_path) {
4513
4513
  var _a;
4514
4514
  if (error2 == null ? void 0 : error2.is_traced) {
4515
4515
  return error2;
4516
4516
  }
4517
4517
  const loc = parseEvalLocationFromStack(error2.stack);
4518
4518
  const obj = {
4519
- fileName: ((_a = loc.url) == null ? void 0 : _a.slice(6)) || error2.fileName,
4519
+ fileName: ((_a = loc.url) == null ? void 0 : _a.slice(6)) || run_path || error2.fileName,
4520
4520
  lineNumber: loc.line,
4521
4521
  columnNumber: loc.col,
4522
4522
  message: error2.message,
@@ -4533,27 +4533,30 @@ function traceError(error2) {
4533
4533
  const mloc = mapLocation(mps, obj.lineNumber - 1, obj.columnNumber - 1);
4534
4534
  obj.lineNumber = mloc.line;
4535
4535
  obj.columnNumber = mloc.col;
4536
- } else if (error2.lilact_trace !== void 0) {
4536
+ } else {
4537
4537
  let loc2 = getErrorLocation(error2);
4538
- let mps2;
4539
- let blk;
4540
- if (typeof error2.lilact_trace === "object") {
4541
- blk = lilact_default.blocks_info.labels[error2.lilact_trace[0]];
4542
- } else {
4543
- blk = lilact_default.blocks_info.labels[error2.lilact_trace];
4544
- }
4545
- if (blk) {
4546
- obj.fileName = blk.path;
4547
- obj.label = blk.label;
4548
- mps2 = required_scripts[blk.path].mappings;
4549
- loc2 = mapLocation(mps2, loc2.line - 1, loc2.col - 1);
4550
- obj.lineNumber = loc2.line;
4551
- obj.columnNumber = loc2.col;
4538
+ if (error2.lilact_trace !== void 0) {
4539
+ let mps2;
4540
+ let blk;
4541
+ if (typeof error2.lilact_trace === "object") {
4542
+ blk = lilact_default.blocks_info.labels[error2.lilact_trace[0]];
4543
+ } else {
4544
+ blk = lilact_default.blocks_info.labels[error2.lilact_trace];
4545
+ }
4546
+ if (blk) {
4547
+ obj.fileName = blk.path;
4548
+ obj.label = blk.label;
4549
+ mps2 = required_scripts[blk.path].mappings;
4550
+ loc2 = mapLocation(mps2, loc2.line - 1, loc2.col - 1);
4551
+ }
4552
4552
  }
4553
+ obj.lineNumber = loc2.line;
4554
+ obj.columnNumber = loc2.col;
4553
4555
  }
4554
4556
  } else {
4555
4557
  const loc2 = getErrorLocation(error2);
4556
4558
  if (error2.fileName) obj.fileName = error2.fileName;
4559
+ else if (run_path) obj.fileName = run_path;
4557
4560
  obj.lineNumber = loc2.line;
4558
4561
  obj.columnNumber = loc2.col;
4559
4562
  }
@@ -6475,9 +6478,11 @@ function transpileJSX(jsx2, {
6475
6478
  (_b = transpilerConfig.injectTraceLabels) != null ? _b : transpilerConfig.injectTraceLabels = injectTraceLabels;
6476
6479
  const eols = scanEOLs(jsx2);
6477
6480
  raiseError = ((eols2, msg, index2) => {
6481
+ const rc = getRowCol(eols2, index2);
6478
6482
  const er = new Error(msg);
6483
+ console.error(`JSXParserError: ${msg} [file ${path2} at line ${rc[0] + 1}]`);
6484
+ [er.lineNumber, er.columnNumber] = rc;
6479
6485
  er.name = "JSXParseError";
6480
- [er.lineNumber, er.columnNumber] = getRowCol(eols2, index2);
6481
6486
  er.fileName = path2;
6482
6487
  er.lilact_trace = "parse";
6483
6488
  throw er;