mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
Regenerate the IR codec for partial record views
codec.generated.ts was not regenerated when partialView was added to IR expressions, so IR read through the binary codec dropped the field and the stale-codec check failed.
This commit is contained in:
@@ -5,7 +5,7 @@ import type { IrReader, IrWriter } from "./codec.js";
|
||||
|
||||
/** A digest of the coders below: an encoding written with other coders is
|
||||
* refused instead of misread, also after a change that keeps IR_VERSION. */
|
||||
export const IR_CODEC_LAYOUT = "a1813b4b2a32bfd0";
|
||||
export const IR_CODEC_LAYOUT = "b964edeec6535396";
|
||||
|
||||
/** Writes `mod` field by field (codec.ts describes the bytes). */
|
||||
export function encodeIrModule(w: IrWriter, mod: IrModule): void {
|
||||
@@ -150,7 +150,7 @@ const KEYS122: readonly string[] = ["kind","fnName","captures","adapts","type","
|
||||
const KEYS123: readonly string[] = ["kind","value","type","loc"];
|
||||
const KEYS124: readonly string[] = ["kind","elems","type","loc"];
|
||||
const KEYS125: readonly string[] = ["kind","callee","receiver","calleeName","calleeNameValue","args","spreads","type","loc"];
|
||||
const KEYS126: readonly string[] = ["kind","value","preserveRefs","adopt","exact","inferredSite","origin","type","loc"];
|
||||
const KEYS126: readonly string[] = ["kind","value","preserveRefs","adopt","exact","partialView","inferredSite","origin","type","loc"];
|
||||
const KEYS127: readonly string[] = ["kind","value","spelling","firstProp","type","loc"];
|
||||
const KEYS128: readonly string[] = ["kind","value","type","loc","liveRef","fnName","fnLength"];
|
||||
const KEYS129: readonly string[] = ["kind","key","negated","value","type","loc"];
|
||||
@@ -2923,6 +2923,11 @@ function encIrExpr(w: IrWriter, v: IrExpr): void {
|
||||
w.byte(1);
|
||||
w.bool(v.exact);
|
||||
}
|
||||
if (v.partialView === undefined) w.byte(0);
|
||||
else {
|
||||
w.byte(1);
|
||||
w.bool(v.partialView);
|
||||
}
|
||||
if (v.inferredSite === undefined) w.byte(0);
|
||||
else {
|
||||
w.byte(1);
|
||||
@@ -3953,11 +3958,12 @@ function decIrExpr(r: IrReader): IrExpr {
|
||||
const f1 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.preserveRefs") === 0 ? undefined : (r.bool() as NonNullable<Extract<IrExpr, { kind: "dynCheck" }>["preserveRefs"]>);
|
||||
const f2 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.adopt") === 0 ? undefined : (r.bool() as NonNullable<Extract<IrExpr, { kind: "dynCheck" }>["adopt"]>);
|
||||
const f3 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.exact") === 0 ? undefined : (r.bool() as NonNullable<Extract<IrExpr, { kind: "dynCheck" }>["exact"]>);
|
||||
const f4 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.inferredSite") === 0 ? undefined : r.str();
|
||||
const f5 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.origin") === 0 ? undefined : r.num();
|
||||
const f6 = decIrType(r);
|
||||
const f7 = decSrcLoc(r);
|
||||
const o: Extract<IrExpr, { kind: "dynCheck" }> = { kind: "dynCheck", value: f0, ...(f1 !== undefined ? { preserveRefs: f1 } : {}), ...(f2 !== undefined ? { adopt: f2 } : {}), ...(f3 !== undefined ? { exact: f3 } : {}), ...(f4 !== undefined ? { inferredSite: f4 } : {}), ...(f5 !== undefined ? { origin: f5 } : {}), type: f6, loc: f7 };
|
||||
const f4 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.partialView") === 0 ? undefined : (r.bool() as NonNullable<Extract<IrExpr, { kind: "dynCheck" }>["partialView"]>);
|
||||
const f5 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.inferredSite") === 0 ? undefined : r.str();
|
||||
const f6 = r.tag(2, "IrFunction.body[]<arrayDelete>.arr<dynCheck>.origin") === 0 ? undefined : r.num();
|
||||
const f7 = decIrType(r);
|
||||
const f8 = decSrcLoc(r);
|
||||
const o: Extract<IrExpr, { kind: "dynCheck" }> = { kind: "dynCheck", value: f0, ...(f1 !== undefined ? { preserveRefs: f1 } : {}), ...(f2 !== undefined ? { adopt: f2 } : {}), ...(f3 !== undefined ? { exact: f3 } : {}), ...(f4 !== undefined ? { partialView: f4 } : {}), ...(f5 !== undefined ? { inferredSite: f5 } : {}), ...(f6 !== undefined ? { origin: f6 } : {}), type: f7, loc: f8 };
|
||||
return o;
|
||||
}
|
||||
case 26: {
|
||||
|
||||
Reference in New Issue
Block a user