Closed Bug 79251 Opened 23 years ago Closed 1 year ago

PAC: weekdayRange() see comment 8

Categories

(Core :: Networking, defect, P5)

defect

Tracking

()

RESOLVED WONTFIX
mozilla0.9.4

People

(Reporter: benc, Unassigned)

References

Details

(Whiteboard: [necko-would-take])

Regarding deprecated function, here is implementation of weekdayRange():
------------------------------------------------------
var date = new Date();

var wdays = new Array("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT");

function weekdayRange() {
    function getDay(weekday) {
        for (var i = 0; i < 6; i++) {
            if (weekday == wdays[i])
                return i;
        }
        return -1;
    }
    var argc = arguments.length;
    var wday;
    if (argc < 1)
        return false;
    if (arguments[argc - 1] == "GMT") {
        argc--;
        wday = date.getUTCDay();
    } else {
        wday = date.getDay();
    }
    var wd1 = getDay(arguments[0]);
    var wd2 = (argc == 2) ? getDay(arguments[1]) : wd1;
    return (wd1 == -1 || wd2 == -1) ? false
                                    : (wd1 <= wday && wday <= wd2);

}
qa to me
depends on 53080
Depends on: 53080
OS: Windows 3.1 → All
QA Contact: tever → benc
Target Milestone: --- → mozilla0.9.3
No longer depends on: 53080
-->PAC bugs to Jussi
Assignee: neeti → jpm
QA Contact: benc → pacqa
Serge, can you take a look at these PAC issues? Thanks - Jussi-Pekka
Assignee: jpm → serge
Doesn't look like this is getting fixed before the freeze tonight.
Pushing out a milestone.  Please correct if I'm mistaken.
Target Milestone: mozilla0.9.3 → mozilla0.9.4
Blocks: 79893
I can't figure out what this bug is about -- the implementation given in the
summary went in as part of the PAC overhaul.  weekdayRange() is apparently
deprecated, but I assume that doesn't mean we're going to rip it out again.

I smell an easy resolution.  cc'ing gagan in case he knows something I don't.
I filed it because I was trying to rip all issues out of the bugs that had
morphed into many-headed hydras.

If it works and it's in, we are good.
I did some basic testing to make sure that it behaves, and everything seems ok.

Marking FIXED.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
REOPEN: (Since there is only one bug in the history of this function...)

I've been writing a whitebox/harness test for this function, and found the following:

1- The number of arguments is not properly enforced because after GMT is stripped, the number of arguments is not enforced.

2- The wrap-around date is not supported.

Status: RESOLVED → REOPENED
QA Contact: pacqa → benc
Resolution: FIXED → ---
Summary: PAC: weekdayRange() → PAC: weekdayRange() see comment 8
Whiteboard: [necko-would-take]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P5
Assignee: srgchrpv → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.