3a9LL / attackapi

Automatically exported from code.google.com/p/attackapi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug, AttackAPI.dom.zombiefyL

GoogleCodeExporter opened this issue · comments

Code:
    AttackAPI.dom.zombiefyL = function (url, interval) {
        var interval = (interval == 'undefined')?interval:2000;

        window.setInterval(function () {
            AttackAPI.dom.requestJSL(url + '?action=pull');
        }, interval);
    };

What is the expected output? What do you see instead?
Shouldn't it be:
var interval = (interval != 'undefined')?interval:2000;


Please provide any additional information below.


Original issue reported on code.google.com by sirdarckcat on 12 Aug 2007 at 6:45

[deleted comment]
:), he seems to be busy.

But shouldn't it actually be
 (interval)?interval:2000
that is, with no comparison to undefined. We check if interval is truthy (null, 
undefined, 0, '', NaN, ...) or not.

bedirhan

Original comment by bedirhan...@gmail.com on 17 Aug 2007 at 9:35

we should also use 
 typeof interval == "number"

Original comment by bedirhan...@gmail.com on 28 Oct 2007 at 9:15

Original comment by pdp.gnucitizen on 10 Feb 2011 at 4:51

  • Changed state: WontFix