mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
23 lines
354 B
Nim
23 lines
354 B
Nim
discard """
|
|
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)
|
|
|