Nicolas Cannasse 14 years ago
parent
commit
ce21df8c53
2 changed files with 6 additions and 3 deletions
  1. 4 1
      doc/ImportAll.hx
  2. 2 2
      std/haxe/macro/DefaultJSGenerator.hx

+ 4 - 1
doc/ImportAll.hx

@@ -47,6 +47,9 @@ class ImportAll {
 			return;
 		}
 		for( p in Context.getClassPath() ) {
+			// skip if we have a classpath to haxe
+			if( pack.length == 0 && neko.FileSystem.exists(p+"std") )
+				continue;
 			var p = p + pack.split(".").join("/");
 			if( StringTools.endsWith(p,"/") )
 				p = p.substr(0,-1);
@@ -61,8 +64,8 @@ class ImportAll {
 					if( StringTools.startsWith(cl,"flash9.") )
 						cl = "flash."+cl.substr(7);
 					switch( cl ) {
+					case "ImportAll": continue;
 					case "haxe.TimerQueue": if( Context.defined("neko") || Context.defined("php") ) continue;
-					case "haxe.ImportAll": continue;
 					case "haxe.macro.DefaultJSGenerator","haxe.macro.Context", "haxe.macro.Compiler": if( !Context.defined("neko") ) continue;
 					case "haxe.remoting.SocketWrapper": if( !Context.defined("flash") ) continue;
 					case "haxe.remoting.SyncSocketConnection": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("cpp")) ) continue;

+ 2 - 2
std/haxe/macro/DefaultJSGenerator.hx

@@ -216,8 +216,8 @@ class DefaultJSGenerator {
 		var constructs = e.names.map(api.quoteString).join(",");
 		fprint("%p = { __ename__ : [%names], __constructs__ : [%constructs] }");
 		newline();
-		for( c in e.contructs.keys() ) {
-			var c = e.contructs.get(c);
+		for( c in e.constructs.keys() ) {
+			var c = e.constructs.get(c);
 			var f = field(c.name);
 			fprint("%p%f = ");
 			switch( c.type ) {