mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Prefer throwing a new Error object instead of just a string expression
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
function checkSelectKitIsNotExpanded(selector) {
|
||||
if (find(selector).hasClass('is-expanded')) {
|
||||
throw 'You expected select-kit to be collapsed but it is expanded.';
|
||||
throw new Error('You expected select-kit to be collapsed but it is expanded.');
|
||||
}
|
||||
}
|
||||
|
||||
function checkSelectKitIsNotCollapsed(selector) {
|
||||
if (!find(selector).hasClass('is-expanded')) {
|
||||
throw 'You expected select-kit to be expanded but it is collapsed.';
|
||||
throw new Error('You expected select-kit to be expanded but it is collapsed.');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user