@scriptc/compiler 0.0.21 → 0.0.23
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 +117 -37
- package/dist/backend/cc-cache.test.d.ts +1 -0
- package/dist/backend/cc-cache.test.js +2507 -0
- package/dist/backend/cc-cache.test.js.map +1 -0
- package/dist/backend/cc.d.ts +69 -11
- package/dist/backend/cc.js +1937 -222
- package/dist/backend/cc.js.map +1 -1
- package/dist/backend/emission/emit-async.js +3 -1
- package/dist/backend/emission/emit-async.js.map +1 -1
- package/dist/backend/emission/emit-exprs.d.ts +10 -0
- package/dist/backend/emission/emit-exprs.js +482 -18
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/emission/emit-stmts.js +13 -5
- package/dist/backend/emission/emit-stmts.js.map +1 -1
- package/dist/backend/emission/emit-types.js +4 -1
- package/dist/backend/emission/emit-types.js.map +1 -1
- package/dist/backend/emission/emit-walkers.js +108 -7
- package/dist/backend/emission/emit-walkers.js.map +1 -1
- package/dist/backend/emission/emitter.d.ts +27 -1
- package/dist/backend/emission/emitter.js +84 -3
- package/dist/backend/emission/emitter.js.map +1 -1
- package/dist/backend/llvm/dyn.d.ts +1 -0
- package/dist/backend/llvm/dyn.js +305 -8
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.js +831 -23
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/shapes.js +3 -2
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/compat/fetch-profile.d.ts +118 -0
- package/dist/compat/fetch-profile.js +531 -0
- package/dist/compat/fetch-profile.js.map +1 -0
- package/dist/coverage/surface-manifest.js +69 -0
- package/dist/coverage/surface-manifest.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +10 -0
- package/dist/diagnostics/diagnostic.js +27 -1
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +24 -15
- package/dist/frontend/lowering/lower-builtins.js +217 -69
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.js +41 -0
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.js +32 -11
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +3 -3
- package/dist/frontend/lowering/lower-exprs.js +87 -15
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-generators.js +7 -1
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-island.d.ts +123 -7
- package/dist/frontend/lowering/lower-island.js +1976 -26
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +17 -1
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +33 -9
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +40 -0
- package/dist/frontend/lowering/lowerer.js +290 -18
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.js +55 -12
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/program.d.ts +20 -4
- package/dist/frontend/program.js +391 -49
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/resolve.d.ts +10 -0
- package/dist/frontend/resolve.js +37 -0
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/ts7/enums.d.ts +9 -0
- package/dist/frontend/ts7/enums.js +8 -6
- package/dist/frontend/ts7/enums.js.map +1 -1
- package/dist/frontend/ts7/program.js +4 -1
- package/dist/frontend/ts7/program.js.map +1 -1
- package/dist/frontend/types.d.ts +16 -9
- package/dist/frontend/types.js +119 -38
- package/dist/frontend/types.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +70 -14
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +55 -26
- package/dist/ir/nodes.js +42 -29
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/validate.js +106 -9
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/int-infer.js +7 -1
- package/dist/library/int-infer.js.map +1 -1
- package/dist/library/int-infer.test.js +80 -0
- package/dist/library/int-infer.test.js.map +1 -1
- package/dist/library/sidecar-validate.js +5 -0
- package/dist/library/sidecar-validate.js.map +1 -1
- package/dist/library/sidecar.d.ts +3 -0
- package/dist/library/sidecar.js.map +1 -1
- package/package.json +2 -2
- package/surface-manifest.json +1097 -130
|
@@ -473,10 +473,11 @@ interface BufferConstructor {
|
|
|
473
473
|
}
|
|
474
474
|
declare var Buffer: BufferConstructor;
|
|
475
475
|
|
|
476
|
-
/* The WHATWG encoders (Node globals).
|
|
477
|
-
* `new TextEncoder().encode(s)` and `new TextDecoder().decode(bytes)
|
|
478
|
-
*
|
|
479
|
-
*
|
|
476
|
+
/* The WHATWG encoders (Node globals). The COMPOSED forms lower —
|
|
477
|
+
* `new TextEncoder().encode(s)` and `new TextDecoder().decode(bytes)` —
|
|
478
|
+
* as do same-scope const store-then-call forms. The label is typed as the
|
|
479
|
+
* utf-8 spellings (the one supported decoder; other labels and the
|
|
480
|
+
* fatal/ignoreBOM options fence at the use site). */
|
|
480
481
|
interface TextEncoder {
|
|
481
482
|
encode(input?: string): Uint8Array;
|
|
482
483
|
}
|
|
@@ -587,10 +588,9 @@ declare var MessageChannel: {
|
|
|
587
588
|
readonly prototype: MessageChannel;
|
|
588
589
|
};
|
|
589
590
|
|
|
590
|
-
/* AbortSignal, the fetch-cancellation slice
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
* statically, with the island's real implementation behind --dynamic). */
|
|
591
|
+
/* AbortSignal, the native fetch-cancellation slice. The three statics,
|
|
592
|
+
* state/reason reads, throwIfAborted, and abort listeners all lower in
|
|
593
|
+
* static builds; dynamic builds use the island's Web implementation. */
|
|
594
594
|
interface AbortSignal extends EventTarget {
|
|
595
595
|
readonly aborted: boolean;
|
|
596
596
|
readonly reason: unknown;
|
|
@@ -604,22 +604,55 @@ declare var AbortSignal: {
|
|
|
604
604
|
readonly prototype: AbortSignal;
|
|
605
605
|
};
|
|
606
606
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
607
|
+
interface ReadableStreamReadValueResult<T> {
|
|
608
|
+
done: false;
|
|
609
|
+
value: T;
|
|
610
|
+
}
|
|
611
|
+
interface ReadableStreamReadDoneResult<T> {
|
|
612
|
+
done: true;
|
|
613
|
+
value: T | undefined;
|
|
614
|
+
}
|
|
615
|
+
type ReadableStreamReadResult<T> =
|
|
616
|
+
| ReadableStreamReadValueResult<T>
|
|
617
|
+
| ReadableStreamReadDoneResult<T>;
|
|
618
|
+
interface ReadableStreamDefaultReader<T = unknown> {
|
|
619
|
+
readonly closed: Promise<void>;
|
|
620
|
+
read(): Promise<ReadableStreamReadResult<T>>;
|
|
621
|
+
cancel(reason?: unknown): Promise<void>;
|
|
622
|
+
releaseLock(): void;
|
|
623
|
+
}
|
|
624
|
+
interface ReadableStreamDefaultController<T = unknown> {
|
|
625
|
+
readonly desiredSize: number | null;
|
|
626
|
+
enqueue(chunk?: T): void;
|
|
627
|
+
close(): void;
|
|
628
|
+
error(reason?: unknown): void;
|
|
629
|
+
}
|
|
630
|
+
interface UnderlyingSource<T = unknown> {
|
|
631
|
+
start?(controller: ReadableStreamDefaultController<T>): unknown;
|
|
632
|
+
pull?(controller: ReadableStreamDefaultController<T>): unknown;
|
|
633
|
+
cancel?(reason?: unknown): unknown;
|
|
634
|
+
}
|
|
635
|
+
interface ReadableStream<T = unknown> {
|
|
636
|
+
readonly locked: boolean;
|
|
637
|
+
cancel(reason?: unknown): Promise<void>;
|
|
638
|
+
getReader(): ReadableStreamDefaultReader<T>;
|
|
639
|
+
}
|
|
640
|
+
declare var ReadableStream: {
|
|
641
|
+
new <T = unknown>(source?: UnderlyingSource<T>): ReadableStream<T>;
|
|
642
|
+
from<T>(iterable: readonly T[]): ReadableStream<T>;
|
|
643
|
+
from(iterable: Uint8Array): ReadableStream<number>;
|
|
644
|
+
from(iterable: string): ReadableStream<string>;
|
|
645
|
+
readonly prototype: ReadableStream<unknown>;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
/* fetch, typed as the native JSON + readable-stream slice: one URL, an
|
|
649
|
+
* optional init with the members CLI requests carry, and a Response
|
|
650
|
+
* whose body is the same stream consumed by json(). json() returns
|
|
651
|
+
* unknown — the same dynamic boundary as JSON.parse: cast and validate. */
|
|
652
|
+
/* Headers — a response's native header map (lowercase names,
|
|
653
|
+
* combine-on-append, sorted iteration). The value is a checked-dynamic
|
|
654
|
+
* native handle like Response itself; constructing one statically
|
|
655
|
+
* (`new Headers()`) keeps the constructor fence. */
|
|
623
656
|
interface Headers {
|
|
624
657
|
append(name: string, value: string): void;
|
|
625
658
|
delete(name: string): void;
|
|
@@ -627,8 +660,16 @@ interface Headers {
|
|
|
627
660
|
getSetCookie(): string[];
|
|
628
661
|
has(name: string): boolean;
|
|
629
662
|
set(name: string, value: string): void;
|
|
630
|
-
forEach(
|
|
663
|
+
forEach(
|
|
664
|
+
callbackfn: (value: string, key: string, parent: Headers) => void,
|
|
665
|
+
thisArg?: unknown,
|
|
666
|
+
): void;
|
|
667
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
631
668
|
}
|
|
669
|
+
declare var Headers: {
|
|
670
|
+
new (init?: Record<string, string> | readonly (readonly [string, string])[]): Headers;
|
|
671
|
+
readonly prototype: Headers;
|
|
672
|
+
};
|
|
632
673
|
interface Response {
|
|
633
674
|
readonly ok: boolean;
|
|
634
675
|
readonly status: number;
|
|
@@ -636,25 +677,62 @@ interface Response {
|
|
|
636
677
|
readonly url: string;
|
|
637
678
|
readonly redirected: boolean;
|
|
638
679
|
readonly headers: Headers;
|
|
639
|
-
readonly body:
|
|
680
|
+
readonly body: ReadableStream<Uint8Array> | null;
|
|
681
|
+
readonly bodyUsed: boolean;
|
|
682
|
+
json(): Promise<unknown>;
|
|
683
|
+
text(): Promise<string>;
|
|
684
|
+
/* The whole body as bytes: bytes() answers a Uint8Array in both tiers.
|
|
685
|
+
* arrayBuffer() remains dynamic-only because static programs have no
|
|
686
|
+
* free-standing ArrayBuffer representation; the compiler diagnoses its
|
|
687
|
+
* direct use and points at bytes(). */
|
|
688
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
689
|
+
bytes(): Promise<Uint8Array>;
|
|
690
|
+
}
|
|
691
|
+
interface ResponseInit {
|
|
692
|
+
headers?:
|
|
693
|
+
| Headers
|
|
694
|
+
| Record<string, string>
|
|
695
|
+
| readonly (readonly [string, string])[];
|
|
696
|
+
status?: number;
|
|
697
|
+
statusText?: string;
|
|
698
|
+
}
|
|
699
|
+
declare var Response: {
|
|
700
|
+
new (
|
|
701
|
+
body?: string | Uint8Array | ReadableStream<Uint8Array> | null,
|
|
702
|
+
init?: ResponseInit,
|
|
703
|
+
): Response;
|
|
704
|
+
readonly prototype: Response;
|
|
705
|
+
error(): Response;
|
|
706
|
+
json(data: unknown, init?: ResponseInit): Response;
|
|
707
|
+
redirect(url: string | URL, status?: number): Response;
|
|
708
|
+
};
|
|
709
|
+
interface Request {
|
|
710
|
+
readonly method: string;
|
|
711
|
+
readonly url: string;
|
|
712
|
+
readonly headers: Headers;
|
|
713
|
+
readonly signal: AbortSignal;
|
|
714
|
+
readonly body: ReadableStream<Uint8Array> | null;
|
|
640
715
|
readonly bodyUsed: boolean;
|
|
641
716
|
json(): Promise<unknown>;
|
|
642
717
|
text(): Promise<string>;
|
|
643
|
-
/* The whole body as bytes: arrayBuffer() answers the engine's
|
|
644
|
-
* ArrayBuffer (a handle — read it through `new Uint8Array(...)` in
|
|
645
|
-
* island code or its byteLength directly); bytes() answers a
|
|
646
|
-
* Uint8Array, which exits to the static bytes tier at a typed
|
|
647
|
-
* boundary (`const b: Uint8Array = await r.bytes()` is a validated
|
|
648
|
-
* copy — divergence 44's aliasing stance). */
|
|
649
718
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
650
719
|
bytes(): Promise<Uint8Array>;
|
|
651
720
|
}
|
|
652
721
|
interface RequestInit {
|
|
653
722
|
method?: string;
|
|
654
|
-
headers?:
|
|
655
|
-
|
|
723
|
+
headers?:
|
|
724
|
+
| Headers
|
|
725
|
+
| Record<string, string>
|
|
726
|
+
| readonly (readonly [string, string])[];
|
|
727
|
+
body?: string | Uint8Array | ReadableStream<Uint8Array> | null;
|
|
728
|
+
duplex?: "half";
|
|
729
|
+
redirect?: "follow" | "error" | "manual";
|
|
656
730
|
signal?: AbortSignal;
|
|
657
731
|
}
|
|
732
|
+
declare var Request: {
|
|
733
|
+
new (input: string | URL | Request, init?: RequestInit): Request;
|
|
734
|
+
readonly prototype: Request;
|
|
735
|
+
};
|
|
658
736
|
declare function fetch(input: string | URL, init?: RequestInit): Promise<Response>;
|
|
659
737
|
|
|
660
738
|
/* The repeating timer pair (setTimeout lives in scriptc.d.ts — always
|
|
@@ -947,9 +1025,9 @@ declare module "node:fs" {
|
|
|
947
1025
|
* variants), closeSync(fd). */
|
|
948
1026
|
export function openSync(path: string, flags: string): number;
|
|
949
1027
|
export function closeSync(fd: number): void;
|
|
950
|
-
/*
|
|
951
|
-
*
|
|
952
|
-
*
|
|
1028
|
+
/* Read into a caller buffer from the fd's current position when position
|
|
1029
|
+
* is omitted/null, or from a numeric byte position without advancing the
|
|
1030
|
+
* fd. Answers the byte count, 0 at EOF. */
|
|
953
1031
|
export function readSync(fd: number, buffer: Uint8Array, offset: number, length: number, position?: number | null): number;
|
|
954
1032
|
/* statSync over an open fd — the same Stats snapshot. */
|
|
955
1033
|
export function fstatSync(fd: number): Stats;
|
|
@@ -1952,6 +2030,8 @@ declare module "node:net" {
|
|
|
1952
2030
|
declare module "http" {
|
|
1953
2031
|
import { Server as NetServer, Socket } from "net";
|
|
1954
2032
|
export type Server = NetServer;
|
|
2033
|
+
export type RequestListener =
|
|
2034
|
+
(req: IncomingMessage, res: ServerResponse) => void;
|
|
1955
2035
|
/* The Server VALUE — Node's constructor works with and without `new`
|
|
1956
2036
|
* (test/parallel's http.Server(fn) spelling); both route to the
|
|
1957
2037
|
* createServer lowering. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|