mirror of
https://github.com/flynx/object.js.git
synced 2025-10-30 02:50:10 +00:00
experimenting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3f6b709ef5
commit
5c6db577cd
26
object.js
26
object.js
@ -48,8 +48,6 @@ function(text){
|
||||
// passed explicitly.
|
||||
// NOTE: this is super(..) replacement...
|
||||
// NOTE: if method is root (no super method) this will return undefined.
|
||||
//
|
||||
// XXX should this return the method or the object???
|
||||
var parent =
|
||||
module.parent =
|
||||
function(method, name, that){
|
||||
@ -65,6 +63,30 @@ function(method, name, that){
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user