mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
[hir] Print MutableRange in lvalue
This is admittedly a little noisy but super valuable when debugging.
This commit is contained in:
1 parent
bbba752e98
commit
ed63dba739
1 file changed
+7
-4
@@ -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