瀏覽代碼

Allow Dispatch to be subclassed

Basically the macros only allow arguments of known types, either simple
types (String, Int, Float, Bool) or objects - the only allowed objects
were instances of sys.db.Object subclasses or haxe.web.Dispatch instances.

This patch also allows arguments that are a sub class of haxe.web.Dispatch.

It also makes redirect() public so that the Redirect exception can be
caught by a subclass
Jason O'Neil 12 年之前
父節點
當前提交
eca6dcb369
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      std/haxe/web/Dispatch.hx

+ 4 - 1
std/haxe/web/Dispatch.hx

@@ -59,7 +59,7 @@ enum DispatchError {
 	DETooManyValues;
 }
 
-private class Redirect {
+class Redirect {
 	public function new() {
 	}
 }
@@ -258,6 +258,9 @@ class Dispatch {
 						}
 						return MRSpod(i.toString(), lock);
 					}
+					else if ( name == "haxe.web.Dispatch" ) {
+						return MRDispatch;
+					}
 					csup = csup.t.get().superClass;
 				}
 				Context.error("Unsupported dispatch type '"+i.toString()+"'",p);