Skip to content

Commit

Permalink
window.WebAssemblyParser2.decode(buffer); OK!
Browse files Browse the repository at this point in the history
  • Loading branch information
pannous committed Nov 30, 2024
1 parent cb4c064 commit d207641
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/assets/script/wasm-parser-bundle.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/addon/hint/show-hint.min.js"></script>-->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/addon/hint/javascript-hint.min.js"></script>-->

<script src="https://cdn.jsdelivr.net/npm/@webassemblyjs/[email protected]/lib/index.js"></script>
<script>window.exports = {};</script>
<script src="assets/script/wasm-parser-bundle.js"></script>
<!-- <script type="module" src="https://cdn.jsdelivr.net/npm/@webassemblyjs/[email protected]/lib/index.js"></script>-->
<script src="https://webassembly.github.io/wabt/demo/libwabt.js"></script>
<script> WabtModule().then(function (wabt) {
window.wabt = wabt;
Expand Down
4 changes: 2 additions & 2 deletions docs/wasp.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function terminate() {

function createHtml(parent, innerHtml) {
let element = document.createElement("div"); // todo tag
element.innerHTML = string(innerHtml, app.memory);
element.innerHTML = chars(innerHtml, app.memory);
if (!parent) parent = document.body;
parent.appendChild(element);
return element;
Expand Down Expand Up @@ -1085,7 +1085,7 @@ async function run_wasm(buf_pointer, buf_size) {

function wasm_to_wat(buffer) {
try {
const parsed = window.WebAssemblyParser.decode(buffer);
const parsed = window.WebAssemblyParser2.decode(buffer);
console.log(parsed)
// editor.setValue(parsed.toText());

Expand Down
2 changes: 1 addition & 1 deletion source/Wasp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ class Wasp {
return Nan;
}

// todo include β…“ for consistency
// todo include β…“ for consistency but 3β…“=3+β…“ β…“Ο€=β…“*Ο€ … !!
while (atoi1(ch) >= 0) { // -1 if not
// ch >= '0' and ch <= '9'
string += ch;
Expand Down

0 comments on commit d207641

Please sign in to comment.