[[cheerp::genericjs]]
Mark a function, class, or struct to be compiled to JavaScript
From WebAssembly it is not possible to call any browser APIs - not even the basic client::console.log
.
Instead, you can mark functions, classes, and structs with the [[cheerp::genericjs]]
attribute to have them be compiled into JavaScript. You can call browser APIs in genericjs functions.
Specifically, functions marked with [[cheerp::genericjs]]
will be placed in the genericjs section.