mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Refactored abstract method creation
This commit is contained in:
parent
1a71fa38f9
commit
7c783d19e8
6 changed files with 72 additions and 163 deletions
18
app/Lib/Utilities/Abstract.js
Normal file
18
app/Lib/Utilities/Abstract.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
define([
|
||||
"Lib/Utilities/Exception"
|
||||
],
|
||||
|
||||
function (Exception) {
|
||||
|
||||
function Abstract() {
|
||||
}
|
||||
|
||||
Abstract.prototype.addMethod = function(methodName, params) {
|
||||
this.prototype[methodName] = function() {
|
||||
throw new Exception("Abstract method", this, methodName + "(" + params.join(', ') + ") not overwritten.");
|
||||
}
|
||||
}
|
||||
|
||||
return Abstract;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue