File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 11class Ctx {
2- constructor ( template ) {
3- this . _temp = "" ;
4- this . _parentTemp = `return @temp;` ;
2+ constructor ( ) {
3+ this . _temp = '' ;
4+ this . _parentTemp = `"use strict"; return @temp;` ;
55 this . _defaultCom = null ;
66 this . _com = null ;
77 this . _b = window . Babel ;
8- this . _babelpresets = [ "react" ] ;
9- this . updateTemplate ( template ) ;
8+ this . _babelpresets = [ 'react' ] ;
109 }
1110 _transpile ( ) {
1211 return this . _b . transform ( this . _temp , {
1312 presets : this . _babelpresets ,
1413 } ) . code ;
1514 }
1615 _generateCom ( ) {
17- this . _com = this . _temp
18- ? Function ( this . _parentTemp . replace ( "@temp" , this . _transpile ( ) ) ) ( )
19- : this . _defaultCom ;
16+ this . _com = this . _temp ? Function ( this . _parentTemp . replace ( '@temp' , this . _transpile ( ) ) ) ( ) : this . _defaultCom ;
2017 }
2118 updateTemplate ( template ) {
22- template = template || "" ;
19+ template = template || '' ;
2320 if ( template !== this . _temp ) {
2421 this . _temp = template ;
2522 this . _generateCom ( ) ;
You can’t perform that action at this time.
0 commit comments