@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.
- package/ambient/scriptc-node-fallback.d.ts +21 -4
- package/dist/backend/emission/emit-exprs.js +8 -4
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/llvm/emitter.js +15 -5
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-server.js +27 -11
- package/dist/frontend/lowering/lower-server.js.map +1 -1
- package/dist/ir/nodes.d.ts +4 -0
- package/dist/ir/nodes.js +4 -0
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/validate.js +5 -2
- package/dist/ir/validate.js.map +1 -1
- package/package.json +2 -2
- package/surface-manifest.json +1 -1
|
@@ -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
|
|
230
|
-
//
|
|
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
|
-
|
|
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 =
|
|
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(", ")})`);
|