Skip to content

Commit f9ce47c

Browse files
committed
Implemented clone for Expression.
Essentialy just avoids trying to clone the element of the expression.
1 parent 4358bfb commit f9ce47c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/query/Expression.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ define([
55
'./ElementsData',
66
'./Observer'
77
], function (blocks, parameterQueryCache, Escape, ElementsData, Observer) {
8+
function cloneExpression () {
9+
var element = this.element;
10+
this.element = null;
11+
this.clone = null;
12+
var clone = blocks.clone(this, true);
13+
clone.clone = this.clone = cloneExpression;
14+
this.element = element;
15+
return clone;
16+
}
817
var Expression = {
918
Html: 0,
1019
ValueOnly: 2,
@@ -66,6 +75,7 @@ define([
6675
result.element = element;
6776
result.isExpression = true;
6877
result.nodeLength = 0;
78+
result.clone = cloneExpression;
6979
return match ? result : null;
7080
},
7181

0 commit comments

Comments
 (0)