You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
636 B

4 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.getSectionForNode = getSectionForNode;
  6. function getSectionForNode(n) {
  7. switch (n.type) {
  8. case "ModuleImport":
  9. return "import";
  10. case "CallInstruction":
  11. case "CallIndirectInstruction":
  12. case "Func":
  13. case "Instr":
  14. return "code";
  15. case "ModuleExport":
  16. return "export";
  17. case "Start":
  18. return "start";
  19. case "TypeInstruction":
  20. return "type";
  21. case "IndexInFuncSection":
  22. return "func";
  23. case "Global":
  24. return "global";
  25. // No section
  26. default:
  27. return;
  28. }
  29. }