Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
c00a3772
Commit
c00a3772
authored
May 23, 2014
by
Stephane Glondu
Browse files
More OCaml-ish type for alert binding
parent
081e6d52
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tool/tool_js.ml
View file @
c00a3772
...
...
@@ -23,14 +23,15 @@ open Platform
let
document
=
Dom_html
.
window
##
document
let
alert
(
s
:
Js
.
js_string
Js
.
t
)
:
unit
=
Js
.
Unsafe
.
fun_call
(
Js
.
Unsafe
.
variable
"alert"
)
[
|
Js
.
Unsafe
.
inject
s
|
]
let
alert
s
=
let
open
Js
.
Unsafe
in
fun_call
(
variable
"alert"
)
[
|
s
|>
Js
.
string
|>
inject
|
]
let
install_handler
(
id
,
handler
)
=
let
f
_
=
begin
try
handler
()
with
e
->
let
msg
=
"Unexpected error: "
^
Printexc
.
to_string
e
in
alert
(
Js
.
string
msg
)
alert
msg
end
;
Js
.
_false
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment