diff --git a/.gitignore b/.gitignore index a970221..f790137 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ - .externalToolBuilders .DS_Store .lock-wscript @@ -9,3 +8,4 @@ build builtins .internal .clang_complete +*.der \ No newline at end of file diff --git a/webmonetization/lib/web/library_webmonetization.js b/webmonetization/lib/web/library_webmonetization.js index 8e9a121..4f345f3 100644 --- a/webmonetization/lib/web/library_webmonetization.js +++ b/webmonetization/lib/web/library_webmonetization.js @@ -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 : {})) ); }); }, @@ -47,4 +47,4 @@ var WebMonetizationLibrary = { autoAddDeps(WebMonetizationLibrary, "$Context"); -mergeInto(LibraryManager.library, WebMonetizationLibrary); +addToLibrary(WebMonetizationLibrary);