Provide dynamic operations currying for Algebra<T> instead of eager calls and add JS code generation support #162

Merged
CommanderTvis merged 44 commits from feature/dynamic-ops-currying into dev 2021-01-05 16:36:51 +03:00
Showing only changes of commit d521fa0d8d - Show all commits

View File

@ -42,7 +42,7 @@ internal class ESTreeBuilder<T>(val bodyCallback: ESTreeBuilder<T>.() -> BaseExp
value == null || jsTypeOf(value) == "number" || jsTypeOf(value) == "string" || jsTypeOf(value) == "boolean" ->
SimpleLiteral(value)
jsType(value) == "undefined" -> Identifier("undefined")
jsTypeOf(value) == "undefined" -> Identifier("undefined")
else -> {
val idx = if (value in constants) constants.indexOf(value) else constants.also { it += value }.lastIndex