Browse Source

amberc.js: always evaluate the callback in compile()

Manfred Kroehnert 12 years ago
parent
commit
28320962c5
1 changed files with 5 additions and 2 deletions
  1. 5 2
      bin/amberc.js

+ 5 - 2
bin/amberc.js

@@ -562,8 +562,10 @@ AmberC.prototype.compile = function() {
 	var self = this;
 	var imports = new Combo(function() {
 		Array.prototype.slice.call(arguments).forEach(function(code) {
-			// get element 0 of code since all return values are stored inside an array by Combo
-			self.defaults.smalltalk.Importer._new()._import_(code[0]._stream());
+			if (undefined !== code[0]) {
+				// get element 0 of code since all return values are stored inside an array by Combo
+				self.defaults.smalltalk.Importer._new()._import_(code[0]._stream());
+			}
 		});
 		self.category_export();
 	});
@@ -580,6 +582,7 @@ AmberC.prototype.compile = function() {
 			});
 		}
 	});
+	always_resolve(imports.add());
 };