show a clear error when trying to use preloaded data not on the web; #3219
This commit is contained in:
Родитель
2715d0e2a7
Коммит
47aa499ad7
|
@ -484,9 +484,11 @@ if has_preloaded:
|
|||
var PACKAGE_PATH;
|
||||
if (typeof window === 'object') {
|
||||
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else {
|
||||
} else if (typeof location !== 'undefined') {
|
||||
// worker
|
||||
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
|
||||
} else {
|
||||
throw 'using preloaded data can only be done on a web page or in a web worker';
|
||||
}
|
||||
var PACKAGE_NAME = '%s';
|
||||
var REMOTE_PACKAGE_BASE = '%s';
|
||||
|
|
Загрузка…
Ссылка в новой задаче