| | |
| | | |
| | | class HarmonyAcceptDependency extends NullDependency { |
| | | /** |
| | | * Creates an instance of HarmonyAcceptDependency. |
| | | * @param {Range} range expression range |
| | | * @param {HarmonyAcceptImportDependency[]} dependencies import dependencies |
| | | * @param {boolean} hasCallback true, if the range wraps an existing callback |
| | |
| | | } |
| | | |
| | | /** |
| | | * Serializes this instance into the provided serializer context. |
| | | * @param {ObjectSerializerContext} context context |
| | | */ |
| | | serialize(context) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Restores this instance from the provided deserializer context. |
| | | * @param {ObjectDeserializerContext} context context |
| | | */ |
| | | deserialize(context) { |
| | |
| | | NullDependency.Template |
| | | ) { |
| | | /** |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Dependency} dependency the dependency for which the template should be applied |
| | | * @param {ReplaceSource} source the current replace source which can be modified |
| | | * @param {DependencyTemplateContext} templateContext the context object |
| | |
| | | } = templateContext; |
| | | |
| | | /** |
| | | * Gets dependency module id. |
| | | * @param {Dependency} dependency the dependency to get module id for |
| | | * @returns {ModuleId | null} the module id or null if not found |
| | | */ |
| | |
| | | ); |
| | | |
| | | /** |
| | | * Checks whether this harmony accept dependency is related harmony import dependency. |
| | | * @param {Dependency} a the first dependency |
| | | * @param {Dependency} b the second dependency |
| | | * @returns {boolean} true if the dependencies are related |
| | |
| | | * @returns {HarmonyImportDependency[]} array of related harmony import dependencies |
| | | */ |
| | | const getHarmonyImportDependencies = (dependency) => { |
| | | /** @type {HarmonyImportDependency[]} */ |
| | | const result = []; |
| | | /** @type {HarmonyImportDependency | null} */ |
| | | let deferDependency = null; |
| | | /** @type {HarmonyImportDependency | null} */ |
| | | let noDeferredDependency = null; |
| | | |
| | | for (const d of module.dependencies) { |