/**
  * Monitors for an object and its properties being defined.*
  *
  * For example, if we want to know when Backbone and Backbone.View,Model,.. are defined*
  * We could do  onObjectAndPropertiesSetted(window, 'Backbone', ['View', 'Model'], function(Backbone) {})
  *
  * And, when Backbone is fully defined, the callback will be invoked.*
  * We do this by watching first for Backbone being defined, then it's properties.
  */

var onObjectAndPropertiesSetted = function(parentObject, objectName, properties, callback) {
  function onObjectSet(prop, action, newVal, oldVal) {
    function onPropertySet(prop2, action2, newVal2, oldVal2) {//

      // exists is separate than has, because not only
      // do we want the prop set, but it must be more than undefiened
      function exists(obj, prop) {
        return !_.isUndefined(obj[prop]);
      }

      var allPropertiesSet = _.all(properties, _.partial(exists, newVal));
      if (!allPropertiesSet) {
        return;
      }

      // clean up all of the defined property poop
      _.each(properties, function(_prop, key) {
        if (!_.has(newVal.watchers, _prop)) {
          return;
        }

        stopWatching(newVal, _prop, onPropertySet);
      });

      stopWatching(parentObject, objectName, onObjectSet);

      callback(newVal);
    }

    _.each(properties, function(prop) {
      watch(newVal, prop, onPropertySet, 0);
    }, this, parentObject, objectName, properties, newVal, callback);
  }

  watch(parentObject, objectName, onObjectSet, 0);
};

@@ -1,8 +1,312 @@
+var allPropertiesSet = function(newVal, properties) %7B%0A  // exists is separate than has, because not only%0A  // do we want the prop set, but it must be more than undefiened%0A  function exists(obj, prop) %7B%0A    return !_.isUndefined(obj%5Bprop%5D);%0A  %7D%0A%0A  return _.all(properties, _.partial(exists, newVal));%0A%7D;%0A%0A
 /**%0A  * 
@@ -953,303 +953,39 @@
     
-// exists is separate than has, because not only%0A      // do we want the prop set, but it must be more than undefiened%0A      function exists(obj, prop) %7B%0A        return !_.isUndefined(obj%5Bprop%5D);%0A      %7D%0A%0A      var allPropertiesSet = _.all(properties, _.partial(exists, newVal));%0A      if (!allP
+if (!allPropertiesSet(newVal, p
 rope
@@ -989,19 +989,17 @@
 operties
-Set
+)
 ) %7B%0A    
@@ -1432,16 +1432,16 @@
 et, 0);%0A
-
     %7D, t
@@ -1501,16 +1501,95 @@
 llback);
+%0A%0A    if (allPropertiesSet(newVal, properties)) %7B%0A      callback(newVal);%0A    %7D
 %0A  %7D%0A%0A  

Fix onObjectAndPropertiesSetted to accomodate objects with properties with objects already setted.