const pmake = { VERSION : "0.0", actions : {}, compilers : {} }; pmake.inherit = function(base) { const func = function() {}; Object.setPrototypeOf(func.prototype, base.prototype); return func; }; pmake.inherited = function(base, parent) { var proto = base.prototype; while(proto) { if(proto == parent.prototype) return true; proto = Object.getPrototypeOf(proto); } return false; }; pmake.register = function(base) { if(pmake.inherited(base, pmake.Compiler)) { pmake.compilers[base.target] = base; } else if(pmake.inherited(base, pmake.Action)) { pmake.actions[base.target] = base; } }; pmake.Compiler = function() { }; pmake.Action = function() { };