From 1699d7c2a4c3f3f2ae604dc1ddd29aa34d69ceb1 Mon Sep 17 00:00:00 2001 From: Alexander Ivanov Date: Fri, 1 Dec 2017 16:42:10 +0200 Subject: Implement codegenDecl for js (#6851) --- tests/js/tcodegendeclproc.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/js/tcodegendeclproc.nim (limited to 'tests/js/tcodegendeclproc.nim') diff --git a/tests/js/tcodegendeclproc.nim b/tests/js/tcodegendeclproc.nim new file mode 100644 index 000000000..3acf0bc13 --- /dev/null +++ b/tests/js/tcodegendeclproc.nim @@ -0,0 +1,11 @@ +discard """ + output: ''' +-1 +8 +''' + ccodecheck: "'console.log(-1); function fac_' \\d+ '(n_' \\d+ ')'" +""" +proc fac(n: int): int {.codegenDecl: "console.log(-1); function $2($3)".} = + return n + +echo fac(8) -- cgit 1.4.1-2-gfad0