@scriptc/compiler 0.0.3 → 0.0.5
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 +145 -9
- package/dist/backend/cc.d.ts +23 -0
- package/dist/backend/cc.js +89 -0
- package/dist/backend/cc.js.map +1 -1
- package/dist/backend/emission/emit-async.js +2 -2
- package/dist/backend/emission/emit-async.js.map +1 -1
- package/dist/backend/emission/emit-exprs.js +37 -2
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/emission/emit-shapes.js +3 -2
- package/dist/backend/emission/emit-shapes.js.map +1 -1
- package/dist/backend/emission/emit-walkers.js +7 -8
- package/dist/backend/emission/emit-walkers.js.map +1 -1
- package/dist/backend/emission/emitter.d.ts +1 -0
- package/dist/backend/emission/emitter.js +123 -3
- package/dist/backend/emission/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.js +198 -15
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/shapes.js +1 -0
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +25 -0
- package/dist/diagnostics/diagnostic.js +88 -2
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/frontend/lib-exports.d.ts +16 -0
- package/dist/frontend/lib-exports.js +35 -0
- package/dist/frontend/lib-exports.js.map +1 -0
- package/dist/frontend/lowering/lib-boundary.js +76 -6
- package/dist/frontend/lowering/lib-boundary.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +37 -4
- package/dist/frontend/lowering/lower-builtins.js +240 -6
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.js +124 -34
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +34 -2
- package/dist/frontend/lowering/lower-classes.js +257 -34
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.js +25 -3
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +10 -0
- package/dist/frontend/lowering/lower-exprs.js +411 -10
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.d.ts +16 -1
- package/dist/frontend/lowering/lower-inspect.js +132 -5
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-island.js +25 -4
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-mixins.js +4 -2
- package/dist/frontend/lowering/lower-mixins.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.d.ts +6 -5
- package/dist/frontend/lowering/lower-modules.js +56 -18
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +163 -0
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +72 -2
- package/dist/frontend/lowering/lowerer.js +339 -19
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +9 -2
- package/dist/frontend/lowering/surfaces.js +44 -7
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/npm-static-rewrite.d.ts +3 -0
- package/dist/frontend/npm-static-rewrite.js +677 -0
- package/dist/frontend/npm-static-rewrite.js.map +1 -0
- package/dist/frontend/npm-static.d.ts +8 -1
- package/dist/frontend/npm-static.js +159 -18
- package/dist/frontend/npm-static.js.map +1 -1
- package/dist/frontend/npm.js +2 -2
- package/dist/frontend/npm.js.map +1 -1
- package/dist/frontend/program.d.ts +6 -0
- package/dist/frontend/program.js +110 -22
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/resolve.js +120 -5
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/shared.d.ts +8 -2
- package/dist/frontend/shared.js +22 -6
- package/dist/frontend/shared.js.map +1 -1
- package/dist/frontend/ts7/checker.js +1 -1
- package/dist/frontend/ts7/checker.js.map +1 -1
- package/dist/frontend/types.d.ts +25 -1
- package/dist/frontend/types.js +121 -7
- package/dist/frontend/types.js.map +1 -1
- package/dist/index.d.ts +22 -0
- package/dist/index.js +256 -17
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +86 -1
- package/dist/ir/nodes.js +183 -0
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/validate.js +89 -6
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/profile.d.ts +52 -0
- package/dist/library/profile.js +232 -0
- package/dist/library/profile.js.map +1 -0
- package/package.json +2 -2
- package/surface-manifest.json +67 -2
|
@@ -362,10 +362,25 @@ export function lowerArrayHofCall(L, call, access, method, elem) {
|
|
|
362
362
|
const { fnArg, arity } = hofCallbackArg(L, argNode, [elem], arrayOf(elem));
|
|
363
363
|
const fnRet = fnArg.type.ret;
|
|
364
364
|
if (method === "map" && (fnRet.kind === "void" || fnRet.kind === "func")) {
|
|
365
|
-
// The result array U[] is unrepresentable (no void elements;
|
|
366
|
-
//
|
|
365
|
+
// The result array U[] is unrepresentable here (no void elements;
|
|
366
|
+
// the map helper's closure-returning form has no fixture-backed
|
|
367
|
+
// story yet).
|
|
367
368
|
L.badType(call, L.typeOf(call));
|
|
368
369
|
}
|
|
370
|
+
if (method === "map" &&
|
|
371
|
+
(fnRet.kind === "map" || fnRet.kind === "set" || fnRet.kind === "url" ||
|
|
372
|
+
fnRet.kind === "searchParams" || fnRet.kind === "generator" || fnRet.kind === "caught" ||
|
|
373
|
+
fnRet.kind === "stats" || fnRet.kind === "spawnRes" || fnRet.kind === "netSocket" ||
|
|
374
|
+
fnRet.kind === "dgramSocket" || fnRet.kind === "testCtx" || fnRet.kind === "httpReq" ||
|
|
375
|
+
fnRet.kind === "httpRes" || fnRet.kind === "httpClientReq" || fnRet.kind === "secureCtx" ||
|
|
376
|
+
fnRet.kind === "fsWatcher" || fnRet.kind === "childStream" || fnRet.kind === "procStream" ||
|
|
377
|
+
isUnitType(fnRet))) {
|
|
378
|
+
// The result would be an array of an element kind ScrArr has no
|
|
379
|
+
// home for (mapTypeOf's own array exclusions) — the callback return
|
|
380
|
+
// type bypasses that gate, so it is enforced here: a named fence,
|
|
381
|
+
// never a mistyped array into the backends.
|
|
382
|
+
L.unsupported("SC1090", call, `'.map()' with a callback returning '${L.fmt(fnRet)}' values (arrays of this element kind have no representation — store the values individually)`);
|
|
383
|
+
}
|
|
369
384
|
if (method === "map" && fnRet.kind === "dyn") {
|
|
370
385
|
// A checked-dynamic callback return would make the result a
|
|
371
386
|
// dyn-element STATIC array, which has no backend representation
|
|
@@ -4781,7 +4796,14 @@ export function objectIterOverIndexShape(L, node, member, argIr, shape, receiver
|
|
|
4781
4796
|
const otherTag = L.armTag(valueT.unionId, others[0]);
|
|
4782
4797
|
const narrowTag = L.armTag(f.type.unionId, others[0]);
|
|
4783
4798
|
if (otherTag >= 0 && narrowTag >= 0) {
|
|
4784
|
-
const
|
|
4799
|
+
const other = others[0];
|
|
4800
|
+
// A UNIT other arm pushes the unit LITERAL (undefined
|
|
4801
|
+
// was filtered above, so the unit is null; units carry
|
|
4802
|
+
// no payload and narrowing to a unit arm is malformed
|
|
4803
|
+
// IR) — the fixed-shape helper's rule exactly.
|
|
4804
|
+
const narrowed = isUnitType(other)
|
|
4805
|
+
? { kind: "unitLit", unit: "null", type: other, loc }
|
|
4806
|
+
: { kind: "unionNarrow", unionId: f.type.unionId, tag: narrowTag, value: raw, type: other, loc };
|
|
4785
4807
|
return { kind: "unionWrap", unionId: valueT.unionId, tag: otherTag, value: narrowed, type: valueT, loc };
|
|
4786
4808
|
}
|
|
4787
4809
|
}
|