@@ -118,7 +118,12 @@ function genproto_group3_commonjs_strict(cb) {
118118}
119119
120120
121- function getClosureCompilerCommand ( exportsFile , outputFile ) {
121+ function getClosureCompilerCommand ( exportsFile , outputFile , keepSymbols ) {
122+ var compilationLevel = 'ADVANCED_OPTIMIZATIONS' ;
123+ if ( keepSymbols === true ) {
124+ compilationLevel = 'SIMPLE_OPTIMIZATIONS' ;
125+ }
126+
122127 const closureLib = 'node_modules/google-closure-library' ;
123128 return [
124129 'node_modules/.bin/google-closure-compiler' ,
@@ -127,6 +132,8 @@ function getClosureCompilerCommand(exportsFile, outputFile) {
127132 '--js=message.js' , '--js=binary/arith.js' , '--js=binary/constants.js' ,
128133 '--js=binary/decoder.js' , '--js=binary/encoder.js' , '--js=binary/reader.js' ,
129134 '--js=binary/utils.js' , '--js=binary/writer.js' , `--js=${ exportsFile } ` ,
135+ `--compilation_level=${ compilationLevel } "` , '--generate_exports' ,
136+ '--export_local_property_definitions"' ,
130137 `--entry_point=${ exportsFile } ` , `> ${ outputFile } `
131138 ] . join ( ' ' ) ;
132139}
@@ -145,7 +152,8 @@ function commonjs_asserts(cb) {
145152 'mkdir -p commonjs_out/test_node_modules && ' +
146153 getClosureCompilerCommand (
147154 'commonjs/export_asserts.js' ,
148- 'commonjs_out/test_node_modules/closure_asserts_commonjs.js' ) ,
155+ 'commonjs_out/test_node_modules/closure_asserts_commonjs.js' ,
156+ true ) ,
149157 make_exec_logging_callback ( cb ) ) ;
150158}
151159
@@ -154,7 +162,8 @@ function commonjs_testdeps(cb) {
154162 'mkdir -p commonjs_out/test_node_modules && ' +
155163 getClosureCompilerCommand (
156164 'commonjs/export_testdeps.js' ,
157- 'commonjs_out/test_node_modules/testdeps_commonjs.js' ) ,
165+ 'commonjs_out/test_node_modules/testdeps_commonjs.js' ,
166+ true ) ,
158167 make_exec_logging_callback ( cb ) ) ;
159168}
160169
0 commit comments