浏览代码

dodge Js undefined/null issue

Simon Krajewski 10 年之前
父节点
当前提交
2075d81966
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      tests/unit/src/unit/issues/Issue2497.hx
  2. 1 1
      tests/unit/src/unit/issues/misc/Issue2497Class.hx

+ 1 - 1
tests/unit/src/unit/issues/Issue2497.hx

@@ -14,6 +14,6 @@ private class Object1 {
 class Issue2497 extends Test {
 	function test() {
 		var obj1 = new Object1();
-		eq("hello world null", obj1.sayHelloTo("world"));
+		eq("hello world !", obj1.sayHelloTo("world"));
 	}
 }

+ 1 - 1
tests/unit/src/unit/issues/misc/Issue2497Class.hx

@@ -2,7 +2,7 @@ package unit.issues.misc;
 
 class Issue2497Class {
 	public static var addTail: String -> String -> ?String-> String = actualFx;
-	public static function actualFx(str1:String, str2:String, ?str3:String) {
+	public static function actualFx(str1:String, str2:String, ?str3:String = "!") {
 		return str1 + " " + str2 + " " + str3;
 	}
 }