Skip to content

Commit

Permalink
Merge pull request #5 from ekharkunov/emscripten-update
Browse files Browse the repository at this point in the history
Update js code to latest Emscripten (3.1.55).
  • Loading branch information
AGulev authored Apr 11, 2024
2 parents adcf363 + 233d113 commit 2abe1f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.externalToolBuilders
.DS_Store
.lock-wscript
Expand All @@ -9,3 +8,4 @@ build
builtins
.internal
.clang_complete
*.der
18 changes: 9 additions & 9 deletions webmonetization/lib/web/library_webmonetization.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ var WebMonetizationLibrary = {

document.monetization.addEventListener("", event => {
{{{ makeDynCall("vii", "Context.listener") }}} (
allocate(intArrayFromString("monetizationpending"), ALLOC_STACK),
allocate(intArrayFromString(JSON.stringify(event.detail !== undefined ? event.detail : {})), ALLOC_STACK)
stringToUTF8OnStack("monetizationpending"),
stringToUTF8OnStack(JSON.stringify(event.detail !== undefined ? event.detail : {}))
);
});
document.monetization.addEventListener("monetizationstart", event => {
{{{ makeDynCall("vii", "Context.listener") }}} (
allocate(intArrayFromString("monetizationstart"), ALLOC_STACK),
allocate(intArrayFromString(JSON.stringify(event.detail !== undefined ? event.detail : {})), ALLOC_STACK)
stringToUTF8OnStack("monetizationstart"),
stringToUTF8OnStack(JSON.stringify(event.detail !== undefined ? event.detail : {}))
);
});
document.monetization.addEventListener("monetizationprogress", event => {
{{{ makeDynCall("vii", "Context.listener") }}} (
allocate(intArrayFromString("monetizationprogress"), ALLOC_STACK),
allocate(intArrayFromString(JSON.stringify(event.detail !== undefined ? event.detail : {})), ALLOC_STACK)
stringToUTF8OnStack("monetizationprogress"),
stringToUTF8OnStack(JSON.stringify(event.detail !== undefined ? event.detail : {}))
);
});
document.monetization.addEventListener("monetizationstop", event => {
{{{ makeDynCall("vii", "Context.listener") }}} (
allocate(intArrayFromString("monetizationstop"), ALLOC_STACK),
allocate(intArrayFromString(JSON.stringify(event.detail !== undefined ? event.detail : {})), ALLOC_STACK)
stringToUTF8OnStack("monetizationstop"),
stringToUTF8OnStack(JSON.stringify(event.detail !== undefined ? event.detail : {}))
);
});
},
Expand All @@ -47,4 +47,4 @@ var WebMonetizationLibrary = {

autoAddDeps(WebMonetizationLibrary, "$Context");

mergeInto(LibraryManager.library, WebMonetizationLibrary);
addToLibrary(WebMonetizationLibrary);

0 comments on commit 2abe1f7

Please sign in to comment.