evaluateQuickjsByteCode function

bool evaluateQuickjsByteCode(
  1. int contextId,
  2. Uint8List bytes
)

Implementation

bool evaluateQuickjsByteCode(int contextId, Uint8List bytes) {
  if (MercuryController.getControllerOfJSContextId(contextId) == null) {
    return false;
  }
  Pointer<Uint8> byteData = malloc.allocate(sizeOf<Uint8>() * bytes.length);
  byteData.asTypedList(bytes.length).setAll(0, bytes);
  assert(_allocatedMercuryIsolates.containsKey(contextId));
  int result = _evaluateQuickjsByteCode(_allocatedMercuryIsolates[contextId]!, byteData, bytes.length);
  malloc.free(byteData);
  return result == 1;
}