mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
Preserve record order in retained lowering
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// Retained reachability lowers module inits before the function bodies they
|
||||
// discover. Record metadata must still use the historical emit order: this
|
||||
// function's {a,b} shape precedes the init's structurally-equal {b,a} shape.
|
||||
function printFunctionRecord(): void {
|
||||
const value = { a: 1, b: 2 };
|
||||
console.log(Object.keys(value).join(","));
|
||||
console.log(JSON.stringify(value));
|
||||
}
|
||||
|
||||
printFunctionRecord();
|
||||
console.log(Object.keys({ b: 2, a: 1 }).length);
|
||||
Reference in New Issue
Block a user