Commit 7197e485 authored by Tristan Cavelier's avatar Tristan Cavelier

queries inherit method upgrade

parent 0d857363
...@@ -39,7 +39,6 @@ function ComplexQuery(spec) { ...@@ -39,7 +39,6 @@ function ComplexQuery(spec) {
} }
inherits(ComplexQuery, Query); inherits(ComplexQuery, Query);
ComplexQuery.prototype.constructor = ComplexQuery;
/** /**
* #crossLink "Query/match:method" * #crossLink "Query/match:method"
......
...@@ -49,7 +49,6 @@ function Query() { ...@@ -49,7 +49,6 @@ function Query() {
this.onParseEnd = emptyFunction; this.onParseEnd = emptyFunction;
} }
Query.prototype.constructor = Query;
/** /**
* Filter the item list with matching item only * Filter the item list with matching item only
......
...@@ -43,7 +43,6 @@ function SimpleQuery(spec) { ...@@ -43,7 +43,6 @@ function SimpleQuery(spec) {
} }
inherits(SimpleQuery, Query); inherits(SimpleQuery, Query);
SimpleQuery.prototype.constructor = SimpleQuery;
/** /**
* #crossLink "Query/match:method" * #crossLink "Query/match:method"
......
...@@ -65,10 +65,20 @@ function deepClone(object) { ...@@ -65,10 +65,20 @@ function deepClone(object) {
* Inherits the prototype methods from one constructor into another. The * Inherits the prototype methods from one constructor into another. The
* prototype of `constructor` will be set to a new object created from * prototype of `constructor` will be set to a new object created from
* `superConstructor`. * `superConstructor`.
*
* @param {Function} constructor The constructor which inherits the super one
* @param {Function} superConstructor The super constructor
*/ */
function inherits(constructor, superConstructor) { function inherits(constructor, superConstructor) {
constructor.super_ = superConstructor; constructor.super_ = superConstructor;
constructor.prototype = Object.create(superConstructor.prototype, {}); constructor.prototype = Object.create(superConstructor.prototype, {
"constructor": {
"configurable": true,
"enumerable": false,
"writable": true,
"value": constructor
}
});
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment