forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1790912 - Fix lint issues in js/ductwork/debugger. r=ochameau
When we move this out of the js/ directory, a number of lint exceptions stop applying so we should just fix the issues now. Differential Revision: https://phabricator.services.mozilla.com/D157521
- Loading branch information
1 parent
69dfb51
commit 410e8df
Showing
6 changed files
with
36 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,45 @@ | ||
function run_test() | ||
{ | ||
const {addDebuggerToGlobal} = ChromeUtils.import("resource://gre/modules/jsdebugger.jsm"); | ||
"use strict"; | ||
|
||
function run_test() { | ||
const { addDebuggerToGlobal } = ChromeUtils.import( | ||
"resource://gre/modules/jsdebugger.jsm" | ||
); | ||
|
||
Services.prefs.setBoolPref("security.allow_eval_with_system_principal", true); | ||
registerCleanupFunction(() => { | ||
Services.prefs.clearUserPref("security.allow_eval_with_system_principal"); | ||
}); | ||
|
||
addDebuggerToGlobal(globalThis); | ||
var g = testGlobal("test1"); | ||
const g = testGlobal("test1"); | ||
|
||
var dbg = new Debugger(); | ||
const dbg = new Debugger(); | ||
dbg.addDebuggee(g); | ||
dbg.onDebuggerStatement = function(aFrame) { | ||
let args = aFrame["arguments"]; | ||
dbg.onDebuggerStatement = function(frame) { | ||
const args = frame.arguments; | ||
try { | ||
args[0]; | ||
Assert.ok(true); | ||
} catch(ex) { | ||
} catch (ex) { | ||
Assert.ok(false); | ||
} | ||
}; | ||
|
||
g.eval("function stopMe(arg) {debugger;}"); | ||
|
||
g2 = testGlobal("test2"); | ||
const g2 = testGlobal("test2"); | ||
g2.g = g; | ||
g2.eval("(" + function createBadEvent() { | ||
Cu.importGlobalProperties(["DOMParser"]); | ||
let parser = new DOMParser(); | ||
let doc = parser.parseFromString("<foo></foo>", "text/xml"); | ||
g.stopMe(doc.createEvent("MouseEvent")); | ||
} + ")()"); | ||
g2.eval( | ||
"(" + | ||
function createBadEvent() { | ||
// eslint-disable-next-line mozilla/reject-importGlobalProperties | ||
Cu.importGlobalProperties(["DOMParser"]); | ||
const parser = new DOMParser(); | ||
const doc = parser.parseFromString("<foo></foo>", "text/xml"); | ||
g.stopMe(doc.createEvent("MouseEvent")); | ||
} + | ||
")()" | ||
); | ||
|
||
dbg.removeAllDebuggees(); | ||
} |