         var fn = new Function('__scope__',
           'return eval("with(__scope__){'+request.data.replace(/"/g, '\\"')+'}")');
         var self = this, scope = {callback: function() {
-          var data = [];
-          for (var i = 0; i < arguments.length; i++) {
-            data.push(arguments[i]);
-          }
-          self.notifyXul(request.id, data)
+          self.notifyXul(request.id, Array.prototype.slice.call(arguments));
         }};
         return fn.call(this, scope);
       };

#
class wesabe.dom.Bridge
  constructor: (document, callback) ->
  @forDocument: (doc) ->
    for {bridge, document} in bridges
      return bridge if doc is document

    bridges.push {bridge, document}
    return bridge


  connect: (fn) ->
    wesabe.dom.page.inject(@document, "(#{wesabe.dom.Bridge.bootstrap.toSource()})()")
