Explorar o código

amberc.js: self.optimize() must be called in any case the function exits

Manfred Kroehnert %!s(int64=11) %!d(string=hai) anos
pai
achega
4eaddd2dd7
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      bin/amberc.js

+ 3 - 1
bin/amberc.js

@@ -506,7 +506,9 @@ AmberC.prototype.verify = function() {
  */
 AmberC.prototype.compose_js_files = function() {
 	var defaults = this.defaults;
+	var self = this;
 	if (undefined === defaults.program) {
+		self.optimize();
 		return;
 	}
 	var program_files = [];
@@ -533,7 +535,7 @@ AmberC.prototype.compose_js_files = function() {
 		fileStream.end();
 		console.log(error);
 	});
-	var self = this;
+
 	fileStream.on('close', function(){
 		self.optimize();
 	});