소스 검색

put jQuery helper back to js.jquery and use `@:noPackageRestrict`

Andy Li 10 년 전
부모
커밋
bd3b4957a2
2개의 변경된 파일14개의 추가작업 그리고 18개의 파일을 삭제
  1. 0 17
      std/haxe/JQueryHelper.hx
  2. 14 1
      std/js/jquery/Helper.hx

+ 0 - 17
std/haxe/JQueryHelper.hx

@@ -1,17 +0,0 @@
-package haxe;
-
-// couldn't put it into js.jquery package, or else there will be error:
-// "You cannot access the js package while in a macro (for js.jquery.JQuery)"
-class JQueryHelper {
-	macro public static function J(exprs:Array<haxe.macro.Expr>) {
-		return macro new js.jquery.JQuery($a{exprs});
-	}
-
-	#if !macro
-	public static var JTHIS(get, null) : js.jquery.JQuery;
-
-	static inline function get_JTHIS() : js.jquery.JQuery {
-		return new js.jquery.JQuery(js.Lib.nativeThis);
-	}
-	#end
-}

+ 14 - 1
std/js/jquery/Helper.hx

@@ -1,3 +1,16 @@
 package js.jquery;
 
-typedef Helper = haxe.JQueryHelper;
+@:noPackageRestrict
+#if js extern #end class Helper {
+	macro public static function J(exprs:Array<haxe.macro.Expr>) {
+		return macro new js.jquery.JQuery($a{exprs});
+	}
+
+	#if !macro
+	public static var JTHIS(get, null) : js.jquery.JQuery;
+
+	static inline function get_JTHIS() : js.jquery.JQuery {
+		return new js.jquery.JQuery(js.Lib.nativeThis);
+	}
+	#end
+}