File tree 1 file changed +4
-13
lines changed
1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -101,35 +101,26 @@ Object.keys(DIRECTIVES).forEach(name => {
101
101
} ) ;
102
102
103
103
function readExpression ( parser : Parser , start : number , quoteMark : string | null ) {
104
- let str = '' ;
104
+ let i = start ;
105
105
let escaped = false ;
106
106
107
- for ( let i = start ; i < parser . template . length ; i += 1 ) {
107
+ for ( ; i < parser . template . length ; i += 1 ) {
108
108
const char = parser . template [ i ] ;
109
109
110
110
if ( quoteMark ) {
111
111
if ( char === quoteMark ) {
112
- if ( escaped ) {
113
- str += quoteMark ;
114
- } else {
115
- break ;
116
- }
112
+ if ( ! escaped ) break ;
117
113
} else if ( escaped ) {
118
- str += '\\' + char ;
119
114
escaped = false ;
120
115
} else if ( char === '\\' ) {
121
116
escaped = true ;
122
- } else {
123
- str += char ;
124
117
}
125
118
} else if ( / [ \s \/ > ] / . test ( char ) ) {
126
119
break ;
127
- } else {
128
- str += char ;
129
120
}
130
121
}
131
122
132
- const expression = parseExpressionAt ( repeat ( ' ' , start ) + str , start , {
123
+ const expression = parseExpressionAt ( parser . template . slice ( 0 , i ) , start , {
133
124
ecmaVersion : 9 ,
134
125
} ) ;
135
126
parser . index = expression . end ;
You can’t perform that action at this time.
0 commit comments