View Issue Details

IDProjectCategoryView StatusLast Update
0001498AJAX/JSBug Report - Interfacepublic2009-10-18 09:34
Reportertwpol Assigned Tofahrenheit  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0001498: [IE] anime.js: changeWatchedState(): fails with "'null' is null or not an object" because indexOf is enumerated
Descriptionhttp://static.anidb.net/js/anime3/anime.js, line 998 enumerates an array (file.epRelations) and puts all the keys into eids. In IE, because Array.prototype.indexOf is added by other JS code and isn't native, this sets eids["indexOf"] = 1 as well.

Then, the loop below (line 999) goes through all the keys in eids and breaks on the "indexOf" item (unsurprisingly).

Suggestion: replace this
    for (var eid in file.epRelations) eids[eid] = 1;
with this
    for (var eid in file.epRelations)
        if (typeof file.epRelations[eid] != "function")
            eids[eid] = 1;
Additional InformationMozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; WWTClient2)
TagsNo tags attached.

Activities

fahrenheit

2009-04-16 21:44

reporter   ~0002704

thanks for the report, if you notice more stuff like that do warn, the lack of indexOf is a major pain..

twpol

2009-10-02 01:46

reporter   ~0003003

Many appologies, the fix I suggested was wrong.

This code:
    for (var eid in file.epRelations) {
        if (typeof file.epRelations[eid] != "function") eids[eid] = 1;
    }
Can be put back to the original:
    for (var eid in file.epRelations) eids[eid] = 1;

And after theses lines:
    for (var eid in eids) {
        if (!eids[eid]) continue;
        var episode = episodes[eid];
        var row = document.getElementById('e'+eid+'f'+file.id);
Add this line to check we've got a real episode:
        if (!episode || !row) continue;

Sorry. :(

Issue History

Date Modified Username Field Change
2009-04-12 03:25 twpol New Issue
2009-04-13 01:24 DerIdiot Status new => assigned
2009-04-13 01:24 DerIdiot Assigned To => fahrenheit
2009-04-16 21:44 fahrenheit Note Added: 0002704
2009-04-16 21:44 fahrenheit Status assigned => resolved
2009-04-16 21:44 fahrenheit Resolution open => fixed
2009-10-02 01:46 twpol Note Added: 0003003
2009-10-02 01:46 twpol Status resolved => feedback
2009-10-02 01:46 twpol Resolution fixed => reopened
2009-10-02 15:00 DerIdiot Project HTML & PERL => AJAX/JS
2009-10-18 09:34 fahrenheit Status feedback => resolved
2009-10-18 09:34 fahrenheit Resolution reopened => fixed