Browse Source

[std] disable Http method chaining (#6980)

* [std] disable Http method chaining

see #6920

* keep old behavior if hx3compat is defined
Simon Krajewski 7 năm trước cách đây
mục cha
commit
c891417cfd
1 tập tin đã thay đổi với 7 bổ sung7 xóa
  1. 7 7
      std/haxe/http/HttpBase.hx

+ 7 - 7
std/haxe/http/HttpBase.hx

@@ -76,16 +76,16 @@ class HttpBase {
 		for (i in 0...headers.length) {
 			if (headers[i].name == name) {
 				headers[i] = { name: name, value: value };
-				return this;
+				return #if hx3compat this #end;
 			}
 		}
 		headers.push({ name: name, value: value });
-		return this;
+		#if hx3compat return this; #end
 	}
 
 	public function addHeader(header:String, value:String) {
 		headers.push({ name:header, value:value });
-		return this;
+		#if hx3compat return this; #end
 	}
 
 	/**
@@ -99,16 +99,16 @@ class HttpBase {
 		for (i in 0...params.length) {
 			if (params[i].name == name) {
 				params[i] = { name: name, value: value };
-				return this;
+				return #if hx3compat this #end;
 			}
 		}
 		params.push({ name: name, value: value });
-		return this;
+		#if hx3compat return this; #end
 	}
 
 	public function addParameter(name:String, value:String) {
 		params.push({ name: name, value: value });
-		return this;
+		#if hx3compat return this; #end
 	}
 
 	/**
@@ -123,7 +123,7 @@ class HttpBase {
 	**/
 	public function setPostData(data:String) {
 		postData = data;
-		return this;
+		#if hx3compat return this; #end
 	}
 
 	/**