a6452f8043ec5821d5a3a8c1c90c9fd976c5d5b62980e54ec87a8718cbe9feb66ad749cedac47fb5b66d7365b72a3194486e6614334edeab9ea2111aeb5f18 515 B

12345678910111213141516171819202122232425262728293031
  1. export function getSectionForNode(n) {
  2. switch (n.type) {
  3. case "ModuleImport":
  4. return "import";
  5. case "CallInstruction":
  6. case "CallIndirectInstruction":
  7. case "Func":
  8. case "Instr":
  9. return "code";
  10. case "ModuleExport":
  11. return "export";
  12. case "Start":
  13. return "start";
  14. case "TypeInstruction":
  15. return "type";
  16. case "IndexInFuncSection":
  17. return "func";
  18. case "Global":
  19. return "global";
  20. // No section
  21. default:
  22. return;
  23. }
  24. }