From 4665e7ca149f7fdda3648f534be7fd3f18c89c39 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 12 Jul 2019 23:17:53 +0200 Subject: [PATCH] hyperweb:: default arguments possible --- hyperweb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hyperweb.cpp b/hyperweb.cpp index 1b115768..5f6faa94 100644 --- a/hyperweb.cpp +++ b/hyperweb.cpp @@ -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);