Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/src/emrun_prejs.js
4128 views
1
/**
2
* @license
3
* Copyright 2013 The Emscripten Authors
4
* SPDX-License-Identifier: MIT
5
*
6
* This file gets implicatly injected as a `--pre-js` file when
7
* emcc is run with `--emrun`
8
*/
9
10
// Route URL GET parameters to argc+argv
11
if (typeof window == 'object') {
12
Module['arguments'] = window.location.search.slice(1).trim().split('&');
13
for (let i = 0; i < Module['arguments'].length; ++i) {
14
Module['arguments'][i] = decodeURI(Module['arguments'][i]);
15
}
16
// If no args were passed arguments = [''], in which case kill the single empty string.
17
if (!Module['arguments'][0]) {
18
Module['arguments'] = [];
19
}
20
}
21
22