lilact 0.26.12 → 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.
@@ -3656,11 +3656,10 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, { isInline, i
3656
3656
  globalThis.createComponent = lilact_default.createComponent;
3657
3657
  globalThis.Fragment = lilact_default.Fragment;
3658
3658
  const res = eval(processed);
3659
- console.log(path, isModule, module.exports);
3660
3659
  if (!isEmpty(module.exports)) return module.exports;
3661
3660
  return res;
3662
3661
  } catch (e) {
3663
- e = lilact_default.traceError(e);
3662
+ e = lilact_default.traceError(e, path);
3664
3663
  throw e;
3665
3664
  }
3666
3665
  }
@@ -4510,14 +4509,14 @@ function scanBlockLabels(code2, path2) {
4510
4509
  }
4511
4510
  );
4512
4511
  }
4513
- function traceError(error2) {
4512
+ function traceError(error2, run_path) {
4514
4513
  var _a;
4515
4514
  if (error2 == null ? void 0 : error2.is_traced) {
4516
4515
  return error2;
4517
4516
  }
4518
4517
  const loc = parseEvalLocationFromStack(error2.stack);
4519
4518
  const obj = {
4520
- 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,
4521
4520
  lineNumber: loc.line,
4522
4521
  columnNumber: loc.col,
4523
4522
  message: error2.message,
@@ -4534,27 +4533,30 @@ function traceError(error2) {
4534
4533
  const mloc = mapLocation(mps, obj.lineNumber - 1, obj.columnNumber - 1);
4535
4534
  obj.lineNumber = mloc.line;
4536
4535
  obj.columnNumber = mloc.col;
4537
- } else if (error2.lilact_trace !== void 0) {
4536
+ } else {
4538
4537
  let loc2 = getErrorLocation(error2);
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
- obj.lineNumber = loc2.line;
4552
- 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
+ }
4553
4552
  }
4553
+ obj.lineNumber = loc2.line;
4554
+ obj.columnNumber = loc2.col;
4554
4555
  }
4555
4556
  } else {
4556
4557
  const loc2 = getErrorLocation(error2);
4557
4558
  if (error2.fileName) obj.fileName = error2.fileName;
4559
+ else if (run_path) obj.fileName = run_path;
4558
4560
  obj.lineNumber = loc2.line;
4559
4561
  obj.columnNumber = loc2.col;
4560
4562
  }
@@ -6476,9 +6478,11 @@ function transpileJSX(jsx2, {
6476
6478
  (_b = transpilerConfig.injectTraceLabels) != null ? _b : transpilerConfig.injectTraceLabels = injectTraceLabels;
6477
6479
  const eols = scanEOLs(jsx2);
6478
6480
  raiseError = ((eols2, msg, index2) => {
6481
+ const rc = getRowCol(eols2, index2);
6479
6482
  const er = new Error(msg);
6483
+ console.error(`JSXParserError: ${msg} [file ${path2} at line ${rc[0] + 1}]`);
6484
+ [er.lineNumber, er.columnNumber] = rc;
6480
6485
  er.name = "JSXParseError";
6481
- [er.lineNumber, er.columnNumber] = getRowCol(eols2, index2);
6482
6486
  er.fileName = path2;
6483
6487
  er.lilact_trace = "parse";
6484
6488
  throw er;