PageRenderTime 43ms CodeModel.GetById 38ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/pyjs/tests/test019.js

http://pyjamas.googlecode.com/
JavaScript | 42 lines | 37 code | 5 blank | 0 comment | 8 complexity | f385e6d446a2da0bb685db7f5606249d MD5 | raw file
 1__Schedule.prototype.__class__ = "Schedule";
 2function Schedule() {
 3    return new __Schedule();
 4}
 5function __Schedule() {
 6    this.timeSlots = new pyjslib_List([]);
 7}
 8__Schedule.prototype.addTimeSlot = function(timeSlot) {
 9    this.timeSlots.append(timeSlot);
10};
11__Schedule.prototype.getDescription = function(daysFilter) {
12    var s = null;
13
14        var __timeSlot = this.timeSlots.__iter__();
15        try {
16            while (true) {
17                var timeSlot = __timeSlot.next();
18                
19        
20    if (daysFilter.__getitem__(timeSlot.dayOfWeek)) {
21    if (!(s)) {
22    var s = timeSlot.getDescription();
23    }
24    else {
25    s +=  ( ", " + timeSlot.getDescription() ) ;
26    }
27    }
28
29            }
30        } catch (e) {
31            if (e != StopIteration) {
32                throw e;
33            }
34        }
35        
36    if (s) {
37    return s;
38    }
39    else {
40    return "";
41    }
42};