mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
70
devtools/client/debugger/content/queries.js
Normal file
70
devtools/client/debugger/content/queries.js
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
|
||||
function getSource(state, actor) {
|
||||
return state.sources.sources[actor];
|
||||
}
|
||||
|
||||
function getSources(state) {
|
||||
return state.sources.sources;
|
||||
}
|
||||
|
||||
function getSourceCount(state) {
|
||||
return Object.keys(state.sources.sources).length;
|
||||
}
|
||||
|
||||
function getSourceByURL(state, url) {
|
||||
for (let k in state.sources.sources) {
|
||||
const source = state.sources.sources[k];
|
||||
if (source.url === url) {
|
||||
return source;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getSourceByActor(state, actor) {
|
||||
for (let k in state.sources.sources) {
|
||||
const source = state.sources.sources[k];
|
||||
if (source.actor === actor) {
|
||||
return source;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getSelectedSource(state) {
|
||||
return state.sources.sources[state.sources.selectedSource];
|
||||
}
|
||||
|
||||
function getSelectedSourceOpts(state) {
|
||||
return state.sources.selectedSourceOpts;
|
||||
}
|
||||
|
||||
function getSourceText(state, actor) {
|
||||
return state.sources.sourcesText[actor];
|
||||
}
|
||||
|
||||
function getBreakpoints(state) {
|
||||
return Object.keys(state.breakpoints.breakpoints).map(k => {
|
||||
return state.breakpoints.breakpoints[k];
|
||||
});
|
||||
}
|
||||
|
||||
function getBreakpoint(state, location) {
|
||||
return state.breakpoints.breakpoints[makeLocationId(location)];
|
||||
}
|
||||
|
||||
function makeLocationId(location) {
|
||||
return location.actor + ":" + location.line.toString();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSource,
|
||||
getSources,
|
||||
getSourceCount,
|
||||
getSourceByURL,
|
||||
getSourceByActor,
|
||||
getSelectedSource,
|
||||
getSelectedSourceOpts,
|
||||
getSourceText,
|
||||
getBreakpoint,
|
||||
getBreakpoints,
|
||||
makeLocationId
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue