Closed yeputons closed 5 years ago
This is a known bug, but thanks for creating the issue, we will close this when it's eventually fixed.
As a workaround you can simply use [[cheerp::jsexport]]
to make C++ functions available on the JS side.
This issue is fixed in current master
Example code:
I expect it to either produce a compilation error or print
1 2 3 10000
. However, when compiled with"C:\cheerp\bin\clang++.exe" -target cheerp -cheerp-pretty-code -O2 -o a.js a.cpp
it prints:I think
cheerpCreateClosure*
are fishy: they create a closure which only takes one parameter:The code works as expected after modifying it manually to
Note that this uses spread syntax from ECMAScript2015, so you may want to rewrite it with
Function.apply
instead.