Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

setTimeout in v0.7.10-pre #3432

@mraymond

Description

@mraymond

The following code works in browser and v0.6.19 as expected,

(function loop(timer){
    if(!timer) timer = 900;
    console.log('Timer is '+ timer);
    setTimeout(function(){
        var timer = Math.floor(Math.random() * (4000 + 1)) + 1000;
        //doSomething();
        loop(timer );
    }, timer);
})();

Will display,
Timer is 900
Timer is 1895
Timer is 2839
Timer is 4752
Timer is 4556
Timer is 2115

Under v0.7.10-pre(the only other version I tried), will display
Timer is 900
Timer is 4975
and hang there. Setting the initial value to anything above ~3 seconds will cause it to hang from the start

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions