-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π§βπ» Add more info to the
setAbstractMethod
error
- Loading branch information
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1778,14 +1778,22 @@ defClassMethod(function decorateMethod(constructor, decorator, key, method) { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 0.7.18 | ||
* @version 0.7.18 | ||
* @version 0.9.3 | ||
* | ||
* @param {Function} constructor Constructor to modify prototype of | ||
* @param {string} name The name of the method | ||
*/ | ||
defClassMethod(function setAbstractMethod(constructor, name) { | ||
Fn.setMethod(constructor, name, function abstractMethod() { | ||
let message = 'The `' + name + '` method has not been implemented in the `' + this.constructor.name + '` class.'; | ||
let name = this.constructor.namespace; | ||
|
||
if (name) { | ||
name += '.' + this.constructor.name; | ||
} else { | ||
name = this.constructor.name; | ||
} | ||
|
||
let message = 'The `' + name + '` method has not been implemented in the `' + name + '` class.'; | ||
throw new Error(message); | ||
}); | ||
}); | ||
|