aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/js/function.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/js/function.jvm.lux8
1 files changed, 4 insertions, 4 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js/function.jvm.lux b/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
index b3c6761cd..ef5ea668e 100644
--- a/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/function.jvm.lux
@@ -21,7 +21,7 @@
(wrap (format functionJS "(" (text.join-with "," argsJS+) ")"))))
(def: (input-declaration register)
- (format "var " (referenceT.variable (n/inc register)) " = arguments[" (|> register nat-to-int %i) "];"))
+ (format "var " (referenceT.variable (inc register)) " = arguments[" (|> register .int %i) "];"))
(def: (with-closure inits function)
(-> (List Expression) Expression Expression)
@@ -30,7 +30,7 @@
(list)
_
- (|> (list.n/range +0 (n/dec (list.size inits)))
+ (|> (list.n/range +0 (dec (list.size inits)))
(list/map referenceT.closure)))]
(format "(function(" (text.join-with "," closure) ") {"
"return " function
@@ -47,11 +47,11 @@
(//.with-anchor [function-name +1]
(translate bodyS))))
closureJS+ (monad.map @ referenceT.translate-variable env)
- #let [args-initsJS+ (|> (list.n/range +0 (n/dec arity))
+ #let [args-initsJS+ (|> (list.n/range +0 (dec arity))
(list/map input-declaration)
(text.join-with ""))
selfJS (format "var " (referenceT.variable +0) " = " function-name ";")
- arityJS (|> arity nat-to-int %i)]]
+ arityJS (|> arity .int %i)]]
(wrap (<| (with-closure closureJS+)
(format "(function " function-name "() {"
"\"use strict\";"