dead code elimination for JS backend; JS improvements (but doesn't work yet)
This commit is contained in:
parent
2900ceae35
commit
ee1bcb6414
7 changed files with 213 additions and 104 deletions
|
|
@ -13,8 +13,12 @@ var
|
|||
inputElement {.importc: "document.form1.input1", nodecl.}: ref TElement
|
||||
|
||||
proc OnButtonClick() {.exportc.} =
|
||||
var x = parseInt($inputElement.value)
|
||||
echo x*x
|
||||
let v = $inputElement.value
|
||||
if v.allCharsInSet(whiteSpace):
|
||||
echo "only whitespace, hu?"
|
||||
else:
|
||||
var x = parseInt(v)
|
||||
echo x*x
|
||||
|
||||
proc OnLoad() {.exportc.} =
|
||||
echo "Welcome! Please take your time to fill in this formular!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue