Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into fibre
[myslice.git] / manifoldapi / static / js / manifold.js
index e2b06cf..01b48f5 100644 (file)
@@ -33,13 +33,13 @@ Array.prototype.equals = function (array) {
         if (this[i] instanceof Array && array[i] instanceof Array) {
             // recurse into the nested arrays
             if (!this[i].equals(array[i]))
-                return false;
-        }
-        else if (this[i] != array[i]) {
+                return false;       
+        }           
+        else if (this[i] != array[i]) { 
             // Warning - two different object instances will never be equal: {x:20} != {x:20}
-            return false;
-        }
-    }
+            return false;   
+        }           
+    }       
     return true;
 }
 
@@ -360,6 +360,7 @@ function QueryStore() {
             //var key = manifold.metadata.get_key(query_ext.query.object);
             
             var record_key_value = manifold.record_get_value(record, record_key);
+            
             query_ext.records.put(record_key_value, record);
 
             if (!(query_ext.state.get(record_key_value)))
@@ -785,6 +786,7 @@ var manifold = {
             switch (this_type) {
                 case TYPE_VALUE:
                 case TYPE_LIST_OF_VALUES:
+                case TYPE_LIST_OF_RECORDS:
                     if (this_value != other_value)
                         return false;
                     break;
@@ -792,6 +794,9 @@ var manifold = {
                     if (!(_record_equals(this_value, other_value, key_fields)))
                         return false;
                     break;
+                /*
+                XXX WARNING = disabled for OpenFlow plugin !!!
+
                 case TYPE_LIST_OF_RECORDS:
                     if (this_value.length != other_value.length)
                         return false;
@@ -799,6 +804,7 @@ var manifold = {
                         if (!(_record_equals(this_value[j], other_value[j], key_fields)))
                             return false;
                     break;
+                */
             }
         }
         return true;
@@ -1110,6 +1116,9 @@ var manifold = {
          * otherwise, publish the main object as well as subqueries
          * XXX how much recursive are we ?
          */
+        if (records == null){
+            records = Array();
+        }
         if (manifold.pubsub_debug)
              messages.debug (">>>>> publish_result_rec " + query.object);
         if (manifold.query_expects_unique_result(query)) {