1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 02:27:19 +00:00

Raise error for unknown macro invocations

This commit is contained in:
Jeremy Ruston 2012-05-05 11:21:01 +01:00
parent 1c9ef2af45
commit ab4bdc0337

View File

@ -48,6 +48,9 @@ var Macro = function(macroName,srcParams,content,wiki,dependencies) {
} }
} else { } else {
// If Macro() has been called without 'new' then instantiate the right macro class // If Macro() has been called without 'new' then instantiate the right macro class
if(!MacroClass) {
throw "Unknown macro '" + macroName + "'";
}
return new MacroClass(macroName,srcParams,content,wiki,dependencies); return new MacroClass(macroName,srcParams,content,wiki,dependencies);
} }
}; };