Commit 4cec2073 authored by Michael Droettboom's avatar Michael Droettboom

Trying to fix patch again

parent 0926d252
diff --git a/src/library.js b/src/library.js
diff --git a/emsdk/emscripten/tag-1.38.4/src/library.js b/emsdk/emscripten/tag-1.38.4/src/library.js
index 5fc87ab16..82ebcfd61 100644
--- a/emsdk/emscripten/tag-1.38.4/src/library.js
+++ b/emsdk/emscripten/tag-1.38.4/src/library.js
@@ -1755,9 +1755,14 @@ LibraryManager.library = {
@@ -1012,7 +1012,7 @@ LibraryManager.library = {
llvm_va_copy: function(ppdest, ppsrc) {
// copy the list start
{{{ makeCopyValues('ppdest', 'ppsrc', Runtime.QUANTUM_SIZE, 'null', null, 1) }}};
-
+
// copy the list's current offset (will be advanced with each call to va_arg)
{{{ makeCopyValues('(ppdest+'+Runtime.QUANTUM_SIZE+')', '(ppsrc+'+Runtime.QUANTUM_SIZE+')', Runtime.QUANTUM_SIZE, 'null', null, 1) }}};
},
@@ -1755,39 +1755,44 @@ LibraryManager.library = {
return handle;
}
......@@ -11,35 +20,309 @@ index 5fc87ab16..82ebcfd61 100644
var handle = -1;
- var lib_module = Module;
+ lib_module = Module;
+ } else {
} else {
- var target = FS.findObject(filename);
- if (!target || target.isFolder || target.isDevice) {
- DLFCN.errorMsg = 'Could not find dynamic lib: ' + filename;
- return 0;
- }
- FS.forceLoadFile(target);
+ if (Module['preloadedWasm'] !== undefined &&
+ Module['preloadedWasm'][filename] !== undefined) {
+ lib_module = Module['preloadedWasm'][filename];
} else {
var target = FS.findObject(filename);
if (!target || target.isFolder || target.isDevice) {
@@ -1766,7 +1771,6 @@ LibraryManager.library = {
}
FS.forceLoadFile(target);
+ } else {
+ var target = FS.findObject(filename);
+ if (!target || target.isFolder || target.isDevice) {
+ DLFCN.errorMsg = 'Could not find dynamic lib: ' + filename;
+ return 0;
+ }
+ FS.forceLoadFile(target);
- var lib_module;
try {
- try {
+ try {
#if WASM
// the shared library is a shared wasm library (see tools/shared.py WebAssembly.make_shared_library)
@@ -1789,6 +1793,7 @@ LibraryManager.library = {
DLFCN.errorMsg = 'Could not evaluate dynamic lib: ' + filename + '\n' + e;
return 0;
}
+ }
- // the shared library is a shared wasm library (see tools/shared.py WebAssembly.make_shared_library)
- var lib_data = FS.readFile(filename, { encoding: 'binary' });
- if (!(lib_data instanceof Uint8Array)) lib_data = new Uint8Array(lib_data);
- //Module.printErr('libfile ' + filename + ' size: ' + lib_data.length);
- lib_module = loadWebAssemblyModule(lib_data);
+ // the shared library is a shared wasm library (see tools/shared.py WebAssembly.make_shared_library)
+ var lib_data = FS.readFile(filename, { encoding: 'binary' });
+ if (!(lib_data instanceof Uint8Array)) lib_data = new Uint8Array(lib_data);
+ //Module.printErr('libfile ' + filename + ' size: ' + lib_data.length);
+ lib_module = loadWebAssemblyModule(lib_data);
#else
- // the shared library is a JS file, which we eval
- var lib_data = FS.readFile(filename, { encoding: 'utf8' });
- lib_module = eval(lib_data)(
- alignFunctionTables(),
- Module
- );
+ // the shared library is a JS file, which we eval
+ var lib_data = FS.readFile(filename, { encoding: 'utf8' });
+ lib_module = eval(lib_data)(
+ alignFunctionTables(),
+ Module
+ );
#endif
- } catch (e) {
+ } catch (e) {
#if ASSERTIONS
- Module.printErr('Error in loading dynamic library: ' + e);
+ Module.printErr('Error in loading dynamic library: ' + e);
#endif
- DLFCN.errorMsg = 'Could not evaluate dynamic lib: ' + filename + '\n' + e;
- return 0;
+ DLFCN.errorMsg = 'Could not evaluate dynamic lib: ' + filename + '\n' + e;
+ return 0;
+ }
}
// Not all browsers support Object.keys().
var handle = 1;
@@ -2224,7 +2229,7 @@ LibraryManager.library = {
newDate.setFullYear(newDate.getFullYear()+1);
}
} else {
- // we stay in current month
+ // we stay in current month
newDate.setDate(newDate.getDate()+days);
return newDate;
}
@@ -2336,7 +2341,7 @@ LibraryManager.library = {
} else {
return thisDate.getFullYear();
}
- } else {
+ } else {
return thisDate.getFullYear()-1;
}
};
@@ -2365,16 +2370,16 @@ LibraryManager.library = {
return leadingSomething(date.tm_mday, 2, ' ');
},
'%g': function(date) {
- // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year.
- // In this system, weeks begin on a Monday and week 1 of the year is the week that includes
- // January 4th, which is also the week that includes the first Thursday of the year, and
- // is also the first week that contains at least four days in the year.
- // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of
- // the last week of the preceding year; thus, for Saturday 2nd January 1999,
- // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th,
- // or 31st is a Monday, it and any following days are part of week 1 of the following year.
+ // %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year.
+ // In this system, weeks begin on a Monday and week 1 of the year is the week that includes
+ // January 4th, which is also the week that includes the first Thursday of the year, and
+ // is also the first week that contains at least four days in the year.
+ // If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of
+ // the last week of the preceding year; thus, for Saturday 2nd January 1999,
+ // %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th,
+ // or 31st is a Monday, it and any following days are part of week 1 of the following year.
// Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.
-
+
return getWeekBasedYear(date).toString().substring(2);
},
'%G': function(date) {
@@ -2420,13 +2425,13 @@ LibraryManager.library = {
return day.getDay() || 7;
},
'%U': function(date) {
- // Replaced by the week number of the year as a decimal number [00,53].
- // The first Sunday of January is the first day of week 1;
+ // Replaced by the week number of the year as a decimal number [00,53].
+ // The first Sunday of January is the first day of week 1;
// days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
var janFirst = new Date(date.tm_year+1900, 0, 1);
var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7-janFirst.getDay());
var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);
-
+
// is target date after the first Sunday?
if (compareByDay(firstSunday, endDate) < 0) {
// calculate difference in days between first Sunday and endDate
@@ -2439,10 +2444,10 @@ LibraryManager.library = {
return compareByDay(firstSunday, janFirst) === 0 ? '01': '00';
},
'%V': function(date) {
- // Replaced by the week number of the year (Monday as the first day of the week)
- // as a decimal number [01,53]. If the week containing 1 January has four
- // or more days in the new year, then it is considered week 1.
- // Otherwise, it is the last week of the previous year, and the next week is week 1.
+ // Replaced by the week number of the year (Monday as the first day of the week)
+ // as a decimal number [01,53]. If the week containing 1 January has four
+ // or more days in the new year, then it is considered week 1.
+ // Otherwise, it is the last week of the previous year, and the next week is week 1.
// Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]
var janFourthThisYear = new Date(date.tm_year+1900, 0, 4);
var janFourthNextYear = new Date(date.tm_year+1901, 0, 4);
@@ -2455,7 +2460,7 @@ LibraryManager.library = {
if (compareByDay(endDate, firstWeekStartThisYear) < 0) {
// if given date is before this years first week, then it belongs to the 53rd week of last year
return '53';
- }
+ }
if (compareByDay(firstWeekStartNextYear, endDate) <= 0) {
// if given date is after next years first week, then it belongs to the 01th week of next year
@@ -2478,8 +2483,8 @@ LibraryManager.library = {
return day.getDay();
},
'%W': function(date) {
- // Replaced by the week number of the year as a decimal number [00,53].
- // The first Monday of January is the first day of week 1;
+ // Replaced by the week number of the year as a decimal number [00,53].
+ // The first Monday of January is the first day of week 1;
// days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
var janFirst = new Date(date.tm_year, 0, 1);
var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7-janFirst.getDay()+1);
@@ -2528,7 +2533,7 @@ LibraryManager.library = {
var bytes = intArrayFromString(pattern, false);
if (bytes.length > maxsize) {
return 0;
- }
+ }
writeArrayToMemory(bytes, s);
return bytes.length-1;
@@ -2569,7 +2574,7 @@ LibraryManager.library = {
for (var matcher in EQUIVALENT_MATCHERS) {
pattern = pattern.replace(matcher, EQUIVALENT_MATCHERS[matcher]);
}
-
+
// TODO: take care of locale
var DATE_PATTERNS = {
@@ -2599,7 +2604,7 @@ LibraryManager.library = {
var DAY_NUMBERS_MON_FIRST = {MON: 0, TUE: 1, WED: 2, THU: 3, FRI: 4, SAT: 5, SUN: 6};
for (var datePattern in DATE_PATTERNS) {
- pattern = pattern.replace(datePattern, '('+datePattern+DATE_PATTERNS[datePattern]+')');
+ pattern = pattern.replace(datePattern, '('+datePattern+DATE_PATTERNS[datePattern]+')');
}
// take care of capturing groups
@@ -2687,7 +2692,7 @@ LibraryManager.library = {
} else if ((value=getMatch('b'))) {
// parse from month name
date.month = MONTH_NUMBERS[value.substring(0,3).toUpperCase()] || 0;
- // TODO: derive month from day in year+year, week number+day of week+year
+ // TODO: derive month from day in year+year, week number+day of week+year
}
// day
@@ -2709,12 +2714,12 @@ LibraryManager.library = {
var weekDay = value.substring(0,3).toUpperCase();
if ((value=getMatch('U'))) {
// ... and week number (Sunday being first day of week)
- // Week number of the year (Sunday as the first day of the week) as a decimal number [00,53].
+ // Week number of the year (Sunday as the first day of the week) as a decimal number [00,53].
// All days in a new year preceding the first Sunday are considered to be in week 0.
var weekDayNumber = DAY_NUMBERS_SUN_FIRST[weekDay];
var weekNumber = parseInt(value);
- // January 1st
+ // January 1st
var janFirst = new Date(date.year, 0, 1);
var endDate;
if (janFirst.getDay() === 0) {
@@ -2728,12 +2733,12 @@ LibraryManager.library = {
date.month = endDate.getMonth();
} else if ((value=getMatch('W'))) {
// ... and week number (Monday being first day of week)
- // Week number of the year (Monday as the first day of the week) as a decimal number [00,53].
+ // Week number of the year (Monday as the first day of the week) as a decimal number [00,53].
// All days in a new year preceding the first Monday are considered to be in week 0.
var weekDayNumber = DAY_NUMBERS_MON_FIRST[weekDay];
var weekNumber = parseInt(value);
- // January 1st
+ // January 1st
var janFirst = new Date(date.year, 0, 1);
var endDate;
if (janFirst.getDay()===1) {
@@ -2755,10 +2760,10 @@ LibraryManager.library = {
tm_hour int hours since midnight 0-23
tm_mday int day of the month 1-31
tm_mon int months since January 0-11
- tm_year int years since 1900
+ tm_year int years since 1900
tm_wday int days since Sunday 0-6
tm_yday int days since January 1 0-365
- tm_isdst int Daylight Saving Time flag
+ tm_isdst int Daylight Saving Time flag
*/
var fullDate = new Date(date.year, date.month, date.day, date.hour, date.min, date.sec, 0);
@@ -2775,7 +2780,7 @@ LibraryManager.library = {
// we need to convert the matched sequence into an integer array to take care of UTF-8 characters > 0x7F
// TODO: not sure that intArrayFromString handles all unicode characters correctly
return buf+intArrayFromString(matches[0]).length-1;
- }
+ }
return 0;
},
@@ -2854,7 +2859,7 @@ LibraryManager.library = {
// ==========================================================================
// sys/timeb.h
// ==========================================================================
-
+
ftime: function(p) {
var millis = Date.now();
{{{ makeSetValue('p', C_STRUCTS.timeb.time, '(millis/1000)|0', 'i32') }}};
@@ -3884,7 +3889,7 @@ LibraryManager.library = {
if (val in GAI_ERRNO_MESSAGES) {
if (GAI_ERRNO_MESSAGES[val].length > buflen - 1) {
- msg = 'Message too long'; // EMSGSIZE message. This should never occur given the GAI_ERRNO_MESSAGES above.
+ msg = 'Message too long'; // EMSGSIZE message. This should never occur given the GAI_ERRNO_MESSAGES above.
} else {
msg = GAI_ERRNO_MESSAGES[val];
}
@@ -3958,7 +3963,7 @@ LibraryManager.library = {
// struct protoent *getprotoent(void);
// reads the next entry from the protocols 'database' or return NULL if 'eof'
if (_setprotoent.index === Protocols.list.length) {
- return 0;
+ return 0;
} else {
var result = Protocols.list[_setprotoent.index++];
return result;
@@ -4140,14 +4145,14 @@ LibraryManager.library = {
while (stack_args[1].indexOf('_emscripten_') >= 0)
stack_args = __emscripten_traverse_stack(stack_args[0]);
}
-
+
// Process all lines:
var lines = callstack.split('\n');
callstack = '';
var newFirefoxRe = new RegExp('\\s*(.*?)@(.*?):([0-9]+):([0-9]+)'); // New FF30 with column info: extract components of form ' Object._main@http://server.com:4324:12'
var firefoxRe = new RegExp('\\s*(.*?)@(.*):(.*)(:(.*))?'); // Old FF without column info: extract components of form ' Object._main@http://server.com:4324'
var chromeRe = new RegExp('\\s*at (.*?) \\\((.*):(.*):(.*)\\\)'); // Extract components of form ' at Object._main (http://server.com/file.html:4324:12)'
-
+
for (var l in lines) {
var line = lines[l];
@@ -4201,7 +4206,7 @@ LibraryManager.library = {
}
callstack += (haveSourceMap ? (' = '+jsSymbolName) : (' at '+cSymbolName)) + ' (' + file + ':' + lineno + ':' + column + ')\n';
}
-
+
// If we are still keeping track with the callstack by traversing via 'arguments.callee', print the function parameters as well.
if (flags & 128 /*EM_LOG_FUNC_PARAMS*/ && stack_args[0]) {
if (stack_args[1] == jsSymbolName && stack_args[2].length > 0) {
@@ -4792,4 +4797,3 @@ function autoAddDeps(object, name) {
}
}
}
-
diff --git emsdk/emscripten/tag-1.38.4/src/library_browser.js emsdk/emscripten/tag-1.38.4/src/library_browser.js
diff --git a/emsdk/emscripten/tag-1.38.4/src/library_browser.js b/emsdk/emscripten/tag-1.38.4/src/library_browser.js
index 36738391e..e2ac2763e 100644
--- a/emsdk/emscripten/tag-1.38.4/src/library_browser.js
+++ b/emsdk/emscripten/tag-1.38.4/src/library_browser.js
......@@ -79,12 +362,105 @@ index 36738391e..e2ac2763e 100644
// Canvas event setup
function pointerLockChange() {
@@ -237,7 +266,7 @@ var LibraryBrowser = {
if (canvas) {
// forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module
// Module['forcedAspectRatio'] = 4 / 3;
-
+
canvas.requestPointerLock = canvas['requestPointerLock'] ||
canvas['mozRequestPointerLock'] ||
canvas['webkitRequestPointerLock'] ||
@@ -490,7 +519,7 @@ var LibraryBrowser = {
'mp3': 'audio/mpeg'
}[name.substr(name.lastIndexOf('.')+1)];
},
-
+
getUserMedia: function(func) {
if(!window.getUserMedia) {
window.getUserMedia = navigator['getUserMedia'] ||
@@ -524,13 +553,13 @@ var LibraryBrowser = {
getMouseWheelDelta: function(event) {
var delta = 0;
switch (event.type) {
- case 'DOMMouseScroll':
+ case 'DOMMouseScroll':
delta = event.detail;
break;
- case 'mousewheel':
+ case 'mousewheel':
delta = event.wheelDelta;
break;
- case 'wheel':
+ case 'wheel':
delta = event['deltaY'];
break;
default:
@@ -558,7 +587,7 @@ var LibraryBrowser = {
Browser.mouseMovementX = Browser.getMovementX(event);
Browser.mouseMovementY = Browser.getMovementY(event);
}
-
+
// check if SDL is available
if (typeof SDL != "undefined") {
Browser.mouseX = SDL.mouseX + Browser.mouseMovementX;
@@ -568,7 +597,7 @@ var LibraryBrowser = {
// FIXME: ideally this should be clamped against the canvas size and zero
Browser.mouseX += Browser.mouseMovementX;
Browser.mouseY += Browser.mouseMovementY;
- }
+ }
} else {
// Otherwise, calculate the movement based on the changes
// in the coordinates.
@@ -600,7 +629,7 @@ var LibraryBrowser = {
adjustedY = adjustedY * (ch / rect.height);
var coords = { x: adjustedX, y: adjustedY };
-
+
if (event.type === 'touchstart') {
Browser.lastTouches[touch.identifier] = coords;
Browser.touches[touch.identifier] = coords;
@@ -609,7 +638,7 @@ var LibraryBrowser = {
if (!last) last = coords;
Browser.lastTouches[touch.identifier] = last;
Browser.touches[touch.identifier] = coords;
- }
+ }
return;
}
@@ -1127,10 +1156,10 @@ var LibraryBrowser = {
}
console.log('main loop blocker "' + blocker.name + '" took ' + (Date.now() - start) + ' ms'); //, left: ' + Browser.mainLoop.remainingBlockers);
Browser.mainLoop.updateStatus();
-
+
// catches pause/resume main loop from blocker execution
if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
-
+
setTimeout(Browser.mainLoop.runner, 0);
return;
}
@@ -1300,7 +1329,7 @@ var LibraryBrowser = {
emscripten_set_canvas_size: function(width, height) {
Browser.setCanvasSize(width, height);
},
-
+
emscripten_get_canvas_size__proxy: 'sync',
emscripten_get_canvas_size__sig: 'viii',
emscripten_get_canvas_size: function(width, height, isFullscreen) {
@@ -1488,4 +1517,3 @@ function slowLog(label, text) {
}
*/
-
diff --git emsdk/emscripten/tag-1.38.4/src/preamble.js emsdk/emscripten/tag-1.38.4/src/preamble.js
diff --git a/emsdk/emscripten/tag-1.38.4/src/preamble.js b/emsdk/emscripten/tag-1.38.4/src/preamble.js
index a757e8300..c7b1f596f 100644
--- a/emsdk/emscripten/tag-1.38.4/src/preamble.js
+++ b/emsdk/emscripten/tag-1.38.4/src/preamble.js
......@@ -100,7 +476,7 @@ index a757e8300..c7b1f596f 100644
#if PGO
var PGOMonitor = {
diff --git emsdk/emscripten/tag-1.38.4/src/support.js emsdk/emscripten/tag-1.38.4/src/support.js
diff --git a/emsdk/emscripten/tag-1.38.4/src/support.js b/emsdk/emscripten/tag-1.38.4/src/support.js
index f6c9842ff..99367db70 100644
--- a/emsdk/emscripten/tag-1.38.4/src/support.js
+++ b/emsdk/emscripten/tag-1.38.4/src/support.js
......@@ -113,7 +489,7 @@ index f6c9842ff..99367db70 100644
var int32View = new Uint32Array(new Uint8Array(binary.subarray(0, 24)).buffer);
assert(int32View[0] == 0x6d736100, 'need to see wasm magic number'); // \0wasm
// we should see the dylink section right after the magic number and wasm version
@@ -166,8 +166,9 @@ function loadWebAssemblyModule(binary) {
@@ -166,59 +166,71 @@ function loadWebAssemblyModule(binary) {
oldTable.push(table.get(i));
}
#endif
......@@ -123,20 +499,95 @@ index f6c9842ff..99367db70 100644
+ function postInstantiation(instance) {
+ var exports = {};
#if ASSERTIONS
// the table should be unchanged
assert(table === originalTable);
@@ -184,7 +185,6 @@ function loadWebAssemblyModule(binary) {
assert(table.get(oldTableSize + i) !== undefined, 'table entry was not filled in');
- // the table should be unchanged
- assert(table === originalTable);
- assert(table === Module['wasmTable']);
- if (instance.exports['table']) {
- assert(table === instance.exports['table']);
- }
- // the old part of the table should be unchanged
- for (var i = 0; i < oldTableSize; i++) {
- assert(table.get(i) === oldTable[i], 'old table entries must remain the same');
- }
- // verify that the new table region was filled in
- for (var i = 0; i < tableSize; i++) {
- assert(table.get(oldTableSize + i) !== undefined, 'table entry was not filled in');
- }
-#endif
- var exports = {};
- for (var e in instance.exports) {
- var value = instance.exports[e];
- if (typeof value === 'object') {
- // a breaking change in the wasm spec, globals are now objects
- // https://github.com/WebAssembly/mutable-global/issues/1
- value = value.value;
+ // the table should be unchanged
+ assert(table === originalTable);
+ assert(table === Module['wasmTable']);
+ if (instance.exports['table']) {
+ assert(table === instance.exports['table']);
+ }
+ // the old part of the table should be unchanged
+ for (var i = 0; i < oldTableSize; i++) {
+ assert(table.get(i) === oldTable[i], 'old table entries must remain the same');
+ }
+ // verify that the new table region was filled in
+ for (var i = 0; i < tableSize; i++) {
+ assert(table.get(oldTableSize + i) !== undefined, 'table entry was not filled in');
}
- if (typeof value === 'number') {
- // relocate it - modules export the absolute value, they can't relocate before they export
+#endif
+ for (var e in instance.exports) {
+ var value = instance.exports[e];
+ if (typeof value === 'object') {
+ // a breaking change in the wasm spec, globals are now objects
+ // https://github.com/WebAssembly/mutable-global/issues/1
+ value = value.value;
+ }
+ if (typeof value === 'number') {
+ // relocate it - modules export the absolute value, they can't relocate before they export
#if EMULATED_FUNCTION_POINTERS
- // it may be a function pointer
- if (e.substr(0, 3) == 'fp$' && typeof instance.exports[e.substr(3)] === 'function') {
- value = value + env['tableBase'];
- } else {
+ // it may be a function pointer
+ if (e.substr(0, 3) == 'fp$' && typeof instance.exports[e.substr(3)] === 'function') {
+ value = value + env['tableBase'];
+ } else {
#endif
- var exports = {};
for (var e in instance.exports) {
var value = instance.exports[e];
if (typeof value === 'object') {
@@ -219,6 +219,18 @@ function loadWebAssemblyModule(binary) {
- value = value + env['memoryBase'];
+ value = value + env['memoryBase'];
#if EMULATED_FUNCTION_POINTERS
- }
+ }
#endif
+ }
+ exports[e] = value;
}
return exports;
}
- exports[e] = value;
- }
- // initialize the module
- var init = exports['__post_instantiate'];
- if (init) {
- if (runtimeInitialized) {
- init();
- } else {
- // we aren't ready to run compiled code yet
- __ATINIT__.push(init);
+ // initialize the module
+ var init = exports['__post_instantiate'];
+ if (init) {
+ if (runtimeInitialized) {
+ init();
+ } else {
+ // we aren't ready to run compiled code yet
+ __ATINIT__.push(init);
+ }
}
+ return exports;
+ }
+
+ if (loadAsync) {
+ return WebAssembly.instantiate(binary, info).then(function(result) {
......@@ -145,17 +596,33 @@ index f6c9842ff..99367db70 100644
+ } else {
+ var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), info);
+ return postInstantiation(instance);
+ }
+}
}
- return exports;
}
+Module['loadWebAssemblyModule'] = loadWebAssemblyModule;
+
#endif // WASM
#endif // RELOCATABLE
diff --git emsdk/emscripten/tag-1.38.4/tests/test_browser.py emsdk/emscripten/tag-1.38.4/tests/test_browser.py
diff --git a/emsdk/emscripten/tag-1.38.4/tests/test_browser.py b/emsdk/emscripten/tag-1.38.4/tests/test_browser.py
index d5f49d04e..c85367f72 100644
--- a/emsdk/emscripten/tag-1.38.4/tests/test_browser.py
+++ b/emsdk/emscripten/tag-1.38.4/tests/test_browser.py
@@ -241,12 +241,12 @@ If manually bisecting:
printf("|%%s|\n", buf);
int result = !strcmp("load me right before", buf);
-
+
f = fopen("%s", "r");
if (f == NULL)
result = 0;
fclose(f);
-
+
f = fopen("%s", "r");
if (f != NULL)
result = 0;
@@ -2273,6 +2273,43 @@ void *getBindBuffer() {
Popen([PYTHON, EMCC, path_from_root('tests', 'browser_module.cpp'), '-o', 'module.js', '-O2', '-s', 'SIDE_MODULE=1', '-s', 'DLOPEN_SUPPORT=1', '-s', 'EXPORTED_FUNCTIONS=["_one", "_two"]']).communicate()
self.btest('browser_main.cpp', args=['-O2', '-s', 'MAIN_MODULE=1', '-s', 'DLOPEN_SUPPORT=1'], expected='8')
......
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