hyperweb:: default arguments possible

This commit is contained in:
Zeno Rogue 2019-07-12 23:17:53 +02:00
parent 37dd9cb208
commit 4665e7ca14
1 changed files with 2 additions and 0 deletions

View File

@ -178,6 +178,8 @@ void emscripten_get_commandline() {
#else
char *str = (char*)EM_ASM_INT({
var jsString = document.location.href;
if (typeof(default_arg) != 'undefined' && jsString.indexOf('?') == -1)
jsString = default_arg;
var lengthBytes = lengthBytesUTF8(jsString)+1;
var stringOnWasmHeap = _malloc(lengthBytes);
stringToUTF8(jsString, stringOnWasmHeap, lengthBytes+1);