File tree 1 file changed +10
-7
lines changed
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
24
24
function static_target ( root , options , callback ) {
25
25
config = options ;
26
26
try {
27
- if ( config . comments )
28
- push ( "// Common aliases" ) ;
29
- var aliases = [ "util" ] ;
30
- if ( config . encode )
31
- aliases . push ( "Writer" ) ;
27
+ var aliases = [ ] ;
32
28
if ( config . decode )
33
29
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
+ }
36
39
if ( config . comments )
37
40
push ( "// Lazily resolved type references" ) ;
38
41
push ( ( config . es6 ? "const" : "var" ) + " $lazyTypes = [];" ) ;
You can’t perform that action at this time.
0 commit comments