Browse Source

amberc.js: register async method before executing it

Manfred Kroehnert 12 years ago
parent
commit
c3317bd122
1 changed files with 2 additions and 1 deletions
  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);
 			});