format
This commit is contained in:
parent
ece62938a9
commit
a523a42e6e
10 changed files with 78 additions and 52 deletions
|
|
@ -1,31 +1,31 @@
|
|||
const pmake = {
|
||||
VERSION: "0.0"
|
||||
VERSION : "0.0"
|
||||
};
|
||||
|
||||
pmake.inherit = function(base){
|
||||
const func = function(){};
|
||||
pmake.inherit = function(base) {
|
||||
const func = function() {};
|
||||
|
||||
Object.setPrototypeOf(func.prototype, base.prototype);
|
||||
|
||||
return func;
|
||||
};
|
||||
|
||||
pmake.inherited = function(base, parent){
|
||||
pmake.inherited = function(base, parent) {
|
||||
var proto = base.prototype;
|
||||
|
||||
while(proto){
|
||||
while(proto) {
|
||||
if(proto == parent.prototype) return true;
|
||||
|
||||
proto = Object.getPrototypeOf(proto);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
pmake.register = function(base){
|
||||
if(pmake.inherited(base, Compiler)){
|
||||
pmake.register = function(base) {
|
||||
if(pmake.inherited(base, Compiler)) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Compiler(){
|
||||
function Compiler() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue