*/
var method = function() {
ep("UniversalXPConnect");
- // FIXME: Is the copy really necessary? Why?
- method.dbusmethod.doCall(Array.prototype.slice.call(arguments),
- arguments.length);
+ try {
+ // The Array.prototype dance converts the "sort of Array but not
+ // quite" 'arguments' to a real Array object
+ method.dbusmethod.doCall(Array.prototype.slice.call(arguments),
+ arguments.length);
+ } catch (e) {
+ if (method._onerror) {
+ method._onerror.apply(method.user_data, [e.toString()]);
+ }
+ }
};
// Store the user specified "this" object
method.watch("onerror", function(id, oldval, newval) {
ep("UniversalXPConnect");
method.dbusmethod.onError = unWrap(newval, method.user_data);
+ // We need to shadow the property for some reason...
+ method._onerror = newval;
});
// Mirror the async property