l0.DependencyControl.ModuleProvider¶
ModuleProvider ¶
Resolves provided module aliases to their provider module through a custom package searcher.
Class methods¶
isDepCtrlVersionRecord ¶
Returns true when value is a live DependencyControl PackageRecord instance, regardless of which class object created it.
| param | type | description |
|---|---|---|
| value | any |
Returns:
isRecordboolean
runInitializer ¶
Runs a freshly-loaded module reference's DependencyControl initializer (__depCtrlInit), if
it has one and hasn't been initialized yet, so the module exposes a proper DependencyControl
record. The guard avoids re-initializing modules that mutate state on first init (e.g. BadMutex).
| param | type | description |
|---|---|---|
| ref | any |
The loaded module reference. |
| DependencyControl | table |
The DependencyControl class handed to the initializer. |
Returns:
ranboolean|nil— True if the initializer ran, false if there was nothing to run, nil on initializer error.errstring? — Error message when the initializer raised.
register ¶
Registers a provider for an alias name. First registration wins.
| param | type | description |
|---|---|---|
| alias | string |
The (possibly bare) module name to provide. |
| providerName | string |
The namespaced module that provides it. |
Returns:
registeredboolean— Whether the registration was applied.
registerRecord ¶
Registers every alias declared in a record's provides field.
| param | type | description |
|---|---|---|
| record | table |
A record with .moduleName and an optional .provides array. |
fullTraceback ¶
Builds a stack traceback string with full, untruncated source paths, rewriting known Aegisub
directory prefixes back to their ?user/?data/?temp aliases. Suitable as an xpcall handler.
| param | type | description |
|---|---|---|
| msg? | string |
A message, typically the error, prepended to the traceback. |
Returns:
tracebackstring— The formatted traceback, one frame per line.
getProvider ¶
Gets the provider namespace registered for an alias module name.
| param | type | description |
|---|---|---|
| alias | string |
Returns:
providerNamestring? — The provider namespace registered for the alias.
install ¶
Installs the alias searcher. Idempotent across reloads.