2018-06-02 15:53:35 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2018-07-30 23:08:51 +08:00
|
|
|
|
2018-06-02 15:53:35 +08:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const DependencyReference = require("./DependencyReference");
|
|
|
|
const ModuleDependency = require("./ModuleDependency");
|
|
|
|
|
|
|
|
class WebAssemblyExportImportedDependency extends ModuleDependency {
|
|
|
|
constructor(exportName, request, name) {
|
|
|
|
super(request);
|
|
|
|
/** @type {string} */
|
|
|
|
this.exportName = exportName;
|
|
|
|
/** @type {string} */
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
2018-07-25 15:33:48 +08:00
|
|
|
/**
|
|
|
|
* Returns the referenced module and export
|
|
|
|
* @returns {DependencyReference} reference
|
|
|
|
*/
|
2018-06-02 15:53:35 +08:00
|
|
|
getReference() {
|
|
|
|
if (!this.module) return null;
|
2018-07-23 03:01:05 +08:00
|
|
|
return new DependencyReference(() => this.module, [this.name], false);
|
2018-06-02 15:53:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
get type() {
|
|
|
|
return "wasm export import";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = WebAssemblyExportImportedDependency;
|