@scriptc/compiler 0.0.6 → 0.0.8
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/dist/backend/emission/emit-exprs.js +47 -1
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/emission/emit-island.js +9 -1
- package/dist/backend/emission/emit-island.js.map +1 -1
- package/dist/backend/emission/emit-stmts.js +3 -1
- package/dist/backend/emission/emit-stmts.js.map +1 -1
- package/dist/backend/emission/emit-walkers.js +22 -8
- package/dist/backend/emission/emit-walkers.js.map +1 -1
- package/dist/backend/emission/emitter.js +12 -1
- package/dist/backend/emission/emitter.js.map +1 -1
- package/dist/backend/emission/may-throw.js +4 -3
- package/dist/backend/emission/may-throw.js.map +1 -1
- package/dist/backend/llvm/emitter.js +105 -9
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +49 -1
- package/dist/diagnostics/diagnostic.js +119 -5
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/frontend/lib-contract.d.ts +114 -0
- package/dist/frontend/lib-contract.js +372 -0
- package/dist/frontend/lib-contract.js.map +1 -0
- package/dist/frontend/lowering/lower-builtins.js +16 -1
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +47 -7
- package/dist/frontend/lowering/lower-calls.js +560 -36
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +14 -1
- package/dist/frontend/lowering/lower-classes.js +85 -15
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.js +43 -1
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-emitter.js +1 -1
- package/dist/frontend/lowering/lower-emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +26 -3
- package/dist/frontend/lowering/lower-exprs.js +474 -44
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-island.d.ts +7 -0
- package/dist/frontend/lowering/lower-island.js +71 -10
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-mixins.d.ts +1 -1
- package/dist/frontend/lowering/lower-mixins.js +1 -1
- package/dist/frontend/lowering/lower-modules.js +95 -4
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +430 -44
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +19 -3
- package/dist/frontend/lowering/lowerer.js +188 -11
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/types.d.ts +28 -1
- package/dist/frontend/types.js +300 -8
- package/dist/frontend/types.js.map +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +96 -7
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +48 -2
- package/dist/ir/nodes.js +103 -3
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/validate.js +35 -6
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/profile.d.ts +53 -3
- package/dist/library/profile.js +143 -12
- package/dist/library/profile.js.map +1 -1
- package/dist/library/sidecar-validate.d.ts +4 -0
- package/dist/library/sidecar-validate.js +506 -0
- package/dist/library/sidecar-validate.js.map +1 -0
- package/dist/library/sidecar.d.ts +191 -0
- package/dist/library/sidecar.js +687 -0
- package/dist/library/sidecar.js.map +1 -0
- package/dist/library/trap-teaching.d.ts +11 -0
- package/dist/library/trap-teaching.js +49 -0
- package/dist/library/trap-teaching.js.map +1 -0
- package/dist/library/wyhash.d.ts +12 -0
- package/dist/library/wyhash.js +116 -0
- package/dist/library/wyhash.js.map +1 -0
- package/package.json +2 -2
- package/surface-manifest.json +37 -2
|
@@ -49,7 +49,7 @@ export function lowerArrayMethodCall(L, call, access) {
|
|
|
49
49
|
return null;
|
|
50
50
|
if (!probedUntyped && !L.isStdlibMember(access))
|
|
51
51
|
return null;
|
|
52
|
-
|
|
52
|
+
let elem = receiverIr.elem;
|
|
53
53
|
const loc = locOf(call);
|
|
54
54
|
// An island handle behind an array-typed .d.ts surface
|
|
55
55
|
// (`parts().join("-")` — arrays never exit eagerly, so the value
|
|
@@ -91,6 +91,19 @@ export function lowerArrayMethodCall(L, call, access) {
|
|
|
91
91
|
}
|
|
92
92
|
L.noLowering(`.${name} on an array value held in a checked-dynamic binding`, call, "assign it to an array-typed binding first (the validated extraction), then call the method");
|
|
93
93
|
}
|
|
94
|
+
// An evolving-`any` array binding under --dynamic whose flow type
|
|
95
|
+
// EVOLVED past `any[]` (`const fns = []; fns.push(() => 1);
|
|
96
|
+
// fns.map(...)` — the binding lowered array<jsval> at its `any[]`
|
|
97
|
+
// declaration, while tsc's evolving-array analysis answers the
|
|
98
|
+
// pushed element type at this site): the VALUE's element type is
|
|
99
|
+
// the truth — ride the explicit-`any[]` handle-element lowering
|
|
100
|
+
// (pushes marshal in, HOF callbacks bind the handle, results exit
|
|
101
|
+
// per the checker type), never a typed intrinsic over a jsval-
|
|
102
|
+
// element array (the validator ICE).
|
|
103
|
+
if (receiver.type.kind === "array" && receiver.type.elem.kind === "jsval" && !typeEquals(receiverIr, receiver.type)) {
|
|
104
|
+
receiverIr = receiver.type;
|
|
105
|
+
elem = receiver.type.elem;
|
|
106
|
+
}
|
|
94
107
|
}
|
|
95
108
|
if (name === "sort")
|
|
96
109
|
return lowerArraySortCall(L, call, access, elem, receiverIr);
|
|
@@ -214,6 +227,20 @@ export function lowerArrayMethodCall(L, call, access) {
|
|
|
214
227
|
args.push(arg);
|
|
215
228
|
continue;
|
|
216
229
|
}
|
|
230
|
+
// A handle-element receiver given an argument whose CHECKER type
|
|
231
|
+
// spells evolved elements while its VALUE is a jsval-element
|
|
232
|
+
// array (`fns.concat(tail)` — both sides of the evolving-`any`
|
|
233
|
+
// adoption): the value's array-ness decides, exactly JS's
|
|
234
|
+
// IsArray — spread it. Non-array values fall through to the
|
|
235
|
+
// element push (the jsvalIn coercion).
|
|
236
|
+
if (elem.kind === "jsval") {
|
|
237
|
+
const arg = L.lowerExpr(argNode);
|
|
238
|
+
if (arg.type.kind === "array" && arg.type.elem.kind === "jsval") {
|
|
239
|
+
shape.push("a");
|
|
240
|
+
args.push(arg);
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
217
244
|
// An element value — union elements wrap exactly like a push.
|
|
218
245
|
shape.push("e");
|
|
219
246
|
args.push(L.lowerExprExpecting(argNode, elem));
|
|
@@ -324,6 +351,21 @@ function hofCallbackArg(L, argNode, lead, arrT) {
|
|
|
324
351
|
}
|
|
325
352
|
}
|
|
326
353
|
}
|
|
354
|
+
// A JSVAL-element receiver behind an EVOLVED contextual type (the
|
|
355
|
+
// evolving-`any` array under --dynamic — lowerArrayMethodCall adopted
|
|
356
|
+
// the value's handle element while tsc's evolving analysis types the
|
|
357
|
+
// callback's params by the pushed elements): the lead params BIND the
|
|
358
|
+
// handles the loop passes, whatever the contextual type spelled —
|
|
359
|
+
// paramShape's island-handle early-out, the then-handler rule.
|
|
360
|
+
if (ts.isArrowFunction(argNode) || ts.isFunctionExpression(argNode)) {
|
|
361
|
+
argNode.parameters.forEach((p, i) => {
|
|
362
|
+
if (i >= lead.length || lead[i].kind !== "jsval")
|
|
363
|
+
return;
|
|
364
|
+
if (!ts.isIdentifier(p.name) || p.type || p.initializer || p.dotDotDotToken)
|
|
365
|
+
return;
|
|
366
|
+
L.jsvalParamOverrides.add(p);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
327
369
|
let fnArg;
|
|
328
370
|
try {
|
|
329
371
|
fnArg = L.lowerExpr(argNode);
|