Browse Source

fix to Compiler.include

Franco Ponticelli 14 năm trước cách đây
mục cha
commit
ab4319842c
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      std/haxe/macro/Compiler.hx

+ 2 - 3
std/haxe/macro/Compiler.hx

@@ -62,7 +62,6 @@ class Compiler {
 		} else {
 			function(c) return Lambda.has(ignore, c);
 		}
-		neko.Lib.print("pack: " + pack);
 		if(null == classPaths)
 			classPaths = Context.getClassPath();
 		// normalize class path
@@ -72,14 +71,14 @@ class Compiler {
 				cp = cp.substr(0, -1);
 			classPaths[i] = cp;
 		}
+		var prefix = '' == pack ? '' : pack + '.';
 		for( cp in classPaths ) {
 			var path = ('' == pack) ? cp : cp + "/" + pack.split(".").join("/");
-			pack = '' == pack ? '' : pack + '.';
 			if( !neko.FileSystem.exists(path) || !neko.FileSystem.isDirectory(path) )
 				continue;
 			for( file in neko.FileSystem.readDirectory(path) ) {
 				if( StringTools.endsWith(file, ".hx") ) {
-					var cl = pack + file.substr(0, file.length - 3);
+					var cl = prefix + file.substr(0, file.length - 3);
 					if( skip(cl) )
 						continue;
 					Context.getModule(cl);