File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,18 @@ static_target.description = "Static code without reflection (non-functional on i
2424function static_target ( root , options , callback ) {
2525 config = options ;
2626 try {
27- if ( config . comments )
28- push ( "// Common aliases" ) ;
29- var aliases = [ "util" ] ;
30- if ( config . encode )
31- aliases . push ( "Writer" ) ;
27+ var aliases = [ ] ;
3228 if ( config . decode )
3329 aliases . push ( "Reader" ) ;
34- push ( ( config . es6 ? "const " : "var " ) + aliases . map ( function ( name ) { return "$" + name + " = $protobuf." + name ; } ) . join ( ", " ) ) ;
35- push ( "" ) ;
30+ if ( config . encode )
31+ aliases . push ( "Writer" ) ;
32+ aliases . push ( "util" ) ;
33+ if ( aliases . length ) {
34+ if ( config . comments )
35+ push ( "// Common aliases" ) ;
36+ push ( ( config . es6 ? "const " : "var " ) + aliases . map ( function ( name ) { return "$" + name + " = $protobuf." + name ; } ) . join ( ", " ) + ";" ) ;
37+ push ( "" ) ;
38+ }
3639 if ( config . comments )
3740 push ( "// Lazily resolved type references" ) ;
3841 push ( ( config . es6 ? "const" : "var" ) + " $lazyTypes = [];" ) ;
You can’t perform that action at this time.
0 commit comments