This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Description It would be nice to map watch expressions when we're paused.
Here is a sketch that re-purposes what we do when we preview
diff --git a/src/actions/expressions.js b/src/actions/expressions.js
index d20a485..15751e7 100644
--- a/src/actions/expressions.js
+++ b/src/actions/expressions.js
@@ -87,14 +87,35 @@ export function evaluateExpressions() {
}
function evaluateExpression(expression: Expression) {
- return function({ dispatch, getState, client }: ThunkArgs) {
+ return function({ dispatch, getState, client, sourceMaps }: ThunkArgs) {
if (!expression.input) {
console.warn("Expressions should not be empty");
return;
}
const frameId = getSelectedFrameId(getState());
- const input = wrapExpression(expression.input);
+
+
+ let expression;
+ if (isPaused()) {
+ const location = getSelectedLocation(state);
+ const source = getSelectedSource(state);
+ const generatedLocation = await sourceMaps.getGeneratedLocation(
+ { ...location.start, sourceId },
+ source.toJS()
+ );
+
+ expression = await getSourcemapedExpression(
+ { dispatch, sourceMaps },
+ generatedLocation,
+ expression.input
+ );
+ } else {
+ expression = expression.input
+ }
+
+ const input = wrapExpression(expression);
+
return dispatch({
type: "EVALUATE_EXPRESSION",
input: expression.input,
(END)Reactions are currently unavailable
It would be nice to map watch expressions when we're paused.
Here is a sketch that re-purposes what we do when we preview