Posted By

dvdrtrgn on 09/09/08


Tagged

testing unit


Versions (?)

listProps.js


 / Published in: JavaScript
 

URL: http://homepage.mac.com/dr_turgeon/sources/listProps.js

  1. /*---------------------------------------------------------------------------*/
  2. function listProps0(obj,dpr){var I=arguments.callee;(!I.i)?I.i=1:I.i++;
  3. if (obj===undefined) obj={ a1:{ a2:{a3:1}, b2:{b3:2}, c2:{c3:3} } }; var all=[];
  4. for (var o in obj){ all=all.concat(o); var oo = obj[o]; if (typeof oo == 'object' && dpr) all=all.concat( I(oo) );
  5. } return all.join(',');
  6. }
  7. function getMembers(obj,dpr){
  8. var all = [];
  9. for (var o in obj){
  10. var oo = obj[o];
  11. all = all.concat(oo);
  12. if (typeof oo == 'object' && dpr)
  13. all = all.concat( I(oo) );
  14. } return all;
  15.  
  16. }
  17. /*---------------------------------------------------------------------------*/
  18. /* test msg */
  19. var GI = { t1:{},t2:{},t3:{} };
  20. var GI_a = GI.t1.g1 = ['div_GI_tmp_a','_type_GI_TransName','_type_GI_EmpNumber','_pick_GI_Mover_Type'];
  21. var GI_b = GI.t1.g2 = ['div_GI_tmp_b','_type_GI_StartDate','_type_GI_NewAnnualSalary','_type_GI_AreaDifferential','_type_GI_PositionMRP'];
  22. var GI_c = GI.t1.g3 = ['div_GI_tmp_c','_type_GI_HomeStreet','_type_GI_HomeCity','_type_GI_HomeState','_type_GI_HomeZip','_type_GI_HomePhone','_type_GI_HomeEmail'];
  23. var GI_d = GI.t1.g4 = ['div_GI_tmp_d','_YorN_GI_TransSOCO','_YorN_GI_TransROOCA'];
  24. var GI_e = GI.t1.g5 = ['div_GI_tmp_e','_type_GI_ContactEmail','_type_GI_ContactPhone'];
  25. var GI_f = GI.t1.g6 = ['div_GI_tmp_f','_type_GI_HiringManager','_type_GI_HiringPhone'];
  26. var GI_g = GI.t1.g7 = ['div_GI_tmp_g','_type_GI_OldWorkCity','_type_GI_OldWorkState','_type_GI_OldWorkCode','_type_GI_OldWorkAU','_type_GI_OldWorkMAC','_type_GI_OldWorkWorkPhone'];
  27. var GI_h = GI.t1.g8 = ['div_GI_tmp_h','_type_GI_OldWorkCity','_type_GI_NewWorkState','_type_GI_NewWorkCode','_type_GI_NewWorkAU','_type_GI_NewWorkMAC','_type_GI_NewWorkWorkPhone'];
  28. var GI_i = GI.t2.g9 = ['div_GI_tmp_i','_type_GI_Benes'];
  29. var GI_j1 = GI.t2.g10 = ['div_GI_tmp_j1','_pick_GI_Package'];
  30. var GI_j2 = GI.t2.g11 = ['div_GI_tmp_j2','_YorN_GI_Auth'];
  31. var GI_k1 = GI.t2.g12 = ['div_GI_tmp_k1','_type_GI_Comments'];
  32. var GI_k2 = GI.t2.g14 = ['div_GI_tmp_k2','_type_GI_InfoRequested'];
  33. var GI_l = GI.t1.g15 = ['div_GI_tmp_l','_type_GI_CompletedName','_type_GI_CompletedTitle','_type_GI_CompletedPhone','_type_GI_CompletedEmail'];
  34.  
  35. var LIST_GI_T1 = ['div_GI' ].concat( getMembers(GI.t1,0) );
  36. log = '<h3>'+LIST_GI_T1+'</h3>';
  37.  
  38. /*---------------------------------------------------------------------------*/

Report this snippet  

You need to login to post a comment.