Skip to content

Commit 1a334e3

Browse files
committed
Runtime: no global eval
1 parent d8a42e3 commit 1a334e3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

biome.json

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
"nursery": {
2525
"noUselessEscapeInRegex": "error"
2626
},
27-
"security": {
28-
"noGlobalEval": "off"
29-
},
3027
"style": {
3128
"noArguments": "off",
3229
"noCommaOperator": "off",

runtime/jslib.js

+4
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ function caml_js_var(x) {
285285
);
286286
//console.error("Js.Unsafe.eval_string")
287287
}
288+
// biome-ignore lint/security/noGlobalEval:
288289
return eval(x);
289290
}
290291
//Provides: caml_js_call (const, mutable, shallow)
@@ -494,20 +495,23 @@ function caml_js_strict_equals(x, y) {
494495
//Provides: caml_js_eval_string (const)
495496
//Requires: caml_jsstring_of_string
496497
function caml_js_eval_string(s) {
498+
// biome-ignore lint/security/noGlobalEval:
497499
return eval(caml_jsstring_of_string(s));
498500
}
499501

500502
//Provides: caml_js_expr (const)
501503
//Requires: caml_jsstring_of_string
502504
function caml_js_expr(s) {
503505
console.error("caml_js_expr: fallback to runtime evaluation\n");
506+
// biome-ignore lint/security/noGlobalEval:
504507
return eval(caml_jsstring_of_string(s));
505508
}
506509

507510
//Provides: caml_pure_js_expr const (const)
508511
//Requires: caml_jsstring_of_string
509512
function caml_pure_js_expr(s) {
510513
console.error("caml_pure_js_expr: fallback to runtime evaluation\n");
514+
// biome-ignore lint/security/noGlobalEval:
511515
return eval(caml_jsstring_of_string(s));
512516
}
513517

0 commit comments

Comments
 (0)