Explorar o código

EAGLESIX-2984: Updated ElemMatchObjectMatchExpression 2.6.5

David Aebersold %!s(int64=11) %!d(string=hai) anos
pai
achega
3848475f07
Modificáronse 1 ficheiros con 25 adicións e 21 borrados
  1. 25 21
      lib/pipeline/matcher/ElemMatchObjectMatchExpression.js

+ 25 - 21
lib/pipeline/matcher/ElemMatchObjectMatchExpression.js

@@ -1,12 +1,10 @@
 "use strict";
 var ArrayMatchingMatchExpression = require('./ArrayMatchingMatchExpression.js');
 
-// Autogenerated by cport.py on 2013-09-17 14:37
 var ElemMatchObjectMatchExpression = module.exports = function ElemMatchObjectMatchExpression(){
 	base.call(this);
 }, klass = ElemMatchObjectMatchExpression, base = ArrayMatchingMatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
 
-// File: expression_array.h lines: 77-77
 proto._sub = undefined;
 
 /**
@@ -17,21 +15,38 @@ proto._sub = undefined;
  *
  */
 proto.debugString = function debugString(level){
-	// File: expression_array.cpp lines: 106-109
 	var debug = this._debugAddSpace(level);
-	debug = debug + this.path() + " $elemMatch\n";
+	debug = debug + this.path() + " $elemMatch (obj)";
+
+	var td = getTag();
+	if ( null !== td) {
+		debug = debug + " ";
+		debug = debug + td;
+	}
+	debug = debug + "\n";
+
 	return debug + this._sub.debugString(level + 1);
 };
 
+/**
+ *
+ * Return 1 since we have a single "sub"
+ * @method numChildren
+ *
+ */
+proto.numChildren = function numChildren(){
+	return 1;
+};
+
 /**
  *
  * Return the _sub property
  * @method getChild
+ * @param i
  *
  */
-proto.getChild = function getChild(){
-	// File: expression_array.h lines: 74-73
-	return this._sub;
+proto.getChild = function getChild(i){
+	return this._sub.get();
 };
 
 /**
@@ -43,7 +58,6 @@ proto.getChild = function getChild(){
  *
  */
 proto.init = function init(path, sub){
-	// File: expression_array.cpp lines: 85-87
 	this._sub = sub;
 	return this.initPath(path);
 };
@@ -57,7 +71,6 @@ proto.init = function init(path, sub){
  *
  */
 proto.matchesArray = function matchesArray(anArray, details){
-	// File: expression_array.cpp lines: 90-103
 	for (var i in anArray) {
 		var inner = anArray[i];
 		if (!(inner instanceof Object))
@@ -72,17 +85,6 @@ proto.matchesArray = function matchesArray(anArray, details){
 	return false;
 };
 
-/**
- *
- * Return 1 since we have a single "sub"
- * @method numChildren
- *
- */
-proto.numChildren = function numChildren(){
-	// File: expression_array.h lines: 73-72
-	return 1;
-};
-
 /**
  *
  * clone this instance to a new one
@@ -90,8 +92,10 @@ proto.numChildren = function numChildren(){
  *
  */
 proto.shallowClone = function shallowClone(){
-	// File: expression_array.h lines: 65-68
 	var element = new ElemMatchObjectMatchExpression();
 	element.init(this.path(), this._sub.shallowClone());
+	if ( getTag() ){
+		element.setTag(getTag().clone());
+	}
 	return element;
 };