mirror of
https://github.com/flynx/object.js.git
synced 2025-10-29 10:30:08 +00:00
cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3c86615730
commit
a4afdc17be
15
object.js
15
object.js
@ -44,23 +44,24 @@ function(text){
|
||||
// -> list
|
||||
//
|
||||
//
|
||||
// XXX should the callback(..) be used to break (current) or filter/map???
|
||||
// XXX revise name...
|
||||
var sources =
|
||||
module.sources =
|
||||
function(that, name, callback){
|
||||
function(obj, name, callback){
|
||||
var stop
|
||||
var res = []
|
||||
do {
|
||||
if(that.hasOwnProperty(name)){
|
||||
res.push(that)
|
||||
if(obj.hasOwnProperty(name)){
|
||||
res.push(obj)
|
||||
// handle callback...
|
||||
stop = callback
|
||||
&& callback(that)
|
||||
&& callback(obj)
|
||||
// stop requested by callback...
|
||||
if(stop === false || stop == 'stop'){
|
||||
return that } }
|
||||
that = that.__proto__
|
||||
} while(that !== null)
|
||||
return obj } }
|
||||
obj = obj.__proto__
|
||||
} while(obj !== null)
|
||||
return res }
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user