Provide better error on unexpected template

Fixes #806
This commit is contained in:
kpdecker
2014-08-15 00:06:06 -05:00
parent 9f07a34955
commit 084e8fe1b7
2 changed files with 40 additions and 0 deletions
+4
View File
@@ -27,6 +27,9 @@ export function template(templateSpec, env) {
if (!env) {
throw new Exception("No environment passed to template");
}
if (!templateSpec || !templateSpec.main) {
throw new Exception('Unknown template object: ' + typeof templateSpec);
}
// Note: Using env.VM references rather than local var references throughout this section to allow
// for external users to override these as psuedo-supported APIs.
@@ -151,6 +154,7 @@ export function template(templateSpec, env) {
throw new Exception('_child can not be used with depthed methods');
}
// TODO : Fix this
return container.programWithDepth(i);
};
return ret;