wat4wasm 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/examples/01-text/module-output.wat +228 -0
  4. package/examples/01-text/module.wat +9 -0
  5. package/examples/02-include/module-output.wat +22 -0
  6. package/examples/02-include/module.wat +3 -0
  7. package/examples/02-include/used-folder/included-file.wat +4 -0
  8. package/examples/03-ref.extern/module-output.wat +1537 -0
  9. package/examples/03-ref.extern/module.wat +33 -0
  10. package/examples/04-ref.func/module-output.wat +25 -0
  11. package/examples/04-ref.func/module.wat +8 -0
  12. package/examples/05-global.get/module-output.wat +991 -0
  13. package/examples/05-global.get/module.wat +26 -0
  14. package/examples/06-async/module-output.wat +661 -0
  15. package/examples/06-async/module.wat +15 -0
  16. package/examples/07-data/module-output.wasm +0 -0
  17. package/examples/07-data/module.wat +29 -0
  18. package/examples/07-data/used-folder/clear-text.txt +1 -0
  19. package/examples/07-data/used-folder/compile-this.wat +8 -0
  20. package/examples/08-reflectors/how-to/README.md +0 -0
  21. package/examples/08-reflectors/how-to/output-01-command.sh +0 -0
  22. package/examples/08-reflectors/how-to/output-02-command.sh +0 -0
  23. package/examples/08-reflectors/how-to/output-03-command.sh +0 -0
  24. package/examples/08-reflectors/how-to/output-04-command.sh +0 -0
  25. package/examples/08-reflectors/how-to/wat4wasm-outputs/01-module.wat +3 -0
  26. package/examples/08-reflectors/how-to/wat4wasm-outputs/02-module.wasm +3 -0
  27. package/examples/08-reflectors/how-to/wat4wasm-outputs/03-module.js +0 -0
  28. package/examples/08-reflectors/how-to/wat4wasm-outputs/04-module.html +0 -0
  29. package/examples/08-reflectors/module-output.wat +995 -0
  30. package/examples/08-reflectors/module.wat +108 -0
  31. package/examples/09-replaceAll/module-output.wat +347 -0
  32. package/examples/09-replaceAll/module.wat +68 -0
  33. package/examples/99-complex/module.wat +8 -0
  34. package/examples/99-complex/output.html +1 -0
  35. package/examples/99-complex/sub/worker.wat +2 -0
  36. package/examples/shell-usages.sh +60 -0
  37. package/lib/build +33 -0
  38. package/lib/clean.js +91 -0
  39. package/lib/cli.js +273 -0
  40. package/lib/helpers.js +567 -0
  41. package/lib/index.js +95 -0
  42. package/lib/processors/async.js +53 -0
  43. package/lib/processors/data.js +188 -0
  44. package/lib/processors/import.js +178 -0
  45. package/lib/processors/include.js +17 -0
  46. package/lib/processors/new.js +21 -0
  47. package/lib/processors/ref_extern.js +64 -0
  48. package/lib/processors/ref_func.js +44 -0
  49. package/lib/processors/replace_all.js +56 -0
  50. package/lib/processors/start.js +42 -0
  51. package/lib/processors/string.js +57 -0
  52. package/lib/processors/text.js +115 -0
  53. package/lib/processors/wat4wasm.js +285 -0
  54. package/lib/wat4beauty.js +320 -0
  55. package/package.json +30 -0
  56. package/ss-console.png +0 -0
  57. package/ss-terminal.png +0 -0
  58. package/test/boot.wat +5 -0
  59. package/test/test-output.html +1 -0
  60. package/test/test-output.js +27 -0
  61. package/test/test-output.wasm +0 -0
  62. package/test/test-sub.wat +4 -0
  63. package/test/test.wat +73 -0
  64. package/test/test_worker.js +1 -0
  65. package/wat4wasm +1998 -0
@@ -0,0 +1,33 @@
1
+ (module
2
+ (func $main
3
+ (ref.extern $self.navigation.activation.entry.id)
4
+ (drop)
5
+
6
+ (ref.extern $self.location)
7
+ (drop)
8
+
9
+ (ref.extern $self.location.origin)
10
+ (drop)
11
+
12
+ (ref.extern $self.Worker.prototype.postMessage)
13
+ (drop)
14
+
15
+ (ref.extern $self.Worker:postMessage)
16
+ (drop)
17
+
18
+ (ref.extern $self.Worker:onmessage[get])
19
+ (drop)
20
+
21
+ (ref.extern $self.Worker.prototype.onmessage[set])
22
+ (drop)
23
+
24
+ (ref.extern $self.MessageEvent.prototype.data[get])
25
+ (drop)
26
+
27
+ (ref.extern $self.MessageEvent:data[get])
28
+ (drop)
29
+
30
+ (ref.extern $self.MessageEvent:initMessageEvent)
31
+ (drop)
32
+ )
33
+ )
@@ -0,0 +1,25 @@
1
+ (module
2
+
3
+
4
+
5
+ (func $main
6
+ (ref.func $unreferenced_by_user)
7
+ (drop)
8
+ )
9
+
10
+ (func $unreferenced_by_user)
11
+
12
+
13
+
14
+
15
+
16
+ (elem $wat4wasm declare func $unreferenced_by_user)
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+ )
@@ -0,0 +1,8 @@
1
+ (module
2
+ (func $main
3
+ (ref.func $unreferenced_by_user)
4
+ (drop)
5
+ )
6
+
7
+ (func $unreferenced_by_user)
8
+ )