gecko-dev/devtools/server/tests/unit/test_nativewrappers.js
J. Ryan Stinnett 30b2b7ce44 Bug 1271084 - Apply ESLint autofixes to ignored /devtools files. r=tromey
For simple rules like function spacing, we can auto-fix these across the code
base so they are followed in a consistent way.

To generate this patch, I ran:

./mach eslint devtools --no-ignore --fix

After this, I reverted any changes to third party files that we really do want
to ignore.

MozReview-Commit-ID: 6Q8BApkAW20
2016-05-18 12:49:23 -05:00

31 lines
800 B
JavaScript

function run_test()
{
Components.utils.import("resource://gre/modules/jsdebugger.jsm");
addDebuggerToGlobal(this);
var g = testGlobal("test1");
var dbg = new Debugger();
dbg.addDebuggee(g);
dbg.onDebuggerStatement = function (aFrame) {
let args = aFrame.arguments;
try {
args[0];
do_check_true(true);
} catch (ex) {
do_check_true(false);
}
};
g.eval("function stopMe(arg) {debugger;}");
g2 = testGlobal("test2");
g2.g = g;
g2.eval("(" + function createBadEvent() {
let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"].createInstance(Components.interfaces.nsIDOMParser);
let doc = parser.parseFromString("<foo></foo>", "text/xml");
g.stopMe(doc.createEvent("MouseEvent"));
} + ")()");
dbg.enabled = false;
}