Files
Nim/tests/js/test1.nim
Simon Hafner 1785c6877b EcmaScript => JS. Fixes #330
No one calls it EcmaScript anymore.
2013-02-15 11:08:30 -06:00

24 lines
390 B
Nim

discard """
cmd: "nimrod js --hints:on $# $#"
output: "1261129"
"""
# This file tests the JavaScript generator
import
dom, strutils
var
inputElement = "1123"
proc OnButtonClick(inputElement: string) {.exportc.} =
let v = $inputElement
if v.allCharsInSet(whiteSpace):
echo "only whitespace, hu?"
else:
var x = parseInt(v)
echo x*x
onButtonClick(inputElement)