summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-12-11 15:58:23 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2012-12-11 15:58:23 -0500
commit92b7e9f1eda84b05bc50f3052913d33b20e067b7 (patch)
treea3420f76f92ec80cb6ca0d78438ea7ec9cfae0df /tests
parent7ee7be7c9fcb86e63aadb8f3a21439961f17b63d (diff)
Ignore polymorphism in JavaScript calls to custom FFI functions, allowing a kind of simple dynamic typing (unsafe, of course)
Diffstat (limited to 'tests')
-rw-r--r--tests/polyjs.ur5
-rw-r--r--tests/polyjs.urp5
-rw-r--r--tests/polyjsFfi.urs2
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/polyjs.ur b/tests/polyjs.ur
new file mode 100644
index 00000000..fe10080b
--- /dev/null
+++ b/tests/polyjs.ur
@@ -0,0 +1,5 @@
+open PolyjsFfi
+
+fun main () : transaction page = return <xml><body>
+ <button onclick={fn _ => alert (one "hi" ^ two "bye")}/>
+</body></xml>
diff --git a/tests/polyjs.urp b/tests/polyjs.urp
new file mode 100644
index 00000000..489bd68b
--- /dev/null
+++ b/tests/polyjs.urp
@@ -0,0 +1,5 @@
+ffi polyjsFfi
+jsFunc PolyjsFfi.one=one
+jsFunc PolyjsFfi.two=two
+
+polyjs
diff --git a/tests/polyjsFfi.urs b/tests/polyjsFfi.urs
new file mode 100644
index 00000000..a2be8909
--- /dev/null
+++ b/tests/polyjsFfi.urs
@@ -0,0 +1,2 @@
+val one : a ::: Type -> a -> a
+val two : a ::: Type -> b ::: Type -> a -> b