@scriptc/compiler 0.0.5 → 0.0.7
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 +25 -2
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/emission/emit-walkers.js +47 -0
- package/dist/backend/emission/emit-walkers.js.map +1 -1
- package/dist/backend/emission/emitter.js +7 -0
- package/dist/backend/emission/emitter.js.map +1 -1
- package/dist/backend/emission/may-throw.js +12 -0
- package/dist/backend/emission/may-throw.js.map +1 -1
- package/dist/backend/llvm/dyn.js +23 -1
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.js +28 -4
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/walkers.d.ts +5 -0
- package/dist/backend/llvm/walkers.js +65 -5
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +6 -0
- package/dist/diagnostics/diagnostic.js +16 -0
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/frontend/lib-contract.d.ts +96 -0
- package/dist/frontend/lib-contract.js +291 -0
- package/dist/frontend/lib-contract.js.map +1 -0
- package/dist/frontend/lowering/lower-assert.js +41 -1
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +19 -4
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.d.ts +7 -0
- package/dist/frontend/lowering/lower-inspect.js +130 -28
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +9 -1
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +1 -1
- package/dist/frontend/lowering/lowerer.js +16 -6
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/types.d.ts +68 -6
- package/dist/frontend/types.js +285 -57
- package/dist/frontend/types.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +60 -1
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +27 -4
- package/dist/ir/nodes.js +105 -13
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/validate.js +10 -0
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/profile.d.ts +36 -0
- package/dist/library/profile.js +105 -3
- 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 +568 -0
- package/dist/library/sidecar.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 +1 -1
|
@@ -1216,7 +1216,7 @@ export declare class Lowerer {
|
|
|
1216
1216
|
* which have no JSON serialization (a handle isn't JSON) but an honest
|
|
1217
1217
|
* per-field construction. Recursion terminates: recursive shapes are
|
|
1218
1218
|
* rejected at mapping time. */
|
|
1219
|
-
jsvalLiftable(t: IrType): boolean;
|
|
1219
|
+
jsvalLiftable(t: IrType, visiting?: Set<string>): boolean;
|
|
1220
1220
|
/** A jsval-typed expression carrying `e`'s value into the island —
|
|
1221
1221
|
* jsvalLiftable's constructive side. Primitives and JSON-safe composites
|
|
1222
1222
|
* keep the jsMarshal deep copy; jsval-bearing records and arrays go
|
|
@@ -4232,7 +4232,7 @@ export class Lowerer {
|
|
|
4232
4232
|
* which have no JSON serialization (a handle isn't JSON) but an honest
|
|
4233
4233
|
* per-field construction. Recursion terminates: recursive shapes are
|
|
4234
4234
|
* rejected at mapping time. */
|
|
4235
|
-
jsvalLiftable(t) {
|
|
4235
|
+
jsvalLiftable(t, visiting = new Set()) {
|
|
4236
4236
|
if (t.kind === "jsval")
|
|
4237
4237
|
return true;
|
|
4238
4238
|
if (this.boundarySafe(t))
|
|
@@ -4256,22 +4256,32 @@ export class Lowerer {
|
|
|
4256
4256
|
const shape = this.shapes.get(t.shapeId);
|
|
4257
4257
|
if (!shape || shape.tuple)
|
|
4258
4258
|
return false;
|
|
4259
|
+
// Recursive shapes reaching here answer FALSE: this branch is the
|
|
4260
|
+
// per-field island lift (jsval/bytes-bearing composites — the
|
|
4261
|
+
// JSON-safe ones already answered true through boundarySafe, where
|
|
4262
|
+
// a cyclic value throws the circular TypeError at the marshal), and
|
|
4263
|
+
// the lift helpers walk values with no circular guard — fencing the
|
|
4264
|
+
// TYPE is the honest answer.
|
|
4265
|
+
if (visiting.has(t.shapeId))
|
|
4266
|
+
return false;
|
|
4267
|
+
visiting.add(t.shapeId);
|
|
4259
4268
|
// An INDEX-SIGNATURE record lifts when its value slot does (dyn
|
|
4260
4269
|
// included): declared fields write first, then the overflow keys.
|
|
4261
|
-
if (shape.indexValue && !this.jsvalLiftable(shape.indexValue))
|
|
4270
|
+
if (shape.indexValue && !this.jsvalLiftable(shape.indexValue, visiting))
|
|
4262
4271
|
return false;
|
|
4263
|
-
return shape.fields.every((f) => !f.name.startsWith("%") && this.jsvalLiftable(f.type));
|
|
4272
|
+
return shape.fields.every((f) => !f.name.startsWith("%") && this.jsvalLiftable(f.type, visiting));
|
|
4264
4273
|
}
|
|
4265
4274
|
if (t.kind === "array")
|
|
4266
|
-
return this.jsvalLiftable(t.elem);
|
|
4275
|
+
return this.jsvalLiftable(t.elem, visiting);
|
|
4267
4276
|
// A union crossing IN lifts arm by arm (a runtime tag switch — see
|
|
4268
4277
|
// unionToJsvalHelper) when every arm does: unit arms become the
|
|
4269
4278
|
// engine's own undefined/null (which is why bare undefined-armed
|
|
4270
4279
|
// unions lift here despite being JSON-unsafe), the rest lift as
|
|
4271
|
-
// themselves. Arms never nest unions, so this terminates
|
|
4280
|
+
// themselves. Arms never nest unions, so this terminates (recursive
|
|
4281
|
+
// knots pass through records, guarded above).
|
|
4272
4282
|
if (t.kind === "union") {
|
|
4273
4283
|
const def = this.unions.get(t.unionId);
|
|
4274
|
-
return !!def && def.arms.every((a) => isUnitType(a) || this.jsvalLiftable(a));
|
|
4284
|
+
return !!def && def.arms.every((a) => isUnitType(a) || this.jsvalLiftable(a, visiting));
|
|
4275
4285
|
}
|
|
4276
4286
|
return false;
|
|
4277
4287
|
}
|