experimenting...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-04-13 20:17:31 +03:00
parent 3f6b709ef5
commit 5c6db577cd

View File

@ -48,8 +48,6 @@ function(text){
// passed explicitly. // passed explicitly.
// NOTE: this is super(..) replacement... // NOTE: this is super(..) replacement...
// NOTE: if method is root (no super method) this will return undefined. // NOTE: if method is root (no super method) this will return undefined.
//
// XXX should this return the method or the object???
var parent = var parent =
module.parent = module.parent =
function(method, name, that){ function(method, name, that){
@ -65,6 +63,30 @@ function(method, name, that){
return that.__proto__[name] } return that.__proto__[name] }
// XXX get a list of prototypes that have an prop name...
// XXX need a way to stop...
var defines =
module.defines =
function(that, name, callback){
var stop
var res = []
do {
if(that.hasOwnProperty(name)){
res.push(that)
stop = callback
&& callback(that)
// callback requested a stop...
if(stop === false || stop == 'stop'){
return that
}
}
that = that.__proto__
// XXX revise...
} while(that !== null)
return res
}
//--------------------------------------------------------------------- //---------------------------------------------------------------------