jsEval function

Pointer<JSValue> jsEval(
  1. Pointer<JSContext> ctx,
  2. String input,
  3. String filename,
  4. int evalFlags,
)

Implementation

Pointer<JSValue> jsEval(
  Pointer<JSContext> ctx,
  String input,
  String filename,
  int evalFlags,
) {
  final utf8input = input.toNativeUtf8();
  final utf8filename = filename.toNativeUtf8();
  final val = _jsEval(
    ctx,
    utf8input,
    utf8input.length,
    utf8filename,
    evalFlags,
  );
  malloc.free(utf8input);
  malloc.free(utf8filename);
  runtimeOpaques[jsGetRuntime(ctx)]?._port.sendPort.send(#eval);
  return val;
}