Skip to content

for loop paradigm failure #41

@thorsent

Description

@thorsent

Been using tamed.js for well over a year now. Just noticed one looping paradigm that fails and figured I'd mention it as caution for others who might end up scratching their heads:

for(var i=0;i<bignumber;i++){
    if(something){
        await{
            asynciofunc(defer());
        }
    }
}

or similarly:

for(var i=0;i<bignumber;i++){
    if(!something) continue;
        await{
            asynciofunc(defer());
        }
    }
}

The the loop is large enough and with enough cases are short circuited then the call stack can be exceeded. I've worked around this issue by reorganizing my code to make two passes. Definitely interested to hear about any other reorganizations that might work in this scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions