File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 1414import { MINI } from './constants.mjs' ;
1515import { build , evaluate } from './build.mjs' ;
1616
17- const CACHE = new Map ( ) ;
17+ const regular = h => {
18+ const cache = new Map ( ) ;
1819
19- const cached = function ( statics ) {
20- let tmp = CACHE . get ( statics ) ;
21- if ( ! tmp ) {
22- CACHE . set ( statics , tmp = build ( statics ) ) ;
23- }
24- tmp = evaluate ( this , tmp , arguments , [ ] ) ;
25- return tmp . length > 1 ? tmp : tmp [ 0 ] ;
20+ return function ( statics ) {
21+ let tmp = cache . get ( statics ) ;
22+ if ( ! tmp ) {
23+ cache . set ( statics , tmp = build ( statics ) ) ;
24+ }
25+ tmp = evaluate ( h , tmp , arguments , [ ] ) ;
26+ return tmp . length > 1 ? tmp : tmp [ 0 ] ;
27+ } ;
2628} ;
2729
28- export default MINI ? build : cached ;
30+ export default MINI ? build : { bind : regular } ;
You can’t perform that action at this time.
0 commit comments