2
0
Эх сурвалжийг харах

[php] fixed List.pop() (fixes #6859)

Alexander Kuzmenko 7 жил өмнө
parent
commit
cedf04b223

+ 1 - 1
std/php/_std/List.hx

@@ -60,7 +60,7 @@
 		if( h == null )
 			return null;
 		var x = h[0];
-		h = h[1];
+		untyped __php__("$this->h =& $this->h[1]");
 		if( h == null )
 			q = null;
 		length--;

+ 14 - 0
tests/unit/src/unit/issues/Issue6859.hx

@@ -0,0 +1,14 @@
+package unit.issues;
+
+class Issue6859 extends unit.Test {
+	function test() {
+		var l = new List();
+        l.add(42);
+        l.add(42);
+        l.pop();
+        l.add(42);
+        l.pop();
+        l.pop();
+        eq(0, l.length);
+	}
+}