mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
new Error to Error
This commit is contained in:
parent
870019d2df
commit
644c8ad389
13 changed files with 44 additions and 44 deletions
|
|
@ -33,7 +33,7 @@
|
|||
}
|
||||
|
||||
if (!componentName) {
|
||||
throw new Error('No component name specified');
|
||||
throw Error('No component name specified');
|
||||
}
|
||||
|
||||
var asyncContext = ko.bindingEvent.startPossiblyAsyncContentBinding(element, bindingContext);
|
||||
|
|
@ -47,12 +47,12 @@
|
|||
|
||||
// Instantiate and bind new component. Implicitly this cleans any old DOM nodes.
|
||||
if (!componentDefinition) {
|
||||
throw new Error('Unknown component \'' + componentName + '\'');
|
||||
throw Error('Unknown component \'' + componentName + '\'');
|
||||
}
|
||||
// cloneTemplateIntoElement
|
||||
var template = componentDefinition['template'];
|
||||
if (!template) {
|
||||
throw new Error('Component \'' + componentName + '\' has no template');
|
||||
throw Error('Component \'' + componentName + '\' has no template');
|
||||
}
|
||||
ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(template));
|
||||
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
'register': (componentName, config) => {
|
||||
if (!config) {
|
||||
throw new Error('Invalid configuration for ' + componentName);
|
||||
throw Error('Invalid configuration for ' + componentName);
|
||||
}
|
||||
|
||||
if (defaultConfigRegistry[componentName]) {
|
||||
throw new Error('Component ' + componentName + ' is already registered');
|
||||
throw Error('Component ' + componentName + ' is already registered');
|
||||
}
|
||||
|
||||
defaultConfigRegistry[componentName] = config;
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
var defaultConfigRegistry = Object.create(null),
|
||||
createViewModelKey = 'createViewModel',
|
||||
throwError = (componentName, message) => { throw new Error(`Component '${componentName}': ${message}`) },
|
||||
throwError = (componentName, message) => { throw Error(`Component '${componentName}': ${message}`) },
|
||||
|
||||
// Takes a config object of the form { template: ..., viewModel: ... }, and asynchronously convert it
|
||||
// into the standard component definition format:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue