Skip to content

Commit

Permalink
#388 throw error if no root element
Browse files Browse the repository at this point in the history
  • Loading branch information
lhorie committed Dec 31, 2014
1 parent e9c892c commit d4bfee4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mithril.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ var m = (function app(window, undefined) {
var roots = [], modules = [], controllers = [], lastRedrawId = null, lastRedrawCallTime = 0, computePostRedrawHook = null, prevented = false, topModule;
var FRAME_BUDGET = 16; //60 frames per second = 1 call per 16 ms
m.module = function(root, module) {
if (!root) throw new Error("Please ensure the DOM element exists before rendering a template into it.");
var index = roots.indexOf(root);
if (index < 0) index = roots.length;
var isPrevented = false;
Expand Down

0 comments on commit d4bfee4

Please sign in to comment.