Permalink
Browse files

do away with jsfun

git-svn-id: http://ocamljs.googlecode.com/svn/trunk@223 27578800-e353-0410-a23a-a7c9f63c6ccd
  • Loading branch information...
1 parent 4d0ac1a commit 198a8dacda7653617df311e829e5d871a61ca254 Jake Donham committed Sep 15, 2009
View
50 src/dom/dom.ml
@@ -321,33 +321,33 @@ object
method _set_tabIndex : int -> unit
method _get_tagName : string
- method addEventListener : string -> (event -> unit) Ocamljs.jsfun -> bool -> unit
- method addEventListener_mouseEvent_ : string -> (mouseEvent -> unit) Ocamljs.jsfun -> bool -> unit
+ method addEventListener : string -> (event -> unit) -> bool -> unit
+ method addEventListener_mouseEvent_ : string -> (mouseEvent -> unit) -> bool -> unit
method blur : unit
method click : unit
method dispatchEvent : #event -> unit
method focus : unit
method getAttribute : string -> string
method getElementsByTagName : string -> 'a
method removeAttribute : string -> unit
- method removeEventListener : string -> (event -> unit) Ocamljs.jsfun -> bool -> unit
- method removeEventListener_mouseEvent_ : string -> (mouseEvent -> unit) Ocamljs.jsfun -> bool -> unit
+ method removeEventListener : string -> (event -> unit) -> bool -> unit
+ method removeEventListener_mouseEvent_ : string -> (mouseEvent -> unit) -> bool -> unit
method setAttribute : string -> string -> unit
- method _set_onblur : (event -> bool) Ocamljs.jsfun -> unit
- method _set_onclick : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_oncontextmenu : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_ondblclick : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onfocus : (event -> bool) Ocamljs.jsfun -> unit
- method _set_onkeydown : (keyEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onkeypress : (keyEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onkeyup : (keyEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmousedown : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmousemove : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmouseout : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmouseover : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmouseup : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onresize : (event -> bool) Ocamljs.jsfun -> unit
+ method _set_onblur : (event -> bool) -> unit
+ method _set_onclick : (mouseEvent -> bool) -> unit
+ method _set_oncontextmenu : (mouseEvent -> bool) -> unit
+ method _set_ondblclick : (mouseEvent -> bool) -> unit
+ method _set_onfocus : (event -> bool) -> unit
+ method _set_onkeydown : (keyEvent -> bool) -> unit
+ method _set_onkeypress : (keyEvent -> bool) -> unit
+ method _set_onkeyup : (keyEvent -> bool) -> unit
+ method _set_onmousedown : (mouseEvent -> bool) -> unit
+ method _set_onmousemove : (mouseEvent -> bool) -> unit
+ method _set_onmouseout : (mouseEvent -> bool) -> unit
+ method _set_onmouseover : (mouseEvent -> bool) -> unit
+ method _set_onmouseup : (mouseEvent -> bool) -> unit
+ method _set_onresize : (event -> bool) -> unit
end
class type anchor =
@@ -425,17 +425,17 @@ end
class type window =
object
- method _set_onload : (unit -> unit) Ocamljs.jsfun -> unit
- method _set_onbeforeunload : (unit -> string) Ocamljs.jsfun -> unit
+ method _set_onload : (unit -> unit) -> unit
+ method _set_onbeforeunload : (unit -> string) -> unit
method _get_location : location
method alert : string -> unit
method confirm : string -> bool
- method setInterval : (unit -> unit) Ocamljs.jsfun -> float -> interval_id
+ method setInterval : (unit -> unit) -> float -> interval_id
method clearInterval : interval_id -> unit
- method setTimeout : (unit -> unit) Ocamljs.jsfun -> float -> timeout_id
+ method setTimeout : (unit -> unit) -> float -> timeout_id
method clearTimeout : timeout_id -> unit
end
@@ -479,7 +479,7 @@ object
method _get_elements : #element array
- method _set_onsubmit : (unit -> bool) Ocamljs.jsfun -> unit
+ method _set_onsubmit : (unit -> bool) -> unit
end
class type button =
@@ -529,7 +529,7 @@ object
method select : unit
- method _set_onchange : (unit -> unit) Ocamljs.jsfun -> unit
+ method _set_onchange : (unit -> unit) -> unit
end
class type option =
@@ -728,7 +728,7 @@ end
class type xMLHttpRequest =
object
- method _set_onreadystatechange : (unit -> unit) Ocamljs.jsfun -> unit
+ method _set_onreadystatechange : (unit -> unit) -> unit
method _get_readyState : int
(* method _get_responseXML : Dom.document ? *)
method _get_responseText : string
View
50 src/dom/dom.mli
@@ -327,33 +327,33 @@ object
method _set_tabIndex : int -> unit
method _get_tagName : string
- method addEventListener : string -> (event -> unit) Ocamljs.jsfun -> bool -> unit
- method addEventListener_mouseEvent_ : string -> (mouseEvent -> unit) Ocamljs.jsfun -> bool -> unit
+ method addEventListener : string -> (event -> unit) -> bool -> unit
+ method addEventListener_mouseEvent_ : string -> (mouseEvent -> unit) -> bool -> unit
method blur : unit
method click : unit
method dispatchEvent : #event -> unit
method focus : unit
method getAttribute : string -> string
method getElementsByTagName : string -> 'a
method removeAttribute : string -> unit
- method removeEventListener : string -> (event -> unit) Ocamljs.jsfun -> bool -> unit
- method removeEventListener_mouseEvent_ : string -> (mouseEvent -> unit) Ocamljs.jsfun -> bool -> unit
+ method removeEventListener : string -> (event -> unit) -> bool -> unit
+ method removeEventListener_mouseEvent_ : string -> (mouseEvent -> unit) -> bool -> unit
method setAttribute : string -> string -> unit
- method _set_onblur : (event -> bool) Ocamljs.jsfun -> unit
- method _set_onclick : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_oncontextmenu : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_ondblclick : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onfocus : (event -> bool) Ocamljs.jsfun -> unit
- method _set_onkeydown : (keyEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onkeypress : (keyEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onkeyup : (keyEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmousedown : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmousemove : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmouseout : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmouseover : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onmouseup : (mouseEvent -> bool) Ocamljs.jsfun -> unit
- method _set_onresize : (event -> bool) Ocamljs.jsfun -> unit
+ method _set_onblur : (event -> bool) -> unit
+ method _set_onclick : (mouseEvent -> bool) -> unit
+ method _set_oncontextmenu : (mouseEvent -> bool) -> unit
+ method _set_ondblclick : (mouseEvent -> bool) -> unit
+ method _set_onfocus : (event -> bool) -> unit
+ method _set_onkeydown : (keyEvent -> bool) -> unit
+ method _set_onkeypress : (keyEvent -> bool) -> unit
+ method _set_onkeyup : (keyEvent -> bool) -> unit
+ method _set_onmousedown : (mouseEvent -> bool) -> unit
+ method _set_onmousemove : (mouseEvent -> bool) -> unit
+ method _set_onmouseout : (mouseEvent -> bool) -> unit
+ method _set_onmouseover : (mouseEvent -> bool) -> unit
+ method _set_onmouseup : (mouseEvent -> bool) -> unit
+ method _set_onresize : (event -> bool) -> unit
end
class type anchor =
@@ -431,17 +431,17 @@ end
class type window =
object
- method _set_onload : (unit -> unit) Ocamljs.jsfun -> unit
- method _set_onbeforeunload : (unit -> string) Ocamljs.jsfun -> unit
+ method _set_onload : (unit -> unit) -> unit
+ method _set_onbeforeunload : (unit -> string) -> unit
method _get_location : location
method alert : string -> unit
method confirm : string -> bool
- method setInterval : (unit -> unit) Ocamljs.jsfun -> float -> interval_id
+ method setInterval : (unit -> unit) -> float -> interval_id
method clearInterval : interval_id -> unit
- method setTimeout : (unit -> unit) Ocamljs.jsfun -> float -> timeout_id
+ method setTimeout : (unit -> unit) -> float -> timeout_id
method clearTimeout : timeout_id -> unit
end
@@ -485,7 +485,7 @@ object
method _get_elements : #element array
- method _set_onsubmit : (unit -> bool) Ocamljs.jsfun -> unit
+ method _set_onsubmit : (unit -> bool) -> unit
end
class type button =
@@ -535,7 +535,7 @@ object
method select : unit
- method _set_onchange : (unit -> unit) Ocamljs.jsfun -> unit
+ method _set_onchange : (unit -> unit) -> unit
end
class type option =
@@ -734,7 +734,7 @@ end
class type xMLHttpRequest =
object
- method _set_onreadystatechange : (unit -> unit) Ocamljs.jsfun -> unit
+ method _set_onreadystatechange : (unit -> unit) -> unit
method _get_readyState : int
(* method _get_responseXML : Dom.document ? *)
method _get_responseText : string
View
46 src/gears/gears.ml
@@ -60,7 +60,7 @@ end
class type desktop =
object
method createShortcut : string -> string -> icons -> string -> unit
- method openFiles : (file array -> unit) Ocamljs.jsfun -> openFileOptions -> unit
+ method openFiles : (file array -> unit) -> openFileOptions -> unit
end
class type address =
@@ -105,8 +105,8 @@ type watch_id
class type geolocation =
object
- method getCurrentPosition : (position -> unit) Ocamljs.jsfun -> (positionError -> unit) Ocamljs.jsfun -> positionOptions -> unit
- method watchPosition : (position -> unit) Ocamljs.jsfun -> (positionError -> unit) Ocamljs.jsfun -> positionOptions -> watch_id
+ method getCurrentPosition : (position -> unit) -> (positionError -> unit) -> positionOptions -> unit
+ method watchPosition : (position -> unit) -> (positionError -> unit) -> positionOptions -> watch_id
method clearWatch : watch_id -> unit
method getPermission : string -> string -> string -> bool
method _get_lastPosition : position
@@ -121,8 +121,8 @@ end
class type httpRequestUpload =
object
- method _set_onprogress : (progressEvent -> unit) Ocamljs.jsfun -> unit
- method _get_onprogress : (progressEvent -> unit) Ocamljs.jsfun
+ method _set_onprogress : (progressEvent -> unit) -> unit
+ method _get_onprogress : (progressEvent -> unit)
end
class type httpRequest =
@@ -135,10 +135,10 @@ object
method abort : unit
method getResponseHeader : string -> string
method getAllResponseHeaders : string
- method _set_onprogress : (progressEvent -> unit) Ocamljs.jsfun -> unit
- method _get_onprogress : (progressEvent -> unit) Ocamljs.jsfun
- method _set_onreadystatechange : (unit -> unit) Ocamljs.jsfun -> unit
- method _get_onreadystatechange : (unit -> unit) Ocamljs.jsfun
+ method _set_onprogress : (progressEvent -> unit) -> unit
+ method _get_onprogress : (progressEvent -> unit)
+ method _set_onreadystatechange : (unit -> unit) -> unit
+ method _get_onreadystatechange : (unit -> unit)
method _get_readyState : int
method _get_responseBlob : blob
method _get_responseText : string
@@ -159,12 +159,12 @@ object
method _get_updateStatus : int
method _get_lastErrorMessage : string
method _get_currentVersion : string
- method _set_oncomplete : (< _get_newVersion : string > -> unit) Ocamljs.jsfun -> unit
- method _get_oncomplete : (< _get_newVersion : string > -> unit) Ocamljs.jsfun
- method _set_onerror : (< _get_message : string > -> unit) Ocamljs.jsfun -> unit
- method _get_onerror : (< _get_message : string > -> unit) Ocamljs.jsfun
- method _set_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit) Ocamljs.jsfun -> unit
- method _get_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit) Ocamljs.jsfun
+ method _set_oncomplete : (< _get_newVersion : string > -> unit) -> unit
+ method _get_oncomplete : (< _get_newVersion : string > -> unit)
+ method _set_onerror : (< _get_message : string > -> unit) -> unit
+ method _get_onerror : (< _get_message : string > -> unit)
+ method _set_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit) -> unit
+ method _get_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit)
method checkForUpdate : unit
end
@@ -176,8 +176,8 @@ object
method _get_requiredCookie : string
method _get_enabled : bool
method _set_enabled : bool -> unit
- method capture : string -> (string -> bool -> capture_id -> unit) Ocamljs.jsfun -> capture_id
- method capture_array_ : string array -> (string -> bool -> capture_id -> unit) Ocamljs.jsfun -> capture_id
+ method capture : string -> (string -> bool -> capture_id -> unit) -> capture_id
+ method capture_array_ : string array -> (string -> bool -> capture_id -> unit) -> capture_id
method abortCapture : capture_id -> unit
method remove : string -> unit
method rename : string -> string -> unit
@@ -212,10 +212,10 @@ type interval_id
class type timer =
object
- method setTimeout : (unit -> unit) Ocamljs.jsfun -> float -> timeout_id
+ method setTimeout : (unit -> unit) -> float -> timeout_id
method setTimeout_eval_ : string -> float -> timeout_id
method clearTimeout : timeout_id -> unit
- method setInterval : (unit -> unit) Ocamljs.jsfun -> float -> interval_id
+ method setInterval : (unit -> unit) -> float -> interval_id
method setInterval_eval_ : string -> float -> interval_id
method clearInterval : interval_id -> unit
end
@@ -228,15 +228,15 @@ object
(string ->
worker_id ->
< _get_body : 'a; _get_sender : worker_id; _get_origin : string; _get_text : string > ->
- unit) Ocamljs.jsfun ->
+ unit) ->
unit
method _get_onmessage :
(string ->
worker_id ->
< _get_body : 'a; _get_sender : worker_id; _get_origin : string; _get_text : string > ->
- unit) Ocamljs.jsfun
- method _set_onerror : (< _get_message : string; _get_lineNumber : int > -> bool) Ocamljs.jsfun -> unit
- method _get_onerror : (< _get_message : string; _get_lineNumber : int > -> bool) Ocamljs.jsfun
+ unit)
+ method _set_onerror : (< _get_message : string; _get_lineNumber : int > -> bool) -> unit
+ method _get_onerror : (< _get_message : string; _get_lineNumber : int > -> bool)
method createWorker : string -> worker_id
method createWorkerFromUrl : string -> worker_id
method sendMessage : 'a. 'a -> worker_id -> unit
View
46 src/gears/gears.mli
@@ -85,7 +85,7 @@ end
class type desktop =
object
method createShortcut : string -> string -> icons -> string -> unit
- method openFiles : (file array -> unit) Ocamljs.jsfun -> openFileOptions -> unit
+ method openFiles : (file array -> unit) -> openFileOptions -> unit
end
class type address =
@@ -130,8 +130,8 @@ type watch_id
class type geolocation =
object
- method getCurrentPosition : (position -> unit) Ocamljs.jsfun -> (positionError -> unit) Ocamljs.jsfun -> positionOptions -> unit
- method watchPosition : (position -> unit) Ocamljs.jsfun -> (positionError -> unit) Ocamljs.jsfun -> positionOptions -> watch_id
+ method getCurrentPosition : (position -> unit) -> (positionError -> unit) -> positionOptions -> unit
+ method watchPosition : (position -> unit) -> (positionError -> unit) -> positionOptions -> watch_id
method clearWatch : watch_id -> unit
method getPermission : string -> string -> string -> bool
method _get_lastPosition : position
@@ -146,8 +146,8 @@ end
class type httpRequestUpload =
object
- method _set_onprogress : (progressEvent -> unit) Ocamljs.jsfun -> unit
- method _get_onprogress : (progressEvent -> unit) Ocamljs.jsfun
+ method _set_onprogress : (progressEvent -> unit) -> unit
+ method _get_onprogress : (progressEvent -> unit)
end
class type httpRequest =
@@ -160,10 +160,10 @@ object
method abort : unit
method getResponseHeader : string -> string
method getAllResponseHeaders : string
- method _set_onprogress : (progressEvent -> unit) Ocamljs.jsfun -> unit
- method _get_onprogress : (progressEvent -> unit) Ocamljs.jsfun
- method _set_onreadystatechange : (unit -> unit) Ocamljs.jsfun -> unit
- method _get_onreadystatechange : (unit -> unit) Ocamljs.jsfun
+ method _set_onprogress : (progressEvent -> unit) -> unit
+ method _get_onprogress : (progressEvent -> unit)
+ method _set_onreadystatechange : (unit -> unit) -> unit
+ method _get_onreadystatechange : (unit -> unit)
method _get_readyState : int
method _get_responseBlob : blob
method _get_responseText : string
@@ -184,12 +184,12 @@ object
method _get_updateStatus : int
method _get_lastErrorMessage : string
method _get_currentVersion : string
- method _set_oncomplete : (< _get_newVersion : string > -> unit) Ocamljs.jsfun -> unit
- method _get_oncomplete : (< _get_newVersion : string > -> unit) Ocamljs.jsfun
- method _set_onerror : (< _get_message : string > -> unit) Ocamljs.jsfun -> unit
- method _get_onerror : (< _get_message : string > -> unit) Ocamljs.jsfun
- method _set_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit) Ocamljs.jsfun -> unit
- method _get_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit) Ocamljs.jsfun
+ method _set_oncomplete : (< _get_newVersion : string > -> unit) -> unit
+ method _get_oncomplete : (< _get_newVersion : string > -> unit)
+ method _set_onerror : (< _get_message : string > -> unit) -> unit
+ method _get_onerror : (< _get_message : string > -> unit)
+ method _set_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit) -> unit
+ method _get_onprogress : (< _get_filesComplete : int; _get_filesTotal : int > -> unit)
method checkForUpdate : unit
end
@@ -201,8 +201,8 @@ object
method _get_requiredCookie : string
method _get_enabled : bool
method _set_enabled : bool -> unit
- method capture : string -> (string -> bool -> capture_id -> unit) Ocamljs.jsfun -> capture_id
- method capture_array_ : string array -> (string -> bool -> capture_id -> unit) Ocamljs.jsfun -> capture_id
+ method capture : string -> (string -> bool -> capture_id -> unit) -> capture_id
+ method capture_array_ : string array -> (string -> bool -> capture_id -> unit) -> capture_id
method abortCapture : capture_id -> unit
method remove : string -> unit
method rename : string -> string -> unit
@@ -237,10 +237,10 @@ type interval_id
class type timer =
object
- method setTimeout : (unit -> unit) Ocamljs.jsfun -> float -> timeout_id
+ method setTimeout : (unit -> unit) -> float -> timeout_id
method setTimeout_eval_ : string -> float -> timeout_id
method clearTimeout : timeout_id -> unit
- method setInterval : (unit -> unit) Ocamljs.jsfun -> float -> interval_id
+ method setInterval : (unit -> unit) -> float -> interval_id
method setInterval_eval_ : string -> float -> interval_id
method clearInterval : interval_id -> unit
end
@@ -253,15 +253,15 @@ object
(string ->
worker_id ->
< _get_body : 'a; _get_sender : worker_id; _get_origin : string; _get_text : string > ->
- unit) Ocamljs.jsfun ->
+ unit) ->
unit
method _get_onmessage :
(string ->
worker_id ->
< _get_body : 'a; _get_sender : worker_id; _get_origin : string; _get_text : string > ->
- unit) Ocamljs.jsfun
- method _set_onerror : (< _get_message : string; _get_lineNumber : int > -> bool) Ocamljs.jsfun -> unit
- method _get_onerror : (< _get_message : string; _get_lineNumber : int > -> bool) Ocamljs.jsfun
+ unit)
+ method _set_onerror : (< _get_message : string; _get_lineNumber : int > -> bool) -> unit
+ method _get_onerror : (< _get_message : string; _get_lineNumber : int > -> bool)
method createWorker : string -> worker_id
method createWorkerFromUrl : string -> worker_id
method sendMessage : 'a. 'a -> worker_id -> unit
View
2 src/javascript/javascript.ml
@@ -42,7 +42,7 @@ object
method shift : 'a
method slice : int -> int -> 'a js_array
method sort : 'a js_array
- method sort_compare_ : ('a -> 'a -> int) Ocamljs.jsfun -> 'a js_array
+ method sort_compare_ : ('a -> 'a -> int) -> 'a js_array
(* method splice : ? *)
method toLocaleString : string
method toString : string
View
2 src/javascript/javascript.mli
@@ -45,7 +45,7 @@ object
method shift : 'a
method slice : int -> int -> 'a js_array
method sort : 'a js_array
- method sort_compare_ : ('a -> 'a -> int) Ocamljs.jsfun -> 'a js_array
+ method sort_compare_ : ('a -> 'a -> int) -> 'a js_array
(* method splice : ? *)
method toLocaleString : string
method toString : string
View
205 src/jquery/jQuery.ml
@@ -27,7 +27,7 @@ object
(* ----------- *)
(* jQuery Object Accessors *)
- method each : (int -> Dom.element -> bool) Ocamljs.jsfun -> unit
+ method each : (int -> Dom.element -> bool) -> unit
method size : int
method _get_length : int
method _get_selector : string
@@ -41,9 +41,9 @@ object
method data : string -> 'a
method data_store_ : string -> 'a -> unit
method removeData : string -> unit
- method queue : string -> (unit -> unit) Ocamljs.jsfun array
- method queue_enqueue_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
- method queue_replace_ : string -> (unit -> unit) Ocamljs.jsfun array -> unit
+ method queue : string -> (unit -> unit) array
+ method queue_enqueue_ : string -> (unit -> unit) -> unit
+ method queue_replace_ : string -> (unit -> unit) array -> unit
method dequeue : string -> unit
(* Attributes *)
@@ -82,9 +82,9 @@ object
(* Filtering *)
method eq : int -> jQuery
method filter : string -> jQuery
- method filter_fn_ : (int -> bool) Ocamljs.jsfun -> jQuery
+ method filter_fn_ : (int -> bool) -> jQuery
method is : string -> bool
- method map : (int -> Dom.element -> 'a) Ocamljs.jsfun -> jQuery
+ method map : (int -> Dom.element -> 'a) -> jQuery
method not : string -> jQuery
method not_element_ : Dom.element -> jQuery
method not_elements_ : Dom.element array -> jQuery
@@ -196,13 +196,13 @@ object
(* ------ *)
(* Page Load *)
- method ready : ((string -> jQuery) -> unit) Ocamljs.jsfun -> unit
+ method ready : ((string -> jQuery) -> unit) -> unit
(* Event Handling *)
- method bind : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
- method bind_data_ : string -> 'a -> (Dom.event -> bool) Ocamljs.jsfun -> unit
- method one : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
- method one_data_ : string -> 'a -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method bind : string -> (Dom.event -> bool) -> unit
+ method bind_data_ : string -> 'a -> (Dom.event -> bool) -> unit
+ method one : string -> (Dom.event -> bool) -> unit
+ method one_data_ : string -> 'a -> (Dom.event -> bool) -> unit
method trigger : string -> unit
method trigger_data_ : string -> 'a array -> unit
method trigger_event_ : Dom.event -> unit
@@ -216,121 +216,121 @@ object
method triggerHandler_obj_ : 'a -> unit
method triggerHandler_objdata_ : 'a -> 'b array -> unit
method unbind : string -> unit
- method unbind_fn_ : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method unbind_fn_ : string -> (Dom.event -> bool) -> unit
method unbind_event_ : Dom.event -> unit
method unbind_eventfn_ :
- Dom.event -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ Dom.event -> (Dom.event -> bool) -> unit
method unbind_obj_ : 'a -> unit
- method unbind_objfn_ : 'a -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method unbind_objfn_ : 'a -> (Dom.event -> bool) -> unit
method unbind_all_ : unit
(* Live Events *)
- method live : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method live : string -> (Dom.event -> bool) -> unit
method die : string -> unit
- method die_fn_ : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method die_fn_ : string -> (Dom.event -> bool) -> unit
method die_all_ : unit
(* Interaction Helpers *)
method hover :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_2_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_3_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_4_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_5_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
(* Event Helpers *)
- method blur : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method blur : (Dom.event -> bool) -> unit
method blur_trigger_ : unit
- method change : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method change : (Dom.event -> bool) -> unit
method change_trigger_ : unit
- method click : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
+ method click : (Dom.mouseEvent -> bool) -> unit
method click_trigger_ : unit
- method dblclick : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
+ method dblclick : (Dom.mouseEvent -> bool) -> unit
method dblclick_trigger_ : unit
- method error : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method error : (Dom.event -> bool) -> unit
method error_trigger_ : unit
- method focus : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method focus : (Dom.event -> bool) -> unit
method focus_trigger_ : unit
- method keydown : (Dom.keyEvent -> bool) Ocamljs.jsfun -> unit
+ method keydown : (Dom.keyEvent -> bool) -> unit
method keydown_trigger_ : unit
- method keypress : (Dom.keyEvent -> bool) Ocamljs.jsfun -> unit
+ method keypress : (Dom.keyEvent -> bool) -> unit
method keypress_trigger_ : unit
- method keyup : (Dom.keyEvent -> bool) Ocamljs.jsfun -> unit
+ method keyup : (Dom.keyEvent -> bool) -> unit
method keyup_trigger_ : unit
- method load_event_ : (Dom.event -> bool) Ocamljs.jsfun -> unit
- method mousedown : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseenter : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseleave : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mousemove : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseout : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseover : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseup : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method resize : (Dom.event -> bool) Ocamljs.jsfun -> unit
- method scroll : (Dom.event -> bool) Ocamljs.jsfun -> unit
- method select : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method load_event_ : (Dom.event -> bool) -> unit
+ method mousedown : (Dom.mouseEvent -> bool) -> unit
+ method mouseenter : (Dom.mouseEvent -> bool) -> unit
+ method mouseleave : (Dom.mouseEvent -> bool) -> unit
+ method mousemove : (Dom.mouseEvent -> bool) -> unit
+ method mouseout : (Dom.mouseEvent -> bool) -> unit
+ method mouseover : (Dom.mouseEvent -> bool) -> unit
+ method mouseup : (Dom.mouseEvent -> bool) -> unit
+ method resize : (Dom.event -> bool) -> unit
+ method scroll : (Dom.event -> bool) -> unit
+ method select : (Dom.event -> bool) -> unit
method select_trigger_ : unit
- method submit : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method submit : (Dom.event -> bool) -> unit
method submit_trigger_ : unit
- method unload : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method unload : (Dom.event -> bool) -> unit
(* Effects *)
(* ------- *)
(* Basics *)
method show : unit
- method show_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method show_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method show_ms_ : int -> (unit -> unit) -> unit
+ method show_speed_ : string -> (unit -> unit) -> unit
method hide : unit
- method hide_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method hide_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method hide_ms_ : int -> (unit -> unit) -> unit
+ method hide_speed_ : string -> (unit -> unit) -> unit
method toggle : unit
method toggle_switch_ : bool -> unit
- method toggle_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method toggle_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method toggle_ms_ : int -> (unit -> unit) -> unit
+ method toggle_speed_ : string -> (unit -> unit) -> unit
(* Sliding *)
method slideDown : unit
- method slideDown_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method slideDown_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method slideDown_ms_ : int -> (unit -> unit) -> unit
+ method slideDown_speed_ : string -> (unit -> unit) -> unit
method slideUp : unit
- method slideUp_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method slideUp_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method slideUp_ms_ : int -> (unit -> unit) -> unit
+ method slideUp_speed_ : string -> (unit -> unit) -> unit
method slideToggle : unit
- method slideToggle_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method slideToggle_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method slideToggle_ms_ : int -> (unit -> unit) -> unit
+ method slideToggle_speed_ : string -> (unit -> unit) -> unit
(* Fading *)
method fadeIn : unit
- method fadeIn_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method fadeIn_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method fadeIn_ms_ : int -> (unit -> unit) -> unit
+ method fadeIn_speed_ : string -> (unit -> unit) -> unit
method fadeOut : unit
- method fadeOut_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method fadeOut_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method fadeOut_ms_ : int -> (unit -> unit) -> unit
+ method fadeOut_speed_ : string -> (unit -> unit) -> unit
method fadeTo : int -> float -> unit
- method fadeTo_ms_ : int -> float -> (unit -> unit) Ocamljs.jsfun -> unit
- method fadeTo_speed_ : string -> float -> (unit -> unit) Ocamljs.jsfun -> unit
+ method fadeTo_ms_ : int -> float -> (unit -> unit) -> unit
+ method fadeTo_speed_ : string -> float -> (unit -> unit) -> unit
(* Custom *)
method animate : 'a -> unit
method animate_ms_ :
- 'a -> int -> string -> (unit -> unit) Ocamljs.jsfun -> unit
+ 'a -> int -> string -> (unit -> unit) -> unit
method animate_speed_ :
- 'a -> string -> string -> (unit -> unit) Ocamljs.jsfun -> unit
+ 'a -> string -> string -> (unit -> unit) -> unit
method animate_custom_ : 'a -> 'b -> unit
method stop : bool -> bool -> unit
@@ -341,19 +341,19 @@ object
method load : string -> unit
method load_fn_ :
string -> 'a ->
- (string -> string -> Dom.xMLHttpRequest -> unit) Ocamljs.jsfun -> unit
+ (string -> string -> Dom.xMLHttpRequest -> unit) -> unit
(* Ajax Events *)
method ajaxComplete :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) -> unit
method ajaxError :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> 'b -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> 'b -> unit) -> unit
method ajaxSend :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) Ocamljs.jsfun -> unit
- method ajaxStart : (Dom.event -> unit) Ocamljs.jsfun -> unit
- method ajaxStop : (Dom.event -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) -> unit
+ method ajaxStart : (Dom.event -> unit) -> unit
+ method ajaxStop : (Dom.event -> unit) -> unit
method ajaxSuccess :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) -> unit
(* Misc *)
method serialize : string
@@ -370,7 +370,7 @@ let jQuery_elements = (Ocamljs.var "jQuery" : Dom.element array -> jQuery)
(* Shorthand for $(document).ready() *)
let jQuery_ready func =
(jQuery_element (Dom.document :> Dom.element))
- #ready (Ocamljs.jsfun func)
+ #ready func
(* Invoking Plugins *)
let jQuery_plugin jQuery (name : string) args =
@@ -413,18 +413,18 @@ object
(* Ajax Requests *)
method ajax : 'a -> Dom.xMLHttpRequest
method get :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> 'a -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method get_typed_ :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> string ->
+ string -> 'a -> ('b -> string -> unit) -> string ->
Dom.xMLHttpRequest
method getJSON :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> 'a -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method getScript :
- string -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method post :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> 'a -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method post_typed_ :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> string ->
+ string -> 'a -> ('b -> string -> unit) -> string ->
Dom.xMLHttpRequest
(* Misc Ajax *)
@@ -436,14 +436,14 @@ object
method _get_boxModel : bool
(* Array and Object operations *)
- method each : 'a -> (int -> 'b -> bool) Ocamljs.jsfun -> unit
+ method each : 'a -> (int -> 'b -> bool) -> unit
method extend_obj_ : bool -> 'a -> 'b -> unit
- method grep : 'a array -> (int -> 'a -> bool) Ocamljs.jsfun -> 'a array
+ method grep : 'a array -> (int -> 'a -> bool) -> 'a array
method grep_invert_ :
- 'a array -> (int -> 'a -> bool) Ocamljs.jsfun -> bool -> 'a array
+ 'a array -> (int -> 'a -> bool) -> bool -> 'a array
method makeArray : 'a -> 'b array
- method map : 'a array -> ('a -> 'b) Ocamljs.jsfun -> 'b array
- method map_index_ : 'a array -> ('a -> int -> 'b) Ocamljs.jsfun -> 'b array
+ method map : 'a array -> ('a -> 'b) -> 'b array
+ method map_index_ : 'a array -> ('a -> int -> 'b) -> 'b array
method inArray : 'a -> 'a array -> int
method merge : 'a array -> 'a array -> 'a array
method unique : 'a array -> 'a array
@@ -466,22 +466,3 @@ let jQuery_util = (Ocamljs.var "jQuery" : jQuery_util)
(* Invoking Plugins *)
let jQuery_plugin_static (name : string) =
Ocamljs.hashref jQuery_util name
-
-(* Callbacks *)
-(* --------- *)
-
-external caml_callback2 : ('a1 -> 'a2 -> 'b) -> 'a1 -> 'a2 -> 'b = "caml_callback2"
-external caml_callback3 : ('a1 -> 'a2 -> 'a3 -> 'b) -> 'a1 -> 'a2 -> 'a3 -> 'b = "caml_callback3"
-external caml_callback4 : ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'b = "caml_callback4"
-external caml_callback5 : ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'b) -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'b = "caml_callback5"
-
-external function_ : 'a -> 'b = "$function"
-external this : unit -> 'a = "$this"
-
-(* These functions work like Ocamljs.jsfun* but take "this" as an additional
- first argument, since many jQuery methods pass values to callbacks as
- "this". *)
-let jqfun f = (function_ (fun a -> caml_callback2 f (this ()) a))
-let jqfun2 f = (function_ (fun a b -> caml_callback3 f (this ()) a b))
-let jqfun3 f = (function_ (fun a b c -> caml_callback4 f (this ()) a b c))
-let jqfun4 f = (function_ (fun a b c d -> caml_callback5 f (this ()) a b c d))
View
195 src/jquery/jQuery.mli
@@ -27,7 +27,7 @@ object
(* ----------- *)
(* jQuery Object Accessors *)
- method each : (int -> Dom.element -> bool) Ocamljs.jsfun -> unit
+ method each : (int -> Dom.element -> bool) -> unit
method size : int
method _get_length : int
method _get_selector : string
@@ -41,9 +41,9 @@ object
method data : string -> 'a
method data_store_ : string -> 'a -> unit
method removeData : string -> unit
- method queue : string -> (unit -> unit) Ocamljs.jsfun array
- method queue_enqueue_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
- method queue_replace_ : string -> (unit -> unit) Ocamljs.jsfun array -> unit
+ method queue : string -> (unit -> unit) array
+ method queue_enqueue_ : string -> (unit -> unit) -> unit
+ method queue_replace_ : string -> (unit -> unit) array -> unit
method dequeue : string -> unit
(* Attributes *)
@@ -82,9 +82,9 @@ object
(* Filtering *)
method eq : int -> jQuery
method filter : string -> jQuery
- method filter_fn_ : (int -> bool) Ocamljs.jsfun -> jQuery
+ method filter_fn_ : (int -> bool) -> jQuery
method is : string -> bool
- method map : (int -> Dom.element -> 'a) Ocamljs.jsfun -> jQuery
+ method map : (int -> Dom.element -> 'a) -> jQuery
method not : string -> jQuery
method not_element_ : Dom.element -> jQuery
method not_elements_ : Dom.element array -> jQuery
@@ -196,13 +196,13 @@ object
(* ------ *)
(* Page Load *)
- method ready : ((string -> jQuery) -> unit) Ocamljs.jsfun -> unit
+ method ready : ((string -> jQuery) -> unit) -> unit
(* Event Handling *)
- method bind : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
- method bind_data_ : string -> 'a -> (Dom.event -> bool) Ocamljs.jsfun -> unit
- method one : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
- method one_data_ : string -> 'a -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method bind : string -> (Dom.event -> bool) -> unit
+ method bind_data_ : string -> 'a -> (Dom.event -> bool) -> unit
+ method one : string -> (Dom.event -> bool) -> unit
+ method one_data_ : string -> 'a -> (Dom.event -> bool) -> unit
method trigger : string -> unit
method trigger_data_ : string -> 'a array -> unit
method trigger_event_ : Dom.event -> unit
@@ -216,121 +216,121 @@ object
method triggerHandler_obj_ : 'a -> unit
method triggerHandler_objdata_ : 'a -> 'b array -> unit
method unbind : string -> unit
- method unbind_fn_ : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method unbind_fn_ : string -> (Dom.event -> bool) -> unit
method unbind_event_ : Dom.event -> unit
method unbind_eventfn_ :
- Dom.event -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ Dom.event -> (Dom.event -> bool) -> unit
method unbind_obj_ : 'a -> unit
- method unbind_objfn_ : 'a -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method unbind_objfn_ : 'a -> (Dom.event -> bool) -> unit
method unbind_all_ : unit
(* Live Events *)
- method live : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method live : string -> (Dom.event -> bool) -> unit
method die : string -> unit
- method die_fn_ : string -> (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method die_fn_ : string -> (Dom.event -> bool) -> unit
method die_all_ : unit
(* Interaction Helpers *)
method hover :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_2_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_3_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_4_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
method toggle_5_ :
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun ->
- (Dom.mouseEvent -> unit) Ocamljs.jsfun -> unit
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) ->
+ (Dom.mouseEvent -> unit) -> unit
(* Event Helpers *)
- method blur : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method blur : (Dom.event -> bool) -> unit
method blur_trigger_ : unit
- method change : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method change : (Dom.event -> bool) -> unit
method change_trigger_ : unit
- method click : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
+ method click : (Dom.mouseEvent -> bool) -> unit
method click_trigger_ : unit
- method dblclick : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
+ method dblclick : (Dom.mouseEvent -> bool) -> unit
method dblclick_trigger_ : unit
- method error : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method error : (Dom.event -> bool) -> unit
method error_trigger_ : unit
- method focus : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method focus : (Dom.event -> bool) -> unit
method focus_trigger_ : unit
- method keydown : (Dom.keyEvent -> bool) Ocamljs.jsfun -> unit
+ method keydown : (Dom.keyEvent -> bool) -> unit
method keydown_trigger_ : unit
- method keypress : (Dom.keyEvent -> bool) Ocamljs.jsfun -> unit
+ method keypress : (Dom.keyEvent -> bool) -> unit
method keypress_trigger_ : unit
- method keyup : (Dom.keyEvent -> bool) Ocamljs.jsfun -> unit
+ method keyup : (Dom.keyEvent -> bool) -> unit
method keyup_trigger_ : unit
- method load_event_ : (Dom.event -> bool) Ocamljs.jsfun -> unit
- method mousedown : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseenter : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseleave : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mousemove : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseout : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseover : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method mouseup : (Dom.mouseEvent -> bool) Ocamljs.jsfun -> unit
- method resize : (Dom.event -> bool) Ocamljs.jsfun -> unit
- method scroll : (Dom.event -> bool) Ocamljs.jsfun -> unit
- method select : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method load_event_ : (Dom.event -> bool) -> unit
+ method mousedown : (Dom.mouseEvent -> bool) -> unit
+ method mouseenter : (Dom.mouseEvent -> bool) -> unit
+ method mouseleave : (Dom.mouseEvent -> bool) -> unit
+ method mousemove : (Dom.mouseEvent -> bool) -> unit
+ method mouseout : (Dom.mouseEvent -> bool) -> unit
+ method mouseover : (Dom.mouseEvent -> bool) -> unit
+ method mouseup : (Dom.mouseEvent -> bool) -> unit
+ method resize : (Dom.event -> bool) -> unit
+ method scroll : (Dom.event -> bool) -> unit
+ method select : (Dom.event -> bool) -> unit
method select_trigger_ : unit
- method submit : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method submit : (Dom.event -> bool) -> unit
method submit_trigger_ : unit
- method unload : (Dom.event -> bool) Ocamljs.jsfun -> unit
+ method unload : (Dom.event -> bool) -> unit
(* Effects *)
(* ------- *)
(* Basics *)
method show : unit
- method show_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method show_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method show_ms_ : int -> (unit -> unit) -> unit
+ method show_speed_ : string -> (unit -> unit) -> unit
method hide : unit
- method hide_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method hide_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method hide_ms_ : int -> (unit -> unit) -> unit
+ method hide_speed_ : string -> (unit -> unit) -> unit
method toggle : unit
method toggle_switch_ : bool -> unit
- method toggle_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method toggle_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method toggle_ms_ : int -> (unit -> unit) -> unit
+ method toggle_speed_ : string -> (unit -> unit) -> unit
(* Sliding *)
method slideDown : unit
- method slideDown_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method slideDown_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method slideDown_ms_ : int -> (unit -> unit) -> unit
+ method slideDown_speed_ : string -> (unit -> unit) -> unit
method slideUp : unit
- method slideUp_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method slideUp_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method slideUp_ms_ : int -> (unit -> unit) -> unit
+ method slideUp_speed_ : string -> (unit -> unit) -> unit
method slideToggle : unit
- method slideToggle_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method slideToggle_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method slideToggle_ms_ : int -> (unit -> unit) -> unit
+ method slideToggle_speed_ : string -> (unit -> unit) -> unit
(* Fading *)
method fadeIn : unit
- method fadeIn_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method fadeIn_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method fadeIn_ms_ : int -> (unit -> unit) -> unit
+ method fadeIn_speed_ : string -> (unit -> unit) -> unit
method fadeOut : unit
- method fadeOut_ms_ : int -> (unit -> unit) Ocamljs.jsfun -> unit
- method fadeOut_speed_ : string -> (unit -> unit) Ocamljs.jsfun -> unit
+ method fadeOut_ms_ : int -> (unit -> unit) -> unit
+ method fadeOut_speed_ : string -> (unit -> unit) -> unit
method fadeTo : int -> float -> unit
- method fadeTo_ms_ : int -> float -> (unit -> unit) Ocamljs.jsfun -> unit
- method fadeTo_speed_ : string -> float -> (unit -> unit) Ocamljs.jsfun -> unit
+ method fadeTo_ms_ : int -> float -> (unit -> unit) -> unit
+ method fadeTo_speed_ : string -> float -> (unit -> unit) -> unit
(* Custom *)
method animate : 'a -> unit
method animate_ms_ :
- 'a -> int -> string -> (unit -> unit) Ocamljs.jsfun -> unit
+ 'a -> int -> string -> (unit -> unit) -> unit
method animate_speed_ :
- 'a -> string -> string -> (unit -> unit) Ocamljs.jsfun -> unit
+ 'a -> string -> string -> (unit -> unit) -> unit
method animate_custom_ : 'a -> 'b -> unit
method stop : bool -> bool -> unit
@@ -341,19 +341,19 @@ object
method load : string -> unit
method load_fn_ :
string -> 'a ->
- (string -> string -> Dom.xMLHttpRequest -> unit) Ocamljs.jsfun -> unit
+ (string -> string -> Dom.xMLHttpRequest -> unit) -> unit
(* Ajax Events *)
method ajaxComplete :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) -> unit
method ajaxError :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> 'b -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> 'b -> unit) -> unit
method ajaxSend :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) Ocamljs.jsfun -> unit
- method ajaxStart : (Dom.event -> unit) Ocamljs.jsfun -> unit
- method ajaxStop : (Dom.event -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) -> unit
+ method ajaxStart : (Dom.event -> unit) -> unit
+ method ajaxStop : (Dom.event -> unit) -> unit
method ajaxSuccess :
- (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) Ocamljs.jsfun -> unit
+ (Dom.event -> Dom.xMLHttpRequest -> 'a -> unit) -> unit
(* Misc *)
method serialize : string
@@ -409,18 +409,18 @@ object
(* Ajax Requests *)
method ajax : 'a -> Dom.xMLHttpRequest
method get :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> 'a -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method get_typed_ :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> string ->
+ string -> 'a -> ('b -> string -> unit) -> string ->
Dom.xMLHttpRequest
method getJSON :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> 'a -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method getScript :
- string -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method post :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> Dom.xMLHttpRequest
+ string -> 'a -> ('b -> string -> unit) -> Dom.xMLHttpRequest
method post_typed_ :
- string -> 'a -> ('b -> string -> unit) Ocamljs.jsfun -> string ->
+ string -> 'a -> ('b -> string -> unit) -> string ->
Dom.xMLHttpRequest
(* Misc Ajax *)
@@ -432,14 +432,14 @@ object
method _get_boxModel : bool
(* Array and Object operations *)
- method each : 'a -> (int -> 'b -> bool) Ocamljs.jsfun -> unit
+ method each : 'a -> (int -> 'b -> bool) -> unit
method extend_obj_ : bool -> 'a -> 'b -> unit
- method grep : 'a array -> (int -> 'a -> bool) Ocamljs.jsfun -> 'a array
+ method grep : 'a array -> (int -> 'a -> bool) -> 'a array
method grep_invert_ :
- 'a array -> (int -> 'a -> bool) Ocamljs.jsfun -> bool -> 'a array
+ 'a array -> (int -> 'a -> bool) -> bool -> 'a array
method makeArray : 'a -> 'b array
- method map : 'a array -> ('a -> 'b) Ocamljs.jsfun -> 'b array
- method map_index_ : 'a array -> ('a -> int -> 'b) Ocamljs.jsfun -> 'b array
+ method map : 'a array -> ('a -> 'b) -> 'b array
+ method map_index_ : 'a array -> ('a -> int -> 'b) -> 'b array
method inArray : 'a -> 'a array -> int
method merge : 'a array -> 'a array -> 'a array
method unique : 'a array -> 'a array
@@ -461,14 +461,3 @@ val jQuery_util : jQuery_util
(* Invoking Plugins *)
val jQuery_plugin_static : string -> 'a
-
-(* Callbacks *)
-(* --------- *)
-
-(* These functions work like Ocamljs.jsfun* but take "this" as an additional
- first argument, since many jQuery methods pass values to callbacks as
- "this". *)
-val jqfun : ('this -> 'a -> 'b) -> ('a -> 'b) Ocamljs.jsfun
-val jqfun2 : ('this -> 'a1 -> 'a2 -> 'b) -> ('a1 -> 'a2 -> 'b) Ocamljs.jsfun
-val jqfun3 : ('this -> 'a1 -> 'a2 -> 'a3 -> 'b) -> ('a1 -> 'a2 -> 'a3 -> 'b) Ocamljs.jsfun
-val jqfun4 : ('this -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) Ocamljs.jsfun
View
4 src/lwt-js/lwt_dom.ml
@@ -21,7 +21,7 @@
let sleep t =
let res = Lwt.wait () in
let timeout () = Lwt.wakeup res () in
- ignore (Dom.window#setTimeout (Ocamljs.jsfun timeout) t);
+ ignore (Dom.window#setTimeout timeout t);
res
let yield () = sleep 0.
@@ -44,6 +44,6 @@ let http_request ?(headers=[]) meth url =
if not !fired then Lwt.wakeup res r;
fired := true
end in
- r#_set_onreadystatechange (Ocamljs.jsfun onreadystatechange);
+ r#_set_onreadystatechange onreadystatechange;
r#send (match body with Some body -> body | _ -> Ocamljs.null ());
res
View
12 src/mozilla/mozilla.ml
@@ -157,8 +157,8 @@ struct
inherit supports
method addEventListener : string -> #dOMEventListener -> bool -> unit
method removeEventListener : string -> #dOMEventListener -> bool -> unit
- method addEventListener_fun_ : string -> (#dOMEvent -> unit) Ocamljs.jsfun -> bool -> unit
- method removeEventListener_fun_ : string -> (#dOMEvent -> unit) Ocamljs.jsfun -> bool -> unit
+ method addEventListener_fun_ : string -> (#dOMEvent -> unit) -> bool -> unit
+ method removeEventListener_fun_ : string -> (#dOMEvent -> unit) -> bool -> unit
method dispatchEvent : #dOMEvent -> bool
end
@@ -265,9 +265,9 @@ struct
class type dOMJSWindow =
object
inherit supports
- method setTimeout : (unit -> unit) Ocamljs.jsfun -> float -> int
+ method setTimeout : (unit -> unit) -> float -> int
method clearTimeout : int -> unit
- method setInterval : (unit -> unit) Ocamljs.jsfun -> float -> int
+ method setInterval : (unit -> unit) -> float -> int
method clearInterval : int -> unit
method openDialog : string -> string -> string -> unit
end
@@ -553,8 +553,8 @@ struct
class type xMLHttpRequest =
object
inherit supports
- method _set_onreadystatechange : (unit -> unit) Ocamljs.jsfun -> unit
- method _set_onload : (unit -> unit) Ocamljs.jsfun -> unit
+ method _set_onreadystatechange : (unit -> unit) -> unit
+ method _set_onload : (unit -> unit) -> unit
method _open : string -> string -> bool -> unit
method setRequestHeader : string -> string -> unit
method getResponseHeader : string -> string
View
12 src/mozilla/mozilla.mli
@@ -157,8 +157,8 @@ sig
inherit supports
method addEventListener : string -> #dOMEventListener -> bool -> unit
method removeEventListener : string -> #dOMEventListener -> bool -> unit
- method addEventListener_fun_ : string -> (#dOMEvent -> unit) Ocamljs.jsfun -> bool -> unit
- method removeEventListener_fun_ : string -> (#dOMEvent -> unit) Ocamljs.jsfun -> bool -> unit
+ method addEventListener_fun_ : string -> (#dOMEvent -> unit) -> bool -> unit
+ method removeEventListener_fun_ : string -> (#dOMEvent -> unit) -> bool -> unit
method dispatchEvent : #dOMEvent -> bool
end
@@ -265,9 +265,9 @@ sig
class type dOMJSWindow =
object
inherit supports
- method setTimeout : (unit -> unit) Ocamljs.jsfun -> float -> int
+ method setTimeout : (unit -> unit) -> float -> int
method clearTimeout : int -> unit
- method setInterval : (unit -> unit) Ocamljs.jsfun -> float -> int
+ method setInterval : (unit -> unit) -> float -> int
method clearInterval : int -> unit
method openDialog : string -> string -> string -> unit
end
@@ -553,8 +553,8 @@ sig
class type xMLHttpRequest =
object
inherit supports
- method _set_onreadystatechange : (unit -> unit) Ocamljs.jsfun -> unit
- method _set_onload : (unit -> unit) Ocamljs.jsfun -> unit
+ method _set_onreadystatechange : (unit -> unit) -> unit
+ method _set_onload : (unit -> unit) -> unit
method _open : string -> string -> bool -> unit
method setRequestHeader : string -> string -> unit
method getResponseHeader : string -> string
View
10 src/ocamljs/ocamljs.ml
@@ -51,8 +51,6 @@ let nullable_of_option x =
let is_null a = a = null ()
-type 'a jsfun = 'a
-
module Inline =
struct
module Jslib_ast =
@@ -68,11 +66,3 @@ struct
let _loc = ()
end
-
-open Inline
-
-let jsfun f = << function (a) { return _m($f$, this, [a]); } >>
-let jsfun2 f = << function (a1, a2) { return _m($f$, this, [a1, a2]); } >>
-let jsfun3 f = << function (a1, a2, a3) { return _m($f$, this, [a1, a2, a3]); } >>
-let jsfun4 f = << function (a1, a2, a3, a4) { return _m($f$, this, [a1, a2, a3, a4]); } >>
-let jsfun5 f = << function (a1, a2, a3, a4, a5) { return _m($f$, this, [a1, a2, a3, a4, a5]); } >>
View
7 src/ocamljs/ocamljs.mli
@@ -40,13 +40,6 @@ val option_of_nullable : 'a -> 'a option
val nullable_of_option : 'a option -> 'a
val is_null : 'a -> bool
-type 'a jsfun
-val jsfun : ('a -> 'b) -> ('a -> 'b) jsfun
-val jsfun2 : ('a1 -> 'a2 -> 'b) -> ('a1 -> 'a2 -> 'b) jsfun
-val jsfun3 : ('a1 -> 'a2 -> 'a3 -> 'b) -> ('a1 -> 'a2 -> 'a3 -> 'b) jsfun
-val jsfun4 : ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) jsfun
-val jsfun5 : ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'b) -> ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'b) jsfun
-
module Inline :
sig
module Jslib_ast :
View
19 src/stdlib/support.js
@@ -128,9 +128,13 @@ function ___m(m, t, a)
}
@end @*/
+var $in_tail = false;
+
// tail call
function __m(m, t, args)
{
+ if (m.$oc && !$in_tail)
+ return _m(m, t, args);
args.$m = m;
args.$t = t;
args.$tr = true;
@@ -141,10 +145,17 @@ function __(t, args) { return __m(t, t, args); }
// non tail call
function _m(m, t, args)
{
- var v = __m(m, t, args);
- while (v && v.$tr)
- v = ___m(v.$m, v.$t, v);
- return v;
+ var old_in_tail = $in_tail;
+ $in_tail = true;
+ try {
+ var v = __m(m, t, args);
+ while (v && v.$tr)
+ v = ___m(v.$m, v.$t, v);
+ return v;
+ }
+ finally {
+ $in_tail = old_in_tail;
+ }
}
function _(t, args) { return _m(t, t, args); }
View
1 test/ocamljs/_tags
@@ -1 +1,2 @@
<*> : pkg_ounit-js
+<tail_calls.ml> : syntax_camlp4o,pkg_jslib.inline,pkg_ocamljs
View
1 test/ocamljs/main.ml
@@ -15,6 +15,7 @@ let tests = "Ocamljs" >::: [
Oo_this_bug.tests;
Oo_virtual.tests;
Raiseargs.tests;
+ Tail_calls.tests;
]
;;
View
39 test/ocamljs/tail_calls.ml
@@ -0,0 +1,39 @@
+open OUnit
+open Ocamljs.Inline
+
+let tests = "Tail_calls" >::: [
+ "enough recursion" >:: begin fun () ->
+ let rec loop = function
+ | 0 -> true
+ | n -> loop (n - 1) in
+ (* SpiderMonkey has 999 frame limit *)
+ assert_bool "" (loop 10000);
+ end;
+
+ "tail call from js callback" >:: begin fun () ->
+ (* simulate a callback by setting $in_tail false *)
+ let foo () = 3 in
+ let bar () = foo () in
+ let baz = 0 in
+ <:stmt<
+ $$in_tail = false;
+ $exp:baz$ = $bar$ ();
+ >>;
+ assert_equal baz 3
+ end;
+
+ (*
+ don't have a good idea how to support this case. maybe we could
+ explicitly check whether the previous function on the stack is _m?
+
+ "tail call from js" >:: begin fun () ->
+ let foo () = 3 in
+ let bar () = foo () in
+ let baz = 0 in
+ <:stmt<
+ $exp:baz$ = $bar$ ();
+ >>;
+ assert_equal baz 3
+ end;
+ *)
+]

0 comments on commit 198a8da

Please sign in to comment.