From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- devtools/client/debugger/src/utils/selected-location.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 devtools/client/debugger/src/utils/selected-location.js (limited to 'devtools/client/debugger/src/utils/selected-location.js') diff --git a/devtools/client/debugger/src/utils/selected-location.js b/devtools/client/debugger/src/utils/selected-location.js new file mode 100644 index 0000000000..628186ff22 --- /dev/null +++ b/devtools/client/debugger/src/utils/selected-location.js @@ -0,0 +1,15 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at . */ + +export function getSelectedLocation(mappedLocation, context) { + if (!context) { + return mappedLocation.location; + } + + // `context` may be a location or directly a source object. + const source = context.source || context; + return source.isOriginal + ? mappedLocation.location + : mappedLocation.generatedLocation; +} -- cgit v1.2.3