ember-source
Version:
A JavaScript framework for creating ambitious web applications
17 lines (15 loc) • 491 B
JavaScript
function unwrapHandle(handle) {
if (typeof handle === 'number') {
return handle;
} else {
let error = handle.errors[0];
throw new Error(`Compile Error: ${error.problem} @ ${error.span.start}..${error.span.end}`);
}
}
function unwrapTemplate(template) {
if (template.result === 'error') {
throw new Error(`Compile Error: ${template.problem} @ ${template.span.start}..${template.span.end}`);
}
return template;
}
export { unwrapHandle as a, unwrapTemplate as u };