1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-11 04:34:13 +01:00

Fix error dispatching fullscreen autocmd again.

This commit is contained in:
Kris Maglione
2011-03-10 09:53:57 -05:00
parent 3eb93fe721
commit d7b68c66af
2 changed files with 19 additions and 2 deletions

View File

@@ -143,7 +143,7 @@ var AutoCommands = Module("autocommands", {
let lastPattern = null;
var { url, doc } = args;
if (url)
uri = util.newURI(url);
uri = util.createURI(url);
else
var { uri, doc } = buffer;

View File

@@ -964,7 +964,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @returns {nsIURI}
*/
// FIXME: createURI needed too?
newURI: function (uri, charset, base) services.io.newURI(uri, charset, base),
newURI: function newURI(uri, charset, base) this.withProperErrors("newURI", services.io, uri, charset, base),
/**
* Removes leading garbage prepended to URIs by the subscript
@@ -1765,6 +1765,23 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
return res.filter(function (h) !set.add(seen, h.spec));
},
/**
* Wraps native exceptions thrown by the called function so that a
* proper stack trace may be retrieved from them.
*
* @param {function|string} meth The method to call.
* @param {object} self The 'this' object of the method.
* @param ... Arguments to pass to *meth*.
*/
withProperErrors: function withProperErrors(meth, self) {
try {
return (callable(meth) ? meth : self[meth]).apply(self, Array.slice(arguments, withProperErrors.length));
}
catch (e) {
throw e.stack ? e : Error(e);
}
},
/**
* Converts an E4X XML literal to a DOM node. Any attribute named
* highlight is present, it is transformed into dactyl:highlight,