From 49e6e35f03852e1830377975ce0561d33d955d12 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 12 Apr 2015 20:13:54 +0930 Subject: [PATCH 1/2] Fix module.exports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like you did a mass find/replace of ‘module’ to ‘component’, accidentally breaking module.exports --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index b8712c7e..ad1cd158 100644 --- a/mithril.js +++ b/mithril.js @@ -1139,5 +1139,5 @@ var m = (function app(window, undefined) { return m })(typeof window != "undefined" ? window : {}); -if (typeof component != "undefined" && component !== null && component.exports) component.exports = m; +if (typeof module != "undefined" && module !== null && module.exports) module.exports = m; else if (typeof define === "function" && define.amd) define(function() {return m}); From d25f1c83affed9988a6ed89c5cde3da1f630c687 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 12 Apr 2015 20:19:36 +0930 Subject: [PATCH 2/2] Fix onunload being called with incorrect context --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index b8712c7e..506da77c 100644 --- a/mithril.js +++ b/mithril.js @@ -568,7 +568,7 @@ var m = (function app(window, undefined) { var isPrevented = false; var event = {preventDefault: function() {isPrevented = true}}; for (var i = 0, unloader; unloader = unloaders[i]; i++) { - unloader.handler(event) + unloader.handler.call(unloader.controller, event) unloader.controller.onunload = null } if (isPrevented) {