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.

section.js 515B

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. }