JS codegen improvements; barely usable now
This commit is contained in:
parent
fe285b354d
commit
f2af2fb478
4 changed files with 71 additions and 25 deletions
23
tests/js/test1.nim
Normal file
23
tests/js/test1.nim
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
discard """
|
||||
cmd: "nimrod js --hints:on $# $#"
|
||||
output: "1261129"
|
||||
"""
|
||||
|
||||
# This file tests the ECMAScript 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)
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ proc runJsTests(r: var TResults, options: string) =
|
|||
runSingleTest(r, filename, options & " -d:nodejs", targetJS)
|
||||
runSingleTest(r, filename, options & " -d:nodejs -d:release", targetJS)
|
||||
|
||||
# tactiontable, texceptions, texcpt1, texcsub, tfinally, tfinally2,
|
||||
# texceptions, texcpt1, texcsub, tfinally, tfinally2,
|
||||
# tfinally3
|
||||
for t in os.walkFiles("tests/js/t*.nim"):
|
||||
test(t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue