Skip to content

Commit

Permalink
remove eval in hdf5_util_jfm.js
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Aug 1, 2023
1 parent d47082d commit 7a1b2b7
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions gui/src/pages/NwbPage/RemoteH5File/h5wasm/hdf5_util_jfm.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,29 +928,33 @@ var Module = (()=>{
if (!flags.allowUndefined) {
reportUndefinedSymbols()
}
function addEmAsm(addr, body) {
var args = [];
var arity = 0;
for (; arity < 16; arity++) {
if (body.indexOf("$" + arity) != -1) {
args.push("$" + arity)
} else {
break
}
}
args = args.join(",");
var func = "(" + args + " ) => { " + body + "};";
ASM_CONSTS[start] = eval(func)
}
if ("__start_em_asm"in moduleExports) {
var start = moduleExports["__start_em_asm"];
var stop = moduleExports["__stop_em_asm"];
while (start < stop) {
var jsString = UTF8ToString(start);
addEmAsm(start, jsString);
start = HEAPU8.indexOf(0, start) + 1
}
}
//////////////////////////
// jfm
// remove this because it has "eval" in it -- maybe it's not needed
// function addEmAsm(addr, body) {
// var args = [];
// var arity = 0;
// for (; arity < 16; arity++) {
// if (body.indexOf("$" + arity) != -1) {
// args.push("$" + arity)
// } else {
// break
// }
// }
// args = args.join(",");
// var func = "(" + args + " ) => { " + body + "};";
// ASM_CONSTS[start] = eval(func)
// }
// if ("__start_em_asm"in moduleExports) {
// var start = moduleExports["__start_em_asm"];
// var stop = moduleExports["__stop_em_asm"];
// while (start < stop) {
// var jsString = UTF8ToString(start);
// addEmAsm(start, jsString);
// start = HEAPU8.indexOf(0, start) + 1
// }
// }
//////////////////////////
var applyRelocs = moduleExports["__wasm_apply_data_relocs"];
if (applyRelocs) {
if (runtimeInitialized) {
Expand Down

0 comments on commit 7a1b2b7

Please sign in to comment.