/* 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 <http://mozilla.org/MPL/2.0/>. */
import {
getSettledSourceTextContent,
isMapScopesEnabled,
getSelectedFrame,
getGeneratedFrameScope,
getOriginalFrameScope,
getFirstSourceActorForGeneratedSource,
} from "../../selectors/index"; import {
loadOriginalSourceText,
loadGeneratedSourceText,
} from "../sources/loadSourceText"; import { validateSelectedFrame } from "../../utils/context"; import { PROMISE } from "../utils/middleware/promise";
import { log } from "../../utils/log";
import { buildMappedScopes } from "../../utils/pause/mapScopes/index"; import { isFulfilled } from "../../utils/async-value";
import { getMappedLocation } from "../../utils/source-maps";
// Ignore the call if there is no selected frame (we are not paused?) const state = getState(); const selectedFrame = getSelectedFrame(state); if (!selectedFrame) { return;
}
if (getOriginalFrameScope(getState(), selectedFrame)) { return;
}
// Also ignore the call if we didn't fetch the scopes for the selected frame const scopes = getGeneratedFrameScope(getState(), selectedFrame); if (!scopes) { return;
}
export function mapScopes(selectedFrame, scopes) { return async function (thunkArgs) { const { getState, dispatch, client } = thunkArgs;
await dispatch({
type: "MAP_SCOPES",
selectedFrame,
[PROMISE]: (async function () { if (selectedFrame.isOriginal && selectedFrame.originalVariables) { return buildOriginalScopes(selectedFrame, client, scopes);
}
// getMappedScopes is only specific to the sources where we map the variables // in scope and so only need a thread context. Assert that we are on the same thread // before retrieving a thread context.
validateSelectedFrame(getState(), selectedFrame);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.