validate method

bool validate(
  1. Uint8List bytes
)

Whether bytes is a well formed module for this engine.

Implementation

bool validate(Uint8List bytes) {
  try {
    scoped((arena) {
      final (data, length) = copyBytes(arena, bytes);
      throwIfError(c.wasmtime_module_validate(pointer, data, length));
    });
    return true;
  } on WasmtimeException {
    return false;
  }
}