aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/js.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux11
-rw-r--r--new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux12
3 files changed, 4 insertions, 21 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js.lux b/new-luxc/source/luxc/lang/translation/js.lux
index 063c01e25..c0cf2d0dd 100644
--- a/new-luxc/source/luxc/lang/translation/js.lux
+++ b/new-luxc/source/luxc/lang/translation/js.lux
@@ -332,7 +332,7 @@
_ (Appendable::append [(:! CharSequence (format module-code "\n"))]
program-buffer)]]
(wrap (ioC.write target
- (format module "/" module-js-name)
+ (format (module-name module) "/" module-js-name)
(|> module-code
(String::getBytes ["UTF-8"])
e.assume)))))
diff --git a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
index 14329e0dd..8b45557cd 100644
--- a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
@@ -354,14 +354,9 @@
Trinary
(format subjectJS ".replace(" paramJS "," extraJS ")"))
-(do-template [<name> <method>]
- [(def: (<name> [textJS partJS startJS])
- Trinary
- (format <method> "(" textJS "," partJS "," startJS ")"))]
-
- [text//index runtimeT.text//index]
- [text//last-index runtimeT.text//last-index]
- )
+(def: (text//index [textJS partJS startJS])
+ Trinary
+ (format runtimeT.text//index "(" textJS "," partJS "," startJS ")"))
## [[Math]]
(do-template [<name> <method>]
diff --git a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
index 21aa8f983..2104dbf81 100644
--- a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
@@ -752,17 +752,6 @@
"}"))
"})"))
-(runtime: text//last-index "lastIndex"
- (format "(function " @ "(text,part,start) {"
- "var idx = text.lastIndexOf(part," int//to-number "(start));"
- (format (format "if(idx === -1) {"
- "return " none ";"
- "}")
- (format "else {"
- (format "return " (some (format int//from-number "(idx)")) ";")
- "}"))
- "})"))
-
(runtime: text//clip "clip"
(format "(function " @ "(text,from,to) {"
(format "if(from.L > text.length || to.L > text.length) {"
@@ -802,7 +791,6 @@
(def: runtime//text
Runtime
(format __text//index
- __text//last-index
__text//clip
__text//replace-all
__text//char