registerClassAlias method

void registerClassAlias(
  1. String aliasName,
  2. String targetName,
  3. String library
)

GEN-074: Registers a class alias (type alias) for use in interpreted code.

Type aliases like typedef MaterialStateProperty<T> = WidgetStateProperty<T> are registered so that D4rt scripts can use the alias name to reference the target class.

aliasName The alias name (e.g., 'MaterialStateProperty'). targetName The target class name (e.g., 'WidgetStateProperty'). library The library path where this alias is exported from.

Implementation

void registerClassAlias(String aliasName, String targetName, String library) {
  // sce43: a pure forward. This wrapper used to keep a second list as well,
  // which nothing ever read — `registerFunctionTypedef` beside it already
  // forwarded only, and the [classAliases] getter below reads the runner.
  // A divergent second pool on the wrapper is what this file's own
  // `resetScriptDeclarations` comment warns against.
  _runner.registerClassAlias(aliasName, targetName, library);
}