Commit e0fd7652 authored by Michael Droettboom's avatar Michael Droettboom

Don't dump everything in the global namespace

parent 8aca5e2a
......@@ -13,6 +13,7 @@ CXX=em++
OPTFLAGS=-O3
CXXFLAGS=-std=c++14 $(OPTFLAGS) -g -I$(CPYTHONINC) -Wno-warn-absolute-paths
LDFLAGS=\
-s MODULARIZE=1 \
$(CPYTHONROOT)/installs/python-$(PYVERSION)/lib/libpython$(PYMINOR).a \
-s "BINARYEN_METHOD='native-wasm'" \
-s TOTAL_MEMORY=268435456 \
......
var pyodide = {}
{
let baseURL = "{{DEPLOY}}";
......@@ -7,14 +6,17 @@ var pyodide = {}
wasmXHR.open('GET', wasmURL, true);
wasmXHR.responseType = 'arraybuffer';
wasmXHR.onload = function() {
let Module = {};
if (wasmXHR.status === 200 || wasmXHR.status === 0) {
pyodide.wasmBinary = wasmXHR.response;
Module.wasmBinary = wasmXHR.response;
} else {
alert("Couldn't download the pyodide.asm.wasm binary. Response was " + wasmXHR.status);
}
pyodide.baseURL = baseURL;
Module.baseURL = baseURL;
var script = document.createElement('script');
script.onload = function() { window.pyodide = pyodide(Module); };
script.src = baseURL + "pyodide.asm.js";
document.body.appendChild(script);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment