[wasm] bugfix for emscripten '--preload-file' under node.js (#7944)

This commit is contained in:
Yulong Wang 2021-06-04 00:18:01 -07:00 committed by GitHub
parent 0723d16436
commit 650314c926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -524,8 +524,8 @@ def main():
var PACKAGE_PATH = '';
if (typeof window === 'object') {
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
} else if (typeof location !== 'undefined') {
// worker
} else if (typeof process === 'undefined' && typeof location !== 'undefined') {
// web worker
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
}
var PACKAGE_NAME = '%s';