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

await and defer destroys any for loop #45

Open
neimanpinchas opened this issue Jun 14, 2016 · 1 comment
Open

await and defer destroys any for loop #45

neimanpinchas opened this issue Jun 14, 2016 · 1 comment

Comments

@neimanpinchas
Copy link

var array=['sun','mon','tue']
sync.fiber(
function(){
for (i=0;i<array.length;i++)
{
console.log(sync.await(readFile(array[i],'utf8',sync.defer()))) //does only sunday
}
var i=0
while (i<array.length)
{
console.log(sync.await(readFile(array[i],'utf8',sync.defer()))) //does all days
i++
}
})
@d3m3vilurr
Copy link
Collaborator

I was tested this with same code(just one diff, I was used real fs.readFile), but cannot reproduce.
is this issue real??

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

2 participants