File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ module.exports = {
13
13
if ( inMatch ) {
14
14
var itMatch = inMatch [ 1 ] . match ( / \( ( .* ) , ( .* ) \) / )
15
15
if ( itMatch ) {
16
- this . iterator = itMatch [ 1 ]
17
- this . alias = itMatch [ 2 ]
16
+ this . iterator = itMatch [ 1 ] . trim ( )
17
+ this . alias = itMatch [ 2 ] . trim ( )
18
18
} else {
19
- this . alias = inMatch [ 1 ]
19
+ this . alias = inMatch [ 1 ] . trim ( )
20
20
}
21
21
this . expression = inMatch [ 2 ]
22
22
}
@@ -98,6 +98,7 @@ module.exports = {
98
98
var oldFrags = this . frags
99
99
var frags = this . frags = new Array ( data . length )
100
100
var alias = this . alias
101
+ var iterator = this . iterator
101
102
var start = this . start
102
103
var end = this . end
103
104
var inDoc = _ . inDoc ( start )
@@ -121,6 +122,9 @@ module.exports = {
121
122
// update $key
122
123
if ( key ) {
123
124
frag . scope . $key = key
125
+ if ( iterator ) {
126
+ frag . scope [ iterator ] = key
127
+ }
124
128
}
125
129
// update data for track-by, object repeat &
126
130
// primitive values.
You can’t perform that action at this time.
0 commit comments