mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-16 14:15:49 +01:00
Fix error trapping in events.feedkeys.
--HG-- branch : bootstrapped
This commit is contained in:
@@ -355,13 +355,15 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
while (!(node instanceof Ci.nsIDOMElement) && node.parentNode)
|
||||
node = node.parentNode;
|
||||
try {
|
||||
return node.ownerDocument.defaultView.getComputedStyle(node, null);
|
||||
var res = node.ownerDocument.defaultView.getComputedStyle(node, null);
|
||||
}
|
||||
catch (e) {
|
||||
util.reportError(e);
|
||||
util.dump(String(node));
|
||||
catch (e) {}
|
||||
if (res == null) {
|
||||
util.dumpStack("Computed style is null: " + node);
|
||||
Cu.reportError(Error("Computed style is null: " + node));
|
||||
return {};
|
||||
}
|
||||
return res;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -484,7 +486,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
||||
*/
|
||||
dumpStack: function dumpStack(msg, frames) {
|
||||
let stack = util.stackLines(Error().stack);
|
||||
stack = stack.slice(2, 2 + (frames || 0)).join("\n");
|
||||
stack = stack.slice(2, 2 + (frames || stack.length)).join("\n");
|
||||
util.dump((arguments.length == 0 ? "Stack" : msg) + "\n" + stack + "\n");
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user