@scriptc/compiler 0.1.2 → 0.1.3
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 +59 -14
- package/dist/backend/c/async.d.ts +5 -0
- package/dist/backend/c/async.js +57 -0
- package/dist/backend/c/async.js.map +1 -1
- package/dist/backend/c/c-emitter.d.ts +3 -0
- package/dist/backend/c/c-emitter.js +15 -8
- package/dist/backend/c/c-emitter.js.map +1 -1
- package/dist/backend/c/exprs.d.ts +8 -1
- package/dist/backend/c/exprs.js +152 -9
- package/dist/backend/c/exprs.js.map +1 -1
- package/dist/backend/c/shapes.js +15 -13
- package/dist/backend/c/shapes.js.map +1 -1
- package/dist/backend/c/types.d.ts +4 -0
- package/dist/backend/c/types.js +18 -1
- package/dist/backend/c/types.js.map +1 -1
- package/dist/backend/c/types.test.js +8 -1
- package/dist/backend/c/types.test.js.map +1 -1
- package/dist/backend/c/walkers.js +32 -11
- package/dist/backend/c/walkers.js.map +1 -1
- package/dist/backend/json-literal.d.ts +7 -0
- package/dist/backend/json-literal.js +17 -0
- package/dist/backend/json-literal.js.map +1 -0
- package/dist/backend/json-literal.test.d.ts +1 -0
- package/dist/backend/json-literal.test.js +17 -0
- package/dist/backend/json-literal.test.js.map +1 -0
- package/dist/backend/link-plan.d.ts +1 -1
- package/dist/backend/link-plan.js +5 -1
- package/dist/backend/link-plan.js.map +1 -1
- package/dist/backend/llvm/classes.js +8 -7
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/common.d.ts +4 -0
- package/dist/backend/llvm/common.js +6 -0
- package/dist/backend/llvm/common.js.map +1 -1
- package/dist/backend/llvm/common.test.d.ts +1 -0
- package/dist/backend/llvm/common.test.js +9 -0
- package/dist/backend/llvm/common.test.js.map +1 -0
- package/dist/backend/llvm/dyn.d.ts +4 -0
- package/dist/backend/llvm/dyn.js +24 -13
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.js +35 -7
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/expr-context.d.ts +4 -0
- package/dist/backend/llvm/expr-dynamic.js +9 -0
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.js +8 -0
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-records.js +3 -3
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +2 -1
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/expr-stream-callbacks.d.ts +3 -0
- package/dist/backend/llvm/expr-stream-callbacks.js +53 -0
- package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
- package/dist/backend/llvm/lib-dispatch.js +22 -0
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-process.js +50 -5
- package/dist/backend/llvm/lib-process.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +46 -0
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/shapes.js +10 -8
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/walkers.js +7 -5
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/backend/native-link-info.d.ts +2 -1
- package/dist/backend/native-link-info.js +4 -0
- package/dist/backend/native-link-info.js.map +1 -1
- package/dist/backend/native-link-info.test.js +24 -1
- package/dist/backend/native-link-info.test.js.map +1 -1
- package/dist/backend/native-toolchain.d.ts +8 -6
- package/dist/backend/native-toolchain.js +28 -13
- package/dist/backend/native-toolchain.js.map +1 -1
- package/dist/backend/native-toolchain.test.js +36 -1
- package/dist/backend/native-toolchain.test.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +1 -1
- package/dist/backend/runtime-pack-targets.test.js.map +1 -1
- package/dist/backend/runtime-pack.test.js +1 -0
- package/dist/backend/runtime-pack.test.js.map +1 -1
- package/dist/backend/targets.d.ts +5 -0
- package/dist/backend/targets.js +9 -0
- package/dist/backend/targets.js.map +1 -1
- package/dist/backend/targets.test.js +6 -1
- package/dist/backend/targets.test.js.map +1 -1
- package/dist/coverage/surface-manifest.js +1 -0
- package/dist/coverage/surface-manifest.js.map +1 -1
- package/dist/diagnostics/diagnostic.js +3 -3
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +1 -0
- package/dist/executable/executable-cache.js +1 -0
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +1 -0
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/frontend/lowering/containers/bytes.d.ts +0 -4
- package/dist/frontend/lowering/containers/bytes.js +112 -28
- package/dist/frontend/lowering/containers/bytes.js.map +1 -1
- package/dist/frontend/lowering/lower-assert.js +16 -10
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +22 -21
- package/dist/frontend/lowering/lower-builtins.js +392 -67
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +8 -6
- package/dist/frontend/lowering/lower-calls.js +110 -12
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.js +12 -8
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +104 -5
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.js +7 -0
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +8 -0
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.d.ts +5 -4
- package/dist/frontend/lowering/lower-stmts.js +23 -6
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +4 -4
- package/dist/frontend/lowering/lowerer.js +5 -5
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +5 -3
- package/dist/frontend/lowering/surfaces.js +33 -13
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/npm-static-declarations.js +27 -14
- package/dist/frontend/npm-static-declarations.js.map +1 -1
- package/dist/frontend/npm-static-declarations.test.js +10 -0
- package/dist/frontend/npm-static-declarations.test.js.map +1 -1
- package/dist/frontend/program.js +18 -2
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/resolve.d.ts +22 -7
- package/dist/frontend/resolve.js +83 -22
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/resolve.test.js +21 -1
- package/dist/frontend/resolve.test.js.map +1 -1
- package/dist/frontend/type-mapper.js +52 -10
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/ir/analysis.js +1 -0
- package/dist/ir/analysis.js.map +1 -1
- package/dist/ir/ir.d.ts +67 -24
- package/dist/ir/ir.js +81 -3
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/serialize.d.ts +1 -1
- package/dist/ir/serialize.js +1 -1
- package/dist/ir/validate.js +77 -5
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/int-infer.test.js +4 -4
- package/dist/library/library-cache.d.ts +1 -0
- package/dist/library/library-cache.js +1 -0
- package/dist/library/library-cache.js.map +1 -1
- package/dist/library/library-cache.test.js +18 -5
- package/dist/library/library-cache.test.js.map +1 -1
- package/package.json +17 -17
- package/surface-manifest.json +32 -17
|
@@ -9,7 +9,7 @@ import * as ts from "../ts7/adapter.js";
|
|
|
9
9
|
import { dirname, posix } from "node:path";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
11
11
|
import { wasiGuestPath } from "../../wasi-paths.js";
|
|
12
|
-
import { BOOL, CAUGHT, DYN, DYN_HANDLE_KINDS, F64, JSVAL, NULL_T, REF_TRUTHY_KINDS, REGEX, RUNTIME_ERROR_CLASSES, SEARCH_PARAMS_T, STRING, UNDEFINED_T, VOID, arrayOf, canAdaptDynFuncTo, canBoxFuncIntoDyn, funcOf, isDynTypedRefType, isJsonSafeType, isSupportedArrayElem, isUnitType, jsOpResultKind, shapeHasAccessorSlots, typeEquals, typeKey, unionFuncSetArmsOk } from "../../ir/ir.js";
|
|
12
|
+
import { BIGINT_T, BOOL, CAUGHT, DYN, DYN_HANDLE_KINDS, F64, JSVAL, NULL_T, REF_TRUTHY_KINDS, REGEX, RUNTIME_ERROR_CLASSES, SEARCH_PARAMS_T, STRING, UNDEFINED_T, VOID, arrayOf, canAdaptDynFuncTo, canBoxFuncIntoDyn, funcOf, isDynTypedRefType, isJsonSafeType, isSupportedArrayElem, isUnitType, jsOpResultKind, shapeHasAccessorSlots, typeEquals, typeKey, unionFuncSetArmsOk } from "../../ir/ir.js";
|
|
13
13
|
import { cjsClassExprWholeExportOf, cjsExportAssignmentOf, cjsExportDiscardReason, isCjsExportTableLiteral, isCjsJsFile, isJsSourceFile, isModuleExportsAccess, isNodeEsmFile, locOf } from "../program.js";
|
|
14
14
|
import { ARRAY_METHODS, builtinConstLit, builtinFenceHintOf, builtinModuleConstOf, builtinModulesArrayLit, builtinModuleFnOf, ISLAND_SURFACE, isChildSurfaceMember, MAP_METHODS, NARROW_FIRST, SET_METHODS, STR_METHODS, UNSUPPORTED_EXPR, sideEffectFreeOptionValue, stdlibGlobalNameOf } from "./surfaces.js";
|
|
15
15
|
import { blockedBindingUseDiag, requiresDynamicPackageDiag, unsupportedDiag } from "../../diagnostics/diagnostic.js";
|
|
@@ -143,6 +143,16 @@ function lowerExprInner(lowerer, expr) {
|
|
|
143
143
|
}
|
|
144
144
|
return { kind: "numLit", value, type: F64, loc };
|
|
145
145
|
}
|
|
146
|
+
if (ts.isBigIntLiteral(expr)) {
|
|
147
|
+
const spelling = expr.getText().replace(/_/g, "").replace(/n$/i, "");
|
|
148
|
+
return {
|
|
149
|
+
kind: "libCall",
|
|
150
|
+
fn: "bigint.parse",
|
|
151
|
+
args: [{ kind: "strLit", value: spelling, type: STRING, loc }],
|
|
152
|
+
type: BIGINT_T,
|
|
153
|
+
loc,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
146
156
|
if (expr.kind === ts.SyntaxKind.TrueKeyword) {
|
|
147
157
|
return { kind: "boolLit", value: true, type: BOOL, loc };
|
|
148
158
|
}
|
|
@@ -583,7 +593,7 @@ function lowerExprInner(lowerer, expr) {
|
|
|
583
593
|
operand = operand.value;
|
|
584
594
|
}
|
|
585
595
|
const FOLD = {
|
|
586
|
-
f64: "number", string: "string", bool: "boolean", func: "function",
|
|
596
|
+
f64: "number", bigint: "bigint", string: "string", bool: "boolean", func: "function",
|
|
587
597
|
array: "object", object: "object", record: "object",
|
|
588
598
|
symbol: "symbol",
|
|
589
599
|
map: "object", set: "object", promise: "object", bytes: "object",
|
|
@@ -960,7 +970,6 @@ function lowerExprInner(lowerer, expr) {
|
|
|
960
970
|
// The families with a WHY: each hint states what makes the
|
|
961
971
|
// surface genuinely non-static (or what to use instead).
|
|
962
972
|
const globalHints = {
|
|
963
|
-
BigInt: "arbitrary-precision integers have no static representation — f64 is the one number type (Number.MAX_SAFE_INTEGER bounds exact integers)",
|
|
964
973
|
Proxy: "property-access metaprogramming has no static lowering (every property read must resolve at compile time)",
|
|
965
974
|
Reflect: "reflective property access has no static lowering — read and call members directly",
|
|
966
975
|
Intl: "locale- and ICU-backed behavior lives outside the static runtime (the localeCompare stance: code-unit order, no collation/locale data) — what lowers: the composed new Intl.NumberFormat(\"en-US\").format(x) and x.toLocaleString(\"en-US\") with default options",
|
|
@@ -2957,6 +2966,9 @@ export function ensureBool(lowerer, e, node) {
|
|
|
2957
2966
|
if (e.type.kind === "f64" || e.type.kind === "string") {
|
|
2958
2967
|
return { kind: "toBool", operand: e, type: BOOL, loc: e.loc };
|
|
2959
2968
|
}
|
|
2969
|
+
if (e.type.kind === "bigint") {
|
|
2970
|
+
return { kind: "libCall", fn: "bigint.truthy", args: [e], type: BOOL, loc: e.loc };
|
|
2971
|
+
}
|
|
2960
2972
|
if (e.type.kind === "dyn") {
|
|
2961
2973
|
// ToBoolean over the checked-dynamic tree (`if (pkg)` on a JSON.parse result): every
|
|
2962
2974
|
// dyn kind has a JS-exact answer — the truthy dynTest reads the kind
|
|
@@ -4863,6 +4875,15 @@ export function lowerElementWrite(lowerer, expr) {
|
|
|
4863
4875
|
export function ensureString(lowerer, e, node) {
|
|
4864
4876
|
if (e.type.kind === "string")
|
|
4865
4877
|
return e;
|
|
4878
|
+
if (e.type.kind === "bigint") {
|
|
4879
|
+
return {
|
|
4880
|
+
kind: "libCall",
|
|
4881
|
+
fn: "bigint.toString",
|
|
4882
|
+
args: [e, { kind: "numLit", value: 10, type: F64, loc: e.loc }],
|
|
4883
|
+
type: STRING,
|
|
4884
|
+
loc: e.loc,
|
|
4885
|
+
};
|
|
4886
|
+
}
|
|
4866
4887
|
if (e.type.kind === "dyn") {
|
|
4867
4888
|
// String(u) / `${u}`: a runtime dispatch over the dyn kind — Node's
|
|
4868
4889
|
// String() exactly (undefined/null texts, JS number formatting,
|
|
@@ -4892,7 +4913,7 @@ export function ensureString(lowerer, e, node) {
|
|
|
4892
4913
|
// JS would print "[object Object]" and friends — narrow first.
|
|
4893
4914
|
const def = lowerer.unions.get(e.type.unionId);
|
|
4894
4915
|
const stringable = def?.arms.every((a) => a.kind === "undefinedT" || a.kind === "nullT" ||
|
|
4895
|
-
a.kind === "string" || a.kind === "f64" || a.kind === "bool");
|
|
4916
|
+
a.kind === "string" || a.kind === "f64" || a.kind === "bigint" || a.kind === "bool");
|
|
4896
4917
|
if (stringable) {
|
|
4897
4918
|
return { kind: "toString", operand: e, type: STRING, loc: e.loc };
|
|
4898
4919
|
}
|
|
@@ -5171,6 +5192,9 @@ export function lowerPrefixUnary(lowerer, expr) {
|
|
|
5171
5192
|
if (raw.type.kind === "jsval") {
|
|
5172
5193
|
return { kind: "jsOp", op: "neg", args: [raw], type: JSVAL, loc };
|
|
5173
5194
|
}
|
|
5195
|
+
if (raw.type.kind === "bigint") {
|
|
5196
|
+
return { kind: "libCall", fn: "bigint.neg", args: [raw], type: BIGINT_T, loc };
|
|
5197
|
+
}
|
|
5174
5198
|
const operand = lowerOptionalNumber(lowerer, raw, loc, expr.operand);
|
|
5175
5199
|
if (operand.type.kind !== "f64")
|
|
5176
5200
|
lowerer.unsupported("SC1043", expr);
|
|
@@ -5201,7 +5225,11 @@ export function lowerPrefixUnary(lowerer, expr) {
|
|
|
5201
5225
|
}
|
|
5202
5226
|
case ts.SyntaxKind.TildeToken: {
|
|
5203
5227
|
// `~x`: ToInt32, complement, back to f64 (JS-exact, incl. NaN → -1).
|
|
5204
|
-
const
|
|
5228
|
+
const raw = lowerer.lowerExpr(expr.operand);
|
|
5229
|
+
if (raw.type.kind === "bigint") {
|
|
5230
|
+
return { kind: "libCall", fn: "bigint.not", args: [raw], type: BIGINT_T, loc };
|
|
5231
|
+
}
|
|
5232
|
+
const operand = lowerOptionalNumber(lowerer, raw, loc, expr.operand);
|
|
5205
5233
|
if (operand.type.kind !== "f64")
|
|
5206
5234
|
lowerer.unsupported("SC1043", expr);
|
|
5207
5235
|
return { kind: "unary", op: "~", operand, type: F64, loc };
|
|
@@ -5877,6 +5905,73 @@ export function lowerBinary(lowerer, expr) {
|
|
|
5877
5905
|
if (left.type.kind === "jsval" || right.type.kind === "jsval") {
|
|
5878
5906
|
return lowerAnyBinaryInIsland(lowerer, expr, left, right, loc);
|
|
5879
5907
|
}
|
|
5908
|
+
if (left.type.kind === "bigint" && right.type.kind === "bigint") {
|
|
5909
|
+
const binary = {
|
|
5910
|
+
[ts.SyntaxKind.PlusToken]: "bigint.add",
|
|
5911
|
+
[ts.SyntaxKind.MinusToken]: "bigint.sub",
|
|
5912
|
+
[ts.SyntaxKind.AsteriskToken]: "bigint.mul",
|
|
5913
|
+
[ts.SyntaxKind.SlashToken]: "bigint.div",
|
|
5914
|
+
[ts.SyntaxKind.PercentToken]: "bigint.mod",
|
|
5915
|
+
[ts.SyntaxKind.AsteriskAsteriskToken]: "bigint.pow",
|
|
5916
|
+
[ts.SyntaxKind.AmpersandToken]: "bigint.and",
|
|
5917
|
+
[ts.SyntaxKind.BarToken]: "bigint.or",
|
|
5918
|
+
[ts.SyntaxKind.CaretToken]: "bigint.xor",
|
|
5919
|
+
[ts.SyntaxKind.LessThanLessThanToken]: "bigint.shl",
|
|
5920
|
+
[ts.SyntaxKind.GreaterThanGreaterThanToken]: "bigint.shr",
|
|
5921
|
+
};
|
|
5922
|
+
const fn = binary[op];
|
|
5923
|
+
if (fn)
|
|
5924
|
+
return { kind: "libCall", fn, args: [left, right], type: BIGINT_T, loc };
|
|
5925
|
+
if (op === ts.SyntaxKind.EqualsEqualsEqualsToken ||
|
|
5926
|
+
op === ts.SyntaxKind.ExclamationEqualsEqualsToken) {
|
|
5927
|
+
const equal = { kind: "libCall", fn: "bigint.eq", args: [left, right], type: BOOL, loc };
|
|
5928
|
+
return op === ts.SyntaxKind.ExclamationEqualsEqualsToken
|
|
5929
|
+
? { kind: "unary", op: "!", operand: equal, type: BOOL, loc }
|
|
5930
|
+
: equal;
|
|
5931
|
+
}
|
|
5932
|
+
if (op === ts.SyntaxKind.LessThanToken || op === ts.SyntaxKind.LessThanEqualsToken ||
|
|
5933
|
+
op === ts.SyntaxKind.GreaterThanToken || op === ts.SyntaxKind.GreaterThanEqualsToken) {
|
|
5934
|
+
const cmp = { kind: "libCall", fn: "bigint.cmp", args: [left, right], type: F64, loc };
|
|
5935
|
+
const zero = { kind: "numLit", value: 0, type: F64, loc };
|
|
5936
|
+
const cmpOp = op === ts.SyntaxKind.LessThanToken ? "<"
|
|
5937
|
+
: op === ts.SyntaxKind.LessThanEqualsToken ? "<="
|
|
5938
|
+
: op === ts.SyntaxKind.GreaterThanToken ? ">" : ">=";
|
|
5939
|
+
return { kind: "bin", op: cmpOp, left: cmp, right: zero, type: BOOL, loc };
|
|
5940
|
+
}
|
|
5941
|
+
}
|
|
5942
|
+
if ((left.type.kind === "bigint" && right.type.kind === "f64") ||
|
|
5943
|
+
(left.type.kind === "f64" && right.type.kind === "bigint")) {
|
|
5944
|
+
if (op === ts.SyntaxKind.LessThanToken || op === ts.SyntaxKind.LessThanEqualsToken ||
|
|
5945
|
+
op === ts.SyntaxKind.GreaterThanToken || op === ts.SyntaxKind.GreaterThanEqualsToken) {
|
|
5946
|
+
const big = left.type.kind === "bigint" ? left : right;
|
|
5947
|
+
const num = left.type.kind === "f64" ? left : right;
|
|
5948
|
+
const cmp = { kind: "libCall", fn: "bigint.cmpNumber", args: [big, num], type: F64, loc };
|
|
5949
|
+
const cmpLocal = lowerer.declareHiddenLocal("%bigcmp", F64);
|
|
5950
|
+
const cmpRef = { kind: "varRef", localId: cmpLocal.id, type: F64, loc };
|
|
5951
|
+
const unordered = {
|
|
5952
|
+
kind: "bin", op: "===", left: cmpRef,
|
|
5953
|
+
right: { kind: "numLit", value: 2, type: F64, loc }, type: BOOL, loc,
|
|
5954
|
+
};
|
|
5955
|
+
const zero = { kind: "numLit", value: 0, type: F64, loc };
|
|
5956
|
+
const leftBig = left.type.kind === "bigint";
|
|
5957
|
+
const cmpOp = leftBig
|
|
5958
|
+
? op === ts.SyntaxKind.LessThanToken ? "<" : op === ts.SyntaxKind.LessThanEqualsToken ? "<=" : op === ts.SyntaxKind.GreaterThanToken ? ">" : ">="
|
|
5959
|
+
: op === ts.SyntaxKind.LessThanToken ? ">" : op === ts.SyntaxKind.LessThanEqualsToken ? ">=" : op === ts.SyntaxKind.GreaterThanToken ? "<" : "<=";
|
|
5960
|
+
const result = {
|
|
5961
|
+
kind: "logical", op: "&&",
|
|
5962
|
+
left: { kind: "unary", op: "!", operand: unordered, type: BOOL, loc },
|
|
5963
|
+
right: { kind: "bin", op: cmpOp, left: cmpRef, right: zero, type: BOOL, loc },
|
|
5964
|
+
type: BOOL, loc,
|
|
5965
|
+
};
|
|
5966
|
+
return {
|
|
5967
|
+
kind: "seqExpr",
|
|
5968
|
+
stmts: [{ kind: "varDecl", localId: cmpLocal.id, init: cmp, loc }],
|
|
5969
|
+
result,
|
|
5970
|
+
type: BOOL,
|
|
5971
|
+
loc,
|
|
5972
|
+
};
|
|
5973
|
+
}
|
|
5974
|
+
}
|
|
5880
5975
|
// An unchecked array read keeps its undefined arm in the IR even when
|
|
5881
5976
|
// the checker typed the binding as `string`. An optional string is not
|
|
5882
5977
|
// itself a string operand for `+`: `undefined + 1` and
|
|
@@ -6390,6 +6485,7 @@ function typeofAnswer(arm) {
|
|
|
6390
6485
|
case "undefinedT": return "undefined";
|
|
6391
6486
|
case "func": return "function";
|
|
6392
6487
|
case "symbol": return "symbol";
|
|
6488
|
+
case "bigint": return "bigint";
|
|
6393
6489
|
case "nullT":
|
|
6394
6490
|
case "array":
|
|
6395
6491
|
case "map":
|
|
@@ -6409,7 +6505,10 @@ function typeofAnswer(arm) {
|
|
|
6409
6505
|
case "httpClientReq":
|
|
6410
6506
|
case "secureCtx":
|
|
6411
6507
|
case "fsWatcher":
|
|
6508
|
+
case "cryptoHash":
|
|
6509
|
+
case "cryptoHmac":
|
|
6412
6510
|
case "childStream":
|
|
6511
|
+
case "childWriter":
|
|
6413
6512
|
case "procStream":
|
|
6414
6513
|
case "object":
|
|
6415
6514
|
case "record":
|