aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/typename_runme.js
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/javascript/typename_runme.js')
-rw-r--r--Examples/test-suite/javascript/typename_runme.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/typename_runme.js b/Examples/test-suite/javascript/typename_runme.js
new file mode 100644
index 000000000..48434ec7c
--- /dev/null
+++ b/Examples/test-suite/javascript/typename_runme.js
@@ -0,0 +1,12 @@
+var typename = require("typename");
+f = new typename.Foo();
+b = new typename.Bar();
+
+x = typename.twoFoo(f);
+if (typeof x !== 'number') {
+ throw new Error("Wrong return type (FloatType) !");
+}
+y = typename.twoBar(b);
+if (typeof y !== 'number') {
+ throw new Error("Wrong return type (IntType)!");
+}