WebAssemblyExportImportedDependency.js 759 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const DependencyReference = require("./DependencyReference");
  7. const ModuleDependency = require("./ModuleDependency");
  8. class WebAssemblyExportImportedDependency extends ModuleDependency {
  9. constructor(exportName, request, name, valueType) {
  10. super(request);
  11. /** @type {string} */
  12. this.exportName = exportName;
  13. /** @type {string} */
  14. this.name = name;
  15. /** @type {string} */
  16. this.valueType = valueType;
  17. }
  18. getReference() {
  19. if (!this.module) return null;
  20. return new DependencyReference(this.module, [this.name], false);
  21. }
  22. get type() {
  23. return "wasm export import";
  24. }
  25. }
  26. module.exports = WebAssemblyExportImportedDependency;