Make how global object is fetched more general.
This commit is contained in:
@ -271,12 +271,13 @@ var ffi = {
|
|||||||
|
|
||||||
heap[128 + 6] = 256 * 4; // set g_sys.heap = 256 * 4;
|
heap[128 + 6] = 256 * 4; // set g_sys.heap = 256 * 4;
|
||||||
|
|
||||||
var globalObj;
|
function getGlobalObj() {
|
||||||
if (typeof window === 'undefined') {
|
return (function(g) {
|
||||||
globalObj = global;
|
return g;
|
||||||
} else {
|
})(new Function('return this')());
|
||||||
globalObj = window;
|
|
||||||
}
|
}
|
||||||
|
var globalObj = getGlobalObj();
|
||||||
|
|
||||||
var module = VM(globalObj, ffi, heap);
|
var module = VM(globalObj, ffi, heap);
|
||||||
Init();
|
Init();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user