Explorar el Código

amberc.js: register async method before executing it

Manfred Kroehnert hace 12 años
padre
commit
c3317bd122
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      bin/amberc.js

+ 2 - 1
bin/amberc.js

@@ -543,11 +543,12 @@ function compile() {
 	});
 
 	defaults.compile.forEach(function(stFile) {
+		var callback = imports.add();
 		if (/\.st/.test(stFile)) {
 			console.log('Importing: ' + stFile);
 			fs.readFile(stFile, 'utf8', function(err, data) {
 				if (!err)
-					imports.add()(data);
+					callback(data);
 				else
 					throw new Error('Could not import: ' + stFile);
 			});