WebAssemblyExportImportedDependency.js 694 B

1234567891011121314151617181920212223242526272829
  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) {
  10. super(request);
  11. /** @type {string} */
  12. this.exportName = exportName;
  13. /** @type {string} */
  14. this.name = name;
  15. }
  16. getReference() {
  17. if (!this.module) return null;
  18. return new DependencyReference(this.module, [this.name], false);
  19. }
  20. get type() {
  21. return "wasm export import";
  22. }
  23. }
  24. module.exports = WebAssemblyExportImportedDependency;