This repository was archived by the owner on Nov 29, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const FormModel = function (data, options) {
50
50
options . full = typeof options . full !== 'undefined' ? options . full : true ;
51
51
52
52
this . events = document . createElement ( 'div' ) ;
53
- this . convertedExpressions = { } ;
53
+ this . convertedExpressions = new Map ( ) ;
54
54
this . templates = { } ;
55
55
this . loadErrors = [ ] ;
56
56
@@ -1424,7 +1424,9 @@ FormModel.prototype.evaluate = function (
1424
1424
cacheable = original === expr ;
1425
1425
1426
1426
// if no cached conversion exists
1427
- if ( ! this . convertedExpressions [ cacheKey ] ) {
1427
+ const cachedExpr = this . convertedExpressions . get ( cacheKey ) ;
1428
+
1429
+ if ( cachedExpr === undefined ) {
1428
1430
expr = expr . trim ( ) ;
1429
1431
expr = this . replaceInstanceFn ( expr ) ;
1430
1432
expr = this . replaceVersionFn ( expr ) ;
@@ -1439,11 +1441,12 @@ FormModel.prototype.evaluate = function (
1439
1441
expr = expr . replace ( / & l t ; / g, '<' ) ;
1440
1442
expr = expr . replace ( / & g t ; / g, '>' ) ;
1441
1443
expr = expr . replace ( / & q u o t ; / g, '"' ) ;
1444
+
1442
1445
if ( cacheable ) {
1443
- this . convertedExpressions [ cacheKey ] = expr ;
1446
+ this . convertedExpressions . set ( cacheKey , expr ) ;
1444
1447
}
1445
1448
} else {
1446
- expr = this . convertedExpressions [ cacheKey ] ;
1449
+ expr = cachedExpr ;
1447
1450
}
1448
1451
1449
1452
resultTypes = {
You can’t perform that action at this time.
0 commit comments