root / trunk / web / dojo / dojox / lang / functional / numrec.js
History | View | Annotate | Download (912 Bytes)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
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.numrec"]){ |
||
9 | dojo._hasResource["dojox.lang.functional.numrec"]=true; |
||
10 | dojo.provide("dojox.lang.functional.numrec");
|
||
11 | dojo.require("dojox.lang.functional.lambda");
|
||
12 | dojo.require("dojox.lang.functional.util");
|
||
13 | (function(){
|
||
14 | var df=dojox.lang.functional,_1=df.inlineLambda,_2=["_r","_i"]; |
||
15 | df.numrec=function(_3,_4){ |
||
16 | var a,as,_5={},_6=function(x){ |
||
17 | _5[x]=1;
|
||
18 | }; |
||
19 | if(typeof _4=="string"){ |
||
20 | as=_1(_4,_2,_6); |
||
21 | }else{
|
||
22 | a=df.lambda(_4); |
||
23 | as="_a.call(this, _r, _i)";
|
||
24 | } |
||
25 | var _7=df.keys(_5),f=new Function(["_x"],"var _t=arguments.callee,_r=_t.t,_i".concat(_7.length?","+_7.join(","):"",a?",_a=_t.a":"",";for(_i=1;_i<=_x;++_i){_r=",as,"}return _r")); |
||
26 | f.t=_3; |
||
27 | if(a){
|
||
28 | f.a=a; |
||
29 | } |
||
30 | return f;
|
||
31 | }; |
||
32 | })(); |
||
33 | } |