Caml_js_expr: fallback to runtime evaluation

According to the JSOO docs:

js_expr e will parse the JavaScript expression e if e is available at compile time or will fallback to a runtime evaluation.

So yes, it works best if the string is available at compile time, i.e. is constant.

For an explanation of the problems with runtime evaluation, see eval() on MDN.

1 Like