1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-22 23:45:45 +01:00

Cut down on some error console noise when generating XPCOM stubs.

This commit is contained in:
Kris Maglione
2010-10-03 22:15:49 -04:00
parent 106b9163c2
commit 6d472abb18
6 changed files with 24 additions and 9 deletions

View File

@@ -715,10 +715,13 @@ Class.extend = function extend(subclass, superclass, overrides) {
*/
function XPCOM(interfaces, superClass) {
interfaces = Array.concat(interfaces);
let shim = interfaces.reduce(function (shim, iface) shim.QueryInterface(iface),
Cc["@dactyl.googlecode.com/base/xpc-interface-shim"].createInstance());
let res = Class("XPCOM(" + interfaces + ")", superClass || Class, update(
array([k, v === undefined || callable(v) ? function stub() null : v] for ([k, v] in Iterator(shim))).toObject(),
array([k, v === undefined || callable(v) ? function stub() null : v]
for ([k, v] in Iterator(shim))).toObject(),
{ QueryInterface: XPCOMUtils.generateQI(interfaces) }));
shim = interfaces = null;
return res;