From 652751c8630fc8b68380c9b84ac41183d4c653e1 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Mon, 3 Jan 2022 13:25:47 +0000 Subject: [PATCH] Bug 1737995 - [devtools] Remove lodash zip usage. r=bomsy. Differential Revision: https://phabricator.services.mozilla.com/D134615 --- .../src/actions/breakpoints/breakpointPositions.js | 10 +++++----- devtools/client/debugger/src/reducers/expressions.js | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js b/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js index 17feac7db802..83a9cbc9c8e1 100644 --- a/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js +++ b/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js @@ -7,7 +7,7 @@ import { isGeneratedId, originalToGeneratedId, } from "devtools-source-map"; -import { uniqBy, zip } from "lodash"; +import { uniqBy } from "lodash"; import { getSource, @@ -30,10 +30,10 @@ async function mapLocations(generatedLocations, { sourceMaps }) { generatedLocations ); - return zip( - originalLocations, - generatedLocations - ).map(([location, generatedLocation]) => ({ location, generatedLocation })); + return originalLocations.map((location, index) => ({ + location, + generatedLocation: generatedLocations[index], + })); } // Filter out positions, that are not in the original source Id diff --git a/devtools/client/debugger/src/reducers/expressions.js b/devtools/client/debugger/src/reducers/expressions.js index 9d83ac664b21..af0536c0657c 100644 --- a/devtools/client/debugger/src/reducers/expressions.js +++ b/devtools/client/debugger/src/reducers/expressions.js @@ -7,7 +7,7 @@ * @module reducers/expressions */ -import { omit, zip } from "lodash"; +import { omit } from "lodash"; import { createSelector } from "reselect"; import { prefs } from "../utils/prefs"; @@ -51,11 +51,11 @@ function update(state = initialExpressionState(), action) { case "EVALUATE_EXPRESSIONS": const { inputs, results } = action; - return zip(inputs, results).reduce( - (_state, [input, result]) => + return inputs.reduce( + (_state, input, index) => updateExpressionInList(_state, input, { input, - value: result, + value: results[index], updating: false, }), state