lilact 0.31.13 → 0.31.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.
@@ -6081,12 +6081,13 @@ function processImportExports(node3, jsx2, meta) {
6081
6081
  continue;
6082
6082
  }
6083
6083
  case "F": {
6084
- const tp = node3.out[i2];
6085
- node3.out[i2] = null;
6086
6084
  i2++;
6087
- skip_spaces();
6085
+ while (s[i2] === " " || s[i2] === "\n" || s[i2] === "C") {
6086
+ i2++;
6087
+ }
6088
6088
  const name = node3.out[i2];
6089
- node3.out[m.index].cjs = `module.exports.${name} = ${tp} `;
6089
+ node3.out[m.index].cjs = "";
6090
+ node3.out[m.index].appendix_js = `module.exports.${name} = ${name};`;
6090
6091
  continue;
6091
6092
  }
6092
6093
  case "*":
@@ -6964,6 +6965,7 @@ function transpileJSX(jsx2, {
6964
6965
  prepare(json);
6965
6966
  preprocessPragmas(json);
6966
6967
  const flattened_nodes = [];
6968
+ let appendix_js = "\n";
6967
6969
  const codify = (outlen, node3, is_attr = false, is_xml = false) => {
6968
6970
  flattened_nodes.push(node3);
6969
6971
  if (typeof node3 !== "object") return node3;
@@ -6971,7 +6973,10 @@ function transpileJSX(jsx2, {
6971
6973
  node3.out_index = outlen;
6972
6974
  if (node3.type === "string") return jsx2.substring(node3.begin, node3.end);
6973
6975
  if (node3.type === "import") return node3.cjs;
6974
- if (node3.type === "export") return node3.cjs;
6976
+ if (node3.type === "export") {
6977
+ if (node3.appendix_js) appendix_js += node3.appendix_js;
6978
+ return node3.cjs;
6979
+ }
6975
6980
  if (node3.type === "regex") return jsx2.substring(node3.begin, node3.end);
6976
6981
  if (node3.type === "comment") return discardComments || is_attr ? "" : jsx2.substring(node3.begin, node3.end);
6977
6982
  if (node3.type === "directive") return node3.value;
@@ -7044,6 +7049,7 @@ function transpileJSX(jsx2, {
7044
7049
  out = `/*LILACTBLOCK${++blocksInfo2.counter}:0,0:<EXEC>*/try{`;
7045
7050
  }
7046
7051
  out += codify(out.length, json);
7052
+ out += appendix_js.length > 1 ? appendix_js : "";
7047
7053
  if (injectTraceLabels) {
7048
7054
  if (transpilerConfig.enableLabelStack) {
7049
7055
  out += `}catch(e){ if(typeof(e)!=='object') e=new Error(e);e.lilact_trace=[${blocksInfo2.counter},e.lilact_trace];throw e}`;