prepareWitWorld method

WASIComponentVersionedWitWorldPlan prepareWitWorld(
  1. WASIComponentWitDocument document, {
  2. String? worldName,
})

Prepares a WIT world against this WASI version profile.

Implementation

WASIComponentVersionedWitWorldPlan prepareWitWorld(
  WASIComponentWitDocument document, {
  String? worldName,
}) {
  final world = _selectWitWorld(document, worldName);
  final errors = _witWorldVersionErrors(profile, document, world);
  final functions = wasiComponentWitWorldFunctions(
    document,
    world,
    resolveTarget: resolveWASIComponentStandardWitTarget,
  );
  return WASIComponentVersionedWitWorldPlan._(
    profile: profile,
    document: document,
    world: world,
    versionErrors: errors,
    functions: functions,
  );
}