You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible avoid binding js to use unsafe-eval syntax? #20994
I'd note that the bindings will be much slower without eval. Whether that matters is how frequently the JS->C++ code path is used, but there's a new option -sEMBIND_AOT to generate the binding glue code during compilation and keep the speed of the old bindings.
Activity
brendandahl commentedon Jan 3, 2024
-sDYNAMIC_EXECUTION=0emscripten/src/settings.js
Lines 1302 to 1333 in 25308a1
yunsii commentedon Jan 4, 2024
@brendandahl Thanks for your quick response, I will have a try today and the
settings.jsI will read carefully.yunsii commentedon Jan 5, 2024
@brendandahl Thanks very much, it works well in my browser extension example project https://github.com/yunsii/browser-extension-with-fasttext.wasm.js
brendandahl commentedon Jan 5, 2024
I'd note that the bindings will be much slower without eval. Whether that matters is how frequently the JS->C++ code path is used, but there's a new option -sEMBIND_AOT to generate the binding glue code during compilation and keep the speed of the old bindings.
yunsii commentedon Jan 6, 2024
Yes, I've noticed this problem, but
-sDYNAMIC_EXECUTIONcomment:emscripten/src/settings.js
Lines 1316 to 1317 in 249cf8c
-sEMBIND_AOTinfomation.I will try to use
-sEMBIND_AOTtoday.yunsii commentedon Jan 6, 2024
After add
-sEMBIND_AOToption, encounter runtime error:brendandahl commentedon Jan 8, 2024
Can you set a breakpoint or log what
humanNameis incraftInvokerFunctionand also share the c++ function and what the binding is for it?yunsii commentedon Jan 9, 2024
C function here: https://github.com/facebookresearch/fastText/blob/6c2204ba66776b700095ff73e3e599a908ffd9c3/src/fasttext.h#L105
For the convient, my reproduction repo with branch reproduction: https://github.com/yunsii/fasttext.wasm.js/blob/reproduction/xmake.lua#L26
embind: Fix method pointers for AOT JS generation.
embind: Fix method pointers for AOT JS generation.
embind: Fix method pointers for AOT JS generation.
embind: Fix method pointers for AOT JS generation.
embind: Fix method pointers for AOT JS generation.
embind: Fix method pointers for AOT JS generation. (#21168)
Merge upstream 3.1.56 (#64)
Remove the need for 'unsafe-eval' in CSP