зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1544694 - remove unused method 'getExecutableLines' from sourceClient; r=ochameau,jdescottes,loganfsmyth
Differential Revision: https://phabricator.services.mozilla.com/D27706 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
48648a7344
Коммит
854b687951
|
@ -260,25 +260,6 @@ const SourceActor = ActorClassWithSpec(sourceSpec, {
|
|||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Get all executable lines from the current source
|
||||
* @return Array - Executable lines of the current script
|
||||
*/
|
||||
getExecutableLines: async function() {
|
||||
const offsetsLines = new Set();
|
||||
for (const s of this._findDebuggeeScripts()) {
|
||||
for (const offset of s.getPossibleBreakpoints()) {
|
||||
offsetsLines.add(offset.lineNumber);
|
||||
}
|
||||
}
|
||||
|
||||
const lines = [...offsetsLines];
|
||||
lines.sort((a, b) => {
|
||||
return a - b;
|
||||
});
|
||||
return lines;
|
||||
},
|
||||
|
||||
getBreakpointPositions(query) {
|
||||
const {
|
||||
start: {
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Test if getExecutableLines return correct information
|
||||
*/
|
||||
|
||||
var gDebuggee;
|
||||
var gClient;
|
||||
var gThreadClient;
|
||||
|
||||
const SOURCE_MAPPED_FILE = getFileUrl("sourcemapped.js");
|
||||
|
||||
function run_test() {
|
||||
initTestDebuggerServer();
|
||||
gDebuggee = addTestGlobal("test-get-executable-lines");
|
||||
gClient = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
gClient.connect().then(function _onConnect() {
|
||||
attachTestTabAndResume(
|
||||
gClient,
|
||||
"test-get-executable-lines",
|
||||
function(response, targetFront, threadClient) {
|
||||
gThreadClient = threadClient;
|
||||
test_executable_lines();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
do_test_pending();
|
||||
}
|
||||
|
||||
function test_executable_lines() {
|
||||
gThreadClient.addOneTimeListener("newSource", function _onNewSource(evt, packet) {
|
||||
Assert.equal(evt, "newSource");
|
||||
|
||||
gThreadClient.getSources(function({error, sources}) {
|
||||
Assert.ok(!error);
|
||||
const source = gThreadClient.source(sources[0]);
|
||||
source.getExecutableLines(function(lines) {
|
||||
Assert.ok(arrays_equal([2, 5, 7, 8, 10, 12, 14, 16, 17], lines));
|
||||
finishClient(gClient);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const code = readFile("sourcemapped.js");
|
||||
|
||||
Cu.evalInSandbox(code, gDebuggee, "1.8",
|
||||
SOURCE_MAPPED_FILE, 1);
|
||||
}
|
||||
|
||||
function arrays_equal(a, b) {
|
||||
return !(a < b || b < a);
|
||||
}
|
|
@ -217,7 +217,6 @@ reason = bug 937197
|
|||
[test_client_request.js]
|
||||
[test_symbols-01.js]
|
||||
[test_symbols-02.js]
|
||||
[test_get-executable-lines.js]
|
||||
[test_xpcshell_debugging.js]
|
||||
support-files = xpcshell_debugging_script.js
|
||||
[test_setBreakpoint-at-the-beginning-of-a-minified-fn.js]
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
const {arg, DebuggerClient} = require("devtools/shared/client/debugger-client");
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
/**
|
||||
* A SourceClient provides a way to access the source text of a script.
|
||||
*
|
||||
|
@ -62,21 +60,6 @@ SourceClient.prototype = {
|
|||
},
|
||||
),
|
||||
|
||||
/**
|
||||
* Get Executable Lines from a source
|
||||
*/
|
||||
getExecutableLines: function(cb = noop) {
|
||||
const packet = {
|
||||
to: this._form.actor,
|
||||
type: "getExecutableLines",
|
||||
};
|
||||
|
||||
return this._client.request(packet).then(res => {
|
||||
cb(res.lines);
|
||||
return res.lines;
|
||||
});
|
||||
},
|
||||
|
||||
getBreakpointPositions: function(query) {
|
||||
const packet = {
|
||||
to: this._form.actor,
|
||||
|
|
|
@ -22,7 +22,6 @@ const sourceSpec = generateActorSpec({
|
|||
typeName: "source",
|
||||
|
||||
methods: {
|
||||
getExecutableLines: { response: { lines: RetVal("json") } },
|
||||
getBreakpointPositions: {
|
||||
request: {
|
||||
query: Arg(0, "nullable:breakpointquery"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче