Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for loop paradigm failure #41

Open
thorsent opened this issue Jul 22, 2013 · 0 comments
Open

for loop paradigm failure #41

thorsent opened this issue Jul 22, 2013 · 0 comments

Comments

@thorsent
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant