@scriptc/compiler 0.0.13 → 0.0.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.
@@ -226,9 +226,11 @@ const LIB_FN_SYMS = {
226
226
  "text.decode": "scr_text_decode",
227
227
  "zlib.deflateSync": "scr_zlib_deflate",
228
228
  "zlib.inflateSync": "scr_zlib_inflate",
229
- // The CA-store read (tlsca.get/set are may-throw seeds and refuse by
230
- // omission — the C fallback carries them).
229
+ // The CA-store unit. get/set throw (an unknown type name, a
230
+ // certificate-free set) and take the generic path's pending check.
231
231
  "tlsca.root": "scr_tls_ca_root",
232
+ "tlsca.get": "scr_tls_ca_get",
233
+ "tlsca.set": "scr_tls_ca_set_default",
232
234
  "crypto.randomBytes": "scr_crypto_random_bytes",
233
235
  "crypto.randomBytesToString": "scr_crypto_random_string",
234
236
  "crypto.randomUUID": "scr_crypto_random_uuid",
@@ -646,6 +648,7 @@ const USES_TIMERS_LIB_FNS = new Set([
646
648
  "fs.existsChk",
647
649
  "http.createServer", "http.createServerEmpty",
648
650
  "http.request", "http.requestCb", "http.requestUrl", "http.requestUrlCb",
651
+ "https.requestUrl", "https.requestUrlCb",
649
652
  "http.requestConn", "http.requestConnCb",
650
653
  "http.agentNew", "http.requestAgent", "http.requestAgentCb",
651
654
  // The dyn-async slice (emit-exprs.ts's markings): fiber parks, the
@@ -10627,8 +10630,13 @@ class LlEmitter {
10627
10630
  return { name: "", type: e.type };
10628
10631
  }
10629
10632
  if (e.fn === "http.request" || e.fn === "http.requestCb" || e.fn === "http.requestUrl" || e.fn === "http.requestUrlCb" ||
10630
- e.fn === "http.requestAgent" || e.fn === "http.requestAgentCb") {
10631
- const isUrl = e.fn.startsWith("http.requestUrl");
10633
+ e.fn === "http.requestAgent" || e.fn === "http.requestAgentCb" ||
10634
+ e.fn === "https.requestUrl" || e.fn === "https.requestUrlCb") {
10635
+ // The https URL row is the http one with the TLS entry point — same
10636
+ // three arguments, same response-callback adapter. (The https
10637
+ // OPTIONS forms are a separate, wider row and are not here yet.)
10638
+ const isTls = e.fn.startsWith("https.");
10639
+ const isUrl = isTls || e.fn.startsWith("http.requestUrl");
10632
10640
  const isAgent = e.fn.startsWith("http.requestAgent");
10633
10641
  const cbIdx = isUrl ? 3 : isAgent ? 8 : 7;
10634
10642
  const hasCb = e.fn.endsWith("Cb");
@@ -10647,7 +10655,9 @@ class LlEmitter {
10647
10655
  }
10648
10656
  const head = args.slice(0, cbIdx);
10649
10657
  const decls = head.map((a) => (this.llType(a.type) === "i1" ? "i1 zeroext" : this.llType(a.type)));
10650
- const entry = isUrl ? "scr_http_request_url" : isAgent ? "scr_http_request_agent" : "scr_http_request";
10658
+ const entry = isTls ? "scr_https_request_url"
10659
+ : isUrl ? "scr_http_request_url"
10660
+ : isAgent ? "scr_http_request_agent" : "scr_http_request";
10651
10661
  this.declare(`declare ptr @${entry}(${[...decls, "ptr", "ptr"].join(", ")})`);
10652
10662
  const t = B.tmp();
10653
10663
  B.line(`${t} = call ptr @${entry}(${[...head.map((a) => `${this.llType(a.type)} ${a.name}`), `ptr ${cb}`, `ptr ${adapter}`].join(", ")})`);