happy-dom
Version:
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
66 lines • 1.49 kB
JavaScript
/**
* CSS module.
*/
export default class UnresolvedModule {
url;
/**
* Constructor.
*
* @param init Initialization options.
*/
constructor(init) {
this.
this.url = init.url;
}
/**
* Compiles and evaluates the module.
*
* @returns Module exports.
*/
async evaluate() {
throw new this.
}
/**
* Compiles and preloads the module and its imports.
*
* @returns Promise.
*/
async preload() {
throw new this.
}
/**
* Add a hook to be called when the module is resolved.
*
* @param resolve Resolve.
* @param reject Reject.
*/
addResolveListener(resolve, reject) {
if (this.
reject(this.
return;
}
this.
}
/**
* Resolves the module.
*
* @param [error] Error.
*/
resolve(error) {
if (error) {
this.
}
for (const hook of this.
if (error) {
hook.reject(error);
}
else {
hook.resolve(null);
}
}
}
}
//# sourceMappingURL=UnresolvedModule.js.map