浏览代码

forbid same name for static+instance field

Nicolas Cannasse 16 年之前
父节点
当前提交
e3468a7781

+ 3 - 0
doc/CHANGES.txt

@@ -24,6 +24,9 @@ TODO :
 	as3 : bugfix with property access inside setter (stack overflow)
 	all : Enum is now Enum<T>
 	all : added Type.createEnumIndex
+	all : forbid same name for static+instance field (not supported on several platforms)
+	all : renamed haxe.Http.request to "requestUrl"
+	all : renamed neko.zip.Compress/Uncompress.run to "execute"
 
 2009-03-22: 2.03
 	optimized Type.enumEq : use index instead of tag comparison for neko/flash9/php

+ 0 - 1
std/flash9/xml/XML.hx

@@ -42,7 +42,6 @@ extern class XML implements Dynamic<XMLList> {
 	function toXMLString() : String;
 	function valueOf() : XML;
 
-	static var length : Int;
 	static var ignoreComments : Bool;
 	static var ignoreProcessingInstructions : Bool;
 	static var ignoreWhitespace : Bool;

+ 0 - 1
std/flash9/xml/XMLList.hx

@@ -39,5 +39,4 @@ extern class XMLList implements ArrayAccess<XML> {
 	function toString() : String;
 	function toXMLString() : String;
 	function valueOf() : XMLList;
-	static var length : Int;
 }

+ 0 - 4
std/haxe/Http.hx

@@ -610,11 +610,7 @@ class Http {
 	}
 
 #if !flash
-	#if (php||cpp)
 	public static function requestUrl( url : String ) : String {
-	#else
-	public static function request( url : String ) : String {
-	#end
 		var h = new Http(url);
 	#if js
 		h.async = false;

+ 2 - 2
std/neko/zip/Compress.hx

@@ -32,7 +32,7 @@ class Compress {
 		s = _deflate_init(level);
 	}
 
-	public function run( src : haxe.io.Bytes, srcPos : Int, dst : haxe.io.Bytes, dstPos : Int ) : { done : Bool, read : Int, write : Int } {
+	public function execute( src : haxe.io.Bytes, srcPos : Int, dst : haxe.io.Bytes, dstPos : Int ) : { done : Bool, read : Int, write : Int } {
 		return _deflate_buffer(s,src.getData(),srcPos,dst.getData(),dstPos);
 	}
 
@@ -48,7 +48,7 @@ class Compress {
 		var c = new Compress(level);
 		c.setFlushMode(Flush.FINISH);
 		var out = haxe.io.Bytes.alloc(_deflate_bound(c.s,s.length));
-		var r = c.run(s,0,out,0);
+		var r = c.execute(s,0,out,0);
 		c.close();
 		if( !r.done || r.read != s.length )
 			throw "Compression failed";

+ 2 - 2
std/neko/zip/Reader.hx

@@ -43,7 +43,7 @@ class Reader {
 			return f.data;
 		var c = new Uncompress(-15);
 		var s = haxe.io.Bytes.alloc(f.fileSize);
-		var r = c.run(f.data,0,s,0);
+		var r = c.execute(f.data,0,s,0);
 		c.close();
 		if( !r.done || r.read != f.data.length || r.write != f.fileSize )
 			throw "Invalid compressed data for "+f.fileName;
@@ -183,7 +183,7 @@ class Reader {
 				buf = refill(i,buf,0);
 				bufpos = 0;
 			}
-			var r = u.run(buf,bufpos,out,0);
+			var r = u.execute(buf,bufpos,out,0);
 			if( r.read == 0 ) {
 				if( bufpos == 0 )
 					throw new haxe.io.Eof();

+ 2 - 2
std/neko/zip/Uncompress.hx

@@ -32,7 +32,7 @@ class Uncompress {
 		s = _inflate_init(windowBits);
 	}
 
-	public function run( src : haxe.io.Bytes, srcPos : Int, dst : haxe.io.Bytes, dstPos : Int ) : { done : Bool, read : Int, write : Int } {
+	public function execute( src : haxe.io.Bytes, srcPos : Int, dst : haxe.io.Bytes, dstPos : Int ) : { done : Bool, read : Int, write : Int } {
 		return _inflate_buffer(s,src.getData(),srcPos,dst.getData(),dstPos);
 	}
 
@@ -52,7 +52,7 @@ class Uncompress {
 		var pos = 0;
 		u.setFlushMode(Flush.SYNC);
 		while( true ) {
-			var r = u.run(src,pos,tmp,0);
+			var r = u.execute(src,pos,tmp,0);
 			b.addBytes(tmp,0,r.write);
 			pos += r.read;
 			if( r.done )

+ 3 - 3
std/tools/hxinst/Main.hx

@@ -146,7 +146,7 @@ class Main {
 			display("Testing proxy "+p.host+":"+p.port);
 			haxe.Http.PROXY = p;
 			try {
-				haxe.Http.request("http://google.com");
+				haxe.Http.requestUrl("http://google.com");
 			} catch( e : Dynamic ) {
 				display("Could not connect on Google, don't use the proxy");
 				haxe.Http.PROXY = null;
@@ -181,7 +181,7 @@ class Main {
 		display("Getting Latest haXe Version");
 		var haxeFile = null;
 		var r = ~/^haxe-([0-9]+)\.([0-9]+)(-win|-linux|-osx)(\.zip|\.tar\.gz)$/;
-		for( f in haxe.Http.request("http://haxe.org/wiki/latest").split("\n") )
+		for( f in haxe.Http.requestUrl("http://haxe.org/wiki/latest").split("\n") )
 			if( r.match(f) ) {
 				var pf = r.matched(3);
 				switch( SYS ) {
@@ -207,7 +207,7 @@ class Main {
 		display("Getting Latest Neko Version");
 		var nekoFile = null;
 		var r = ~/^neko-([0-9]+)\.([0-9]+)(\.([0-9]+))?(-win|-linux|-osx)(\.zip|\.tar\.gz)$/;
-		for( f in haxe.Http.request("http://nekovm.org/latest.n").split("\n") )
+		for( f in haxe.Http.requestUrl("http://nekovm.org/latest.n").split("\n") )
 			if( r.match(f) ) {
 				var pf = r.matched(5);
 				switch( SYS ) {

+ 1 - 0
typeload.ml

@@ -726,6 +726,7 @@ let init_class ctx c p herits fields =
 			c.cl_constructor <- Some f;
 		end else if not is_static || f.cf_name <> "__init__" then begin
 			if PMap.mem f.cf_name (if is_static then c.cl_statics else c.cl_fields) then error ("Duplicate class field declaration : " ^ f.cf_name) p;
+			if PMap.exists f.cf_name (if is_static then c.cl_fields else c.cl_statics) then error ("Same field name can't be use for both static and instance : " ^ f.cf_name) p;
 			if is_static then begin
 				c.cl_statics <- PMap.add f.cf_name f c.cl_statics;
 				c.cl_ordered_statics <- f :: c.cl_ordered_statics;