PackageCompiler constructor

PackageCompiler(
  1. Program program
)

Implementation

PackageCompiler(this.program) {
  _baseModuleNames = {
    for (final m in program.modules)
      if (m.functions.isNotEmpty && m.functions.every((f) => f.isBase))
        m.name,
    // Also exclude modules that have no local content (stub-only) — unless
    // they carry `dart_exports` metadata, in which case they are re-export
    // facades that must be emitted so downstream imports resolve.
    for (final m in program.modules)
      if (m.functions.isEmpty &&
          m.typeDefs.isEmpty &&
          m.enums.isEmpty &&
          !_isUserModule(m.name) &&
          !_hasExportMetadata(m))
        m.name,
  };
}