mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add type to DeclareLocal
This commit is contained in:
@@ -867,6 +867,7 @@ function lowerStatement(
|
||||
kind,
|
||||
place,
|
||||
},
|
||||
type: null,
|
||||
loc: id.node.loc ?? GeneratedSource,
|
||||
});
|
||||
}
|
||||
@@ -1200,6 +1201,7 @@ function lowerStatement(
|
||||
kind: InstructionKind.Catch,
|
||||
place: { ...place },
|
||||
},
|
||||
type: null,
|
||||
loc: handlerBindingPath.node.loc ?? GeneratedSource,
|
||||
});
|
||||
|
||||
|
||||
@@ -664,6 +664,7 @@ export type InstructionValue =
|
||||
| {
|
||||
kind: "DeclareLocal";
|
||||
lvalue: LValue;
|
||||
type: t.FlowType | t.TSType | null;
|
||||
loc: SourceLocation;
|
||||
}
|
||||
| {
|
||||
|
||||
+1
@@ -288,6 +288,7 @@ function declareTemporary(
|
||||
place: result,
|
||||
kind: InstructionKind.Let,
|
||||
},
|
||||
type: null,
|
||||
loc: result.loc,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -251,6 +251,7 @@ function rewriteInstruction(instr: Instruction, state: State): void {
|
||||
instr.value = {
|
||||
kind: "DeclareLocal",
|
||||
lvalue: instr.value.lvalue,
|
||||
type: instr.value.type,
|
||||
loc: instr.value.loc,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user