root / trunk / web / dojo / dojox / lang / functional / object.js @ 12
History | View | Annotate | Download (1.07 KB)
1 |
/*
|
---|---|
2 |
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
3 |
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
4 |
see: http://dojotoolkit.org/license for details
|
5 |
*/
|
6 |
|
7 |
|
8 |
if(!dojo._hasResource["dojox.lang.functional.object"]){ |
9 |
dojo._hasResource["dojox.lang.functional.object"]=true; |
10 |
dojo.provide("dojox.lang.functional.object");
|
11 |
dojo.require("dojox.lang.functional.lambda");
|
12 |
(function(){
|
13 |
var d=dojo,df=dojox.lang.functional,_1={};
|
14 |
d.mixin(df,{keys:function(_2){ |
15 |
var t=[];
|
16 |
for(var i in _2){ |
17 |
if(!(i in _1)){ |
18 |
t.push(i); |
19 |
} |
20 |
} |
21 |
return t;
|
22 |
},values:function(_3){ |
23 |
var t=[];
|
24 |
for(var i in _3){ |
25 |
if(!(i in _1)){ |
26 |
t.push(_3[i]); |
27 |
} |
28 |
} |
29 |
return t;
|
30 |
},filterIn:function(_4,f,o){ |
31 |
o=o||d.global; |
32 |
f=df.lambda(f); |
33 |
var t={},v,i;
|
34 |
for(i in _4){ |
35 |
if(!(i in _1)){ |
36 |
v=_4[i]; |
37 |
if(f.call(o,v,i,_4)){
|
38 |
t[i]=v; |
39 |
} |
40 |
} |
41 |
} |
42 |
return t;
|
43 |
},forIn:function(_5,f,o){ |
44 |
o=o||d.global; |
45 |
f=df.lambda(f); |
46 |
for(var i in _5){ |
47 |
if(!(i in _1)){ |
48 |
f.call(o,_5[i],i,_5); |
49 |
} |
50 |
} |
51 |
return o;
|
52 |
},mapIn:function(_6,f,o){ |
53 |
o=o||d.global; |
54 |
f=df.lambda(f); |
55 |
var t={},i;
|
56 |
for(i in _6){ |
57 |
if(!(i in _1)){ |
58 |
t[i]=f.call(o,_6[i],i,_6); |
59 |
} |
60 |
} |
61 |
return t;
|
62 |
}}); |
63 |
})(); |
64 |
} |