diff options
author | Araq <rumpf_a@web.de> | 2013-03-24 13:05:19 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-03-24 13:05:19 +0100 |
commit | ba80bd807ca0f8562974aa4deae2b956cf6bf6d2 (patch) | |
tree | baaef873a2b47ea67715a14a518f07297bece06b /tests/js | |
parent | dcb0f243de104635ab4b5d3824cb665635c34f1e (diff) | |
download | Nim-ba80bd807ca0f8562974aa4deae2b956cf6bf6d2.tar.gz |
fixes #376
Diffstat (limited to 'tests/js')
-rw-r--r-- | tests/js/test2.nim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/js/test2.nim b/tests/js/test2.nim new file mode 100644 index 000000000..1342ed15d --- /dev/null +++ b/tests/js/test2.nim @@ -0,0 +1,23 @@ +discard """ + cmd: "nimrod js --hints:on -r $# $#" + output: '''foo +js 3.14''' +""" + +# This file tests the JavaScript generator + +# #335 +proc foo() = + var bar = "foo" + proc baz() = + echo bar + baz() +foo() + +# #376 +when not defined(JS): + proc foo(val: float): string = "no js " & $val +else: + proc foo(val: float): string = "js " & $val + +echo foo(3.14) |