mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 06:50:27 +00:00
hyperweb:: default arguments possible
This commit is contained in:
parent
37dd9cb208
commit
4665e7ca14
@ -178,6 +178,8 @@ void emscripten_get_commandline() {
|
|||||||
#else
|
#else
|
||||||
char *str = (char*)EM_ASM_INT({
|
char *str = (char*)EM_ASM_INT({
|
||||||
var jsString = document.location.href;
|
var jsString = document.location.href;
|
||||||
|
if (typeof(default_arg) != 'undefined' && jsString.indexOf('?') == -1)
|
||||||
|
jsString = default_arg;
|
||||||
var lengthBytes = lengthBytesUTF8(jsString)+1;
|
var lengthBytes = lengthBytesUTF8(jsString)+1;
|
||||||
var stringOnWasmHeap = _malloc(lengthBytes);
|
var stringOnWasmHeap = _malloc(lengthBytes);
|
||||||
stringToUTF8(jsString, stringOnWasmHeap, lengthBytes+1);
|
stringToUTF8(jsString, stringOnWasmHeap, lengthBytes+1);
|
||||||
|
Loading…
Reference in New Issue
Block a user