C.1. emscripten_run_script macros
The emscripten_run_script series of macros executes JavaScript code directly using the JavaScript eval function. This function is a special JavaScript function that takes a string and turns it into JavaScript code. Using evals in JavaScript is generally frowned upon—it’s slower compared to the alternatives, but, more importantly, if the string you pass in contains user-supplied data, that data is turned into code that can do anything, which poses a serious security risk. Another disadvantage of using the eval function is that, depending on the browser’s security settings, a browser may prevent eval from working altogether, and your code might not work as expected.
It’s recommended that the emscripten_run_script ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access