diff options
author | Joel Croteau <jcroteau@gmail.com> | 2014-02-21 04:42:25 -0800 |
---|---|---|
committer | Joel Croteau <jcroteau@gmail.com> | 2014-02-21 04:44:19 -0800 |
commit | 202271e11adc88f0e6e9f1d0a92374b24af16e91 (patch) | |
tree | 91b65620d800015ba3b60dd49f7400b3576bdd27 | |
parent | 7ead20ea09f187b9c46709d299154be166d44281 (diff) |
Fix bugs in HTML5 events when using SAFE_HEAP
This fixes a SAFE_HEAP_STORE is not a function error when using mouse events
and a segfault that occurs when the beforeunload callback returns 0.
-rw-r--r-- | src/library_html5.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/library_html5.js b/src/library_html5.js index a38c2390..e9b9c278 100644 --- a/src/library_html5.js +++ b/src/library_html5.js @@ -236,10 +236,10 @@ var LibraryJSEvents = { var handlerFunc = function(event) { var e = event || window.event; JSEvents.fillMouseEventData(JSEvents.wheelEvent, e); - {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaX, 'e.deltaX', 'double') }}} - {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaY, 'e.deltaY', 'double') }}} - {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaZ, 'e.deltaZ', 'double') }}} - {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaMode, 'e.deltaMode', 'i32') }}} + {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaX, 'e.deltaX', 'double') }}}; + {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaY, 'e.deltaY', 'double') }}}; + {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaZ, 'e.deltaZ', 'double') }}}; + {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaMode, 'e.deltaMode', 'i32') }}}; var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.wheelEvent, userData]); if (shouldCancel) { e.preventDefault(); @@ -772,7 +772,8 @@ var LibraryJSEvents = { var confirmationMessage = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, 0, userData]); - confirmationMessage = Pointer_stringify(confirmationMessage); + if (confirmationMessage) + confirmationMessage = Pointer_stringify(confirmationMessage); if (confirmationMessage) { e.preventDefault(); e.returnValue = confirmationMessage; |