Fix some problems with jsCode function

1. Fix a bug in frontend when passing non-String constant led to exception
2. Fix a bug in backend when passing non-JetStringTeplate string constant led to exception
3. Avoid recomputing constant argument in backend
This commit is contained in:
Pavel V. Talanov
2015-07-20 18:18:40 +03:00
parent b4825ada69
commit add8387141
5 changed files with 49 additions and 25 deletions
@@ -0,0 +1,14 @@
package foo
fun box(): String {
var c: Int = 0
val code = "c = 3"
js(code)
assertEquals(3, c)
js(("c = 5"))
assertEquals(5, c)
return "OK"
}