@scriptc/compiler 0.0.17 → 0.0.18
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 +4 -4
- package/dist/backend/cc.d.ts +5 -0
- package/dist/backend/cc.js +2 -0
- package/dist/backend/cc.js.map +1 -1
- package/dist/backend/emission/emit-async.js +35 -2
- package/dist/backend/emission/emit-async.js.map +1 -1
- package/dist/backend/emission/emit-exprs.js +40 -4
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/emission/emitter.js +69 -11
- package/dist/backend/emission/emitter.js.map +1 -1
- package/dist/backend/emission/may-throw.d.ts +3 -3
- package/dist/backend/emission/may-throw.js +15 -4
- package/dist/backend/emission/may-throw.js.map +1 -1
- package/dist/backend/llvm/emitter.js +199 -21
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.js +4 -7
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.js +17 -9
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.d.ts +22 -17
- package/dist/frontend/lowering/lower-containers.js +628 -51
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +19 -1
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-island.js +55 -7
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +144 -10
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.d.ts +8 -0
- package/dist/frontend/lowering/lower-stmts.js +408 -21
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +38 -0
- package/dist/frontend/lowering/lowerer.js +149 -2
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.js +4 -0
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +46 -12
- package/dist/ir/nodes.js +41 -0
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/serialize.d.ts +1 -1
- package/dist/ir/serialize.js +1 -1
- package/dist/ir/validate.js +98 -39
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/int-infer.js +191 -25
- package/dist/library/int-infer.js.map +1 -1
- package/dist/library/int-infer.test.js +206 -1
- package/dist/library/int-infer.test.js.map +1 -1
- package/package.json +2 -2
- package/surface-manifest.json +25 -1
|
@@ -93,20 +93,23 @@ export declare function lowerArrayFlatMapCall(L: Lowerer, call: ts.CallExpressio
|
|
|
93
93
|
* any prefix of (acc, element, index, array). Without an initial value an
|
|
94
94
|
* empty receiver throws Node's exact TypeError at runtime. */
|
|
95
95
|
export declare function lowerArrayReduceCall(L: Lowerer, call: ts.CallExpression, access: ts.PropertyAccessExpression, method: "reduce" | "reduceRight", elem: IrType): IrExpr;
|
|
96
|
-
/** `a.sort(cmp)`
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
96
|
+
/** `a.sort(cmp)` / `a.toSorted(cmp)`, desugared to an interned synthetic
|
|
97
|
+
* function like the other array HOFs. sort mutates and returns the receiver;
|
|
98
|
+
* toSorted takes its shallow snapshot INSIDE the helper, after the receiver
|
|
99
|
+
* and comparator expressions have both been evaluated, then sorts and
|
|
100
|
+
* returns that copy without touching the receiver. The loop is a
|
|
101
|
+
* binary-free INSERTION sort: stable (equal-comparing elements keep their
|
|
102
|
+
* source order, which is what Node's stable TimSort produces for any
|
|
103
|
+
* consistent comparator) and JS-faithful on the comparator contract — an
|
|
104
|
+
* element moves left only while cmp(left, v) > 0, so a NaN or 0 result holds
|
|
105
|
+
* position exactly like the spec's "treat as equal". The SEQUENCE of
|
|
106
|
+
* comparator calls differs from V8's TimSort (SEMANTICS.md); results are
|
|
107
|
+
* identical for consistent comparators. The comparator-less form lowers for
|
|
108
|
+
* STRING elements only — JS's default converts every element to string and
|
|
109
|
+
* compares UTF-16 units, so the interned synthesized comparator selects the
|
|
110
|
+
* runtime's code-unit ordering rather than scriptc's documented code-point
|
|
111
|
+
* relational operators. For numbers that default is the notorious string
|
|
112
|
+
* sort ([10, 9, 1] → [1, 10, 9]), deliberately fenced toward an explicit
|
|
110
113
|
* comparator. */
|
|
111
114
|
export declare function lowerArraySortCall(L: Lowerer, call: ts.CallExpression, access: ts.PropertyAccessExpression, elem: IrType, arrT: IrType & {
|
|
112
115
|
kind: "array";
|
|
@@ -274,7 +277,7 @@ export type ForOfIterProjection = "keys" | "values" | "entries";
|
|
|
274
277
|
* enter/exit bracketing: the pair list compacts immediately (no
|
|
275
278
|
* tombstones), so there is no iteration depth to keep exact. */
|
|
276
279
|
export declare function lowerForOfSearchParams(L: Lowerer, stmt: ts.ForOfStatement, iterable: IrExpr, proj?: ForOfIterProjection): IrStmt;
|
|
277
|
-
/** for-of over an ARRAY
|
|
280
|
+
/** for-of over an ARRAY/typed-array keys()/entries() projection consumed directly
|
|
278
281
|
* by the head (`for (const [index, line] of lines.entries())` — the
|
|
279
282
|
* dominant formatter idiom): the LIVE index walk — the length re-reads
|
|
280
283
|
* every pass, exactly the array iterator's contract (elements appended
|
|
@@ -287,9 +290,11 @@ export declare function lowerForOfSearchParams(L: Lowerer, stmt: ts.ForOfStateme
|
|
|
287
290
|
* [number, T] tuple record. Stored iterator OBJECTS keep their fence
|
|
288
291
|
* (only the direct for-of position unwraps). */
|
|
289
292
|
export declare function lowerForOfArrayIter(L: Lowerer, stmt: ts.ForOfStatement, iterable: IrExpr & {
|
|
290
|
-
type: IrType & {
|
|
293
|
+
type: (IrType & {
|
|
291
294
|
kind: "array";
|
|
292
|
-
}
|
|
295
|
+
}) | (IrType & {
|
|
296
|
+
kind: "bytes";
|
|
297
|
+
});
|
|
293
298
|
}, proj: "keys" | "entries"): IrStmt;
|
|
294
299
|
export declare function lowerForOfMap(L: Lowerer, stmt: ts.ForOfStatement, iterable: IrExpr, mapT: IrType & {
|
|
295
300
|
kind: "map";
|