mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[hir] Print MutableRange in lvalue
This is admittedly a little noisy but super valuable when debugging.
This commit is contained in:
@@ -327,16 +327,19 @@ function printMutableRange(identifier: Identifier): string {
|
||||
}
|
||||
|
||||
export function printLValue(lval: LValue): string {
|
||||
let place = printPlace(lval.place);
|
||||
let lvalue = `${printPlace(lval.place)}${printMutableRange(
|
||||
lval.place.identifier
|
||||
)}`;
|
||||
|
||||
switch (lval.kind) {
|
||||
case InstructionKind.Let: {
|
||||
return `Let ${place}`;
|
||||
return `Let ${lvalue}`;
|
||||
}
|
||||
case InstructionKind.Const: {
|
||||
return `Const ${place}`;
|
||||
return `Const ${lvalue}$`;
|
||||
}
|
||||
case InstructionKind.Reassign: {
|
||||
return `Reassign ${place}`;
|
||||
return `Reassign ${lvalue}`;
|
||||
}
|
||||
default: {
|
||||
assertExhaustive(lval.kind, `Unexpected lvalue kind '${lval.kind}'`);
|
||||
|
||||
Reference in New Issue
Block a user