From ca219fa91b1cccb72ccd5a7250072588e1b5a74c Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Wed, 11 Nov 2020 21:20:53 +0700 Subject: [PATCH] Add reproducer of Binaryen bug --- .../src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt index 9f01f53fa..d0a57c814 100644 --- a/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt +++ b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt @@ -63,7 +63,7 @@ internal sealed class WasmBuilder(val binaryenType: Type, val kmathAlgebra: A ) setOptimizeLevel(3) -// optimizeFunction("executable") + optimizeFunction("executable") addFunctionExport("executable", "executable") val res = emitBinary() dispose() @@ -74,7 +74,7 @@ internal sealed class WasmBuilder(val binaryenType: Type, val kmathAlgebra: A val i = Instance(c, js("{}") as Any) return Expression { args -> - val params = keys.map { StringSymbol(it) }.map { args.getValue(it) }.toTypedArray() + val params = keys.map(::StringSymbol).map(args::getValue).toTypedArray() keys.clear() spreader(i.exports.asDynamic().executable, params) as T }