This repository was archived by the owner on Sep 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -131,11 +131,28 @@ module.exports = function(initOptions) {
131131 compilerProcess . stderr . on ( 'data' , function ( data ) {
132132 stdErrData += data ;
133133 } ) ;
134- compilerProcess . on ( 'close' , ( function ( code ) {
134+
135+ Promise . all ( [
136+ new Promise ( function ( resolve ) {
137+ compilerProcess . on ( 'close' , function ( code ) {
138+ resolve ( code ) ;
139+ } ) ;
140+ } ) ,
141+ new Promise ( function ( resolve ) {
142+ compilerProcess . stdout . on ( 'end' , function ( ) {
143+ resolve ( ) ;
144+ } ) ;
145+ } ) ,
146+ new Promise ( function ( resolve ) {
147+ compilerProcess . stderr . on ( 'end' , function ( ) {
148+ resolve ( ) ;
149+ } ) ;
150+ } )
151+ ] ) . then ( ( function ( results ) {
152+ var code = results [ 0 ] ;
135153 // non-zero exit means a compilation error
136154 if ( code !== 0 ) {
137- this . emit ( 'error' , new PluginError ( this . PLUGIN_NAME_ ,
138- 'Compilation error: \n\n' + compiler . prependFullCommand ( stdErrData ) ) ) ;
155+ this . emit ( 'error' , new PluginError ( this . PLUGIN_NAME_ , 'Compilation error' ) ) ;
139156 }
140157
141158 // standard error will contain compilation warnings, log those
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ describe('gulp-google-closure-compiler', function() {
5353 } ) ;
5454
5555 stream . on ( 'error' , function ( err ) {
56- err . message . should . startWith ( 'Compilation error: ' ) ;
56+ err . message . should . startWith ( 'Compilation error' ) ;
5757 done ( ) ;
5858 } ) ;
5959 stream . write ( fakeFile1 ) ;
You can’t perform that action at this time.
0 commit comments