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

Problem with 'each' #162

Closed
dizlexik opened this issue Mar 8, 2011 · 1 comment
Closed

Problem with 'each' #162

dizlexik opened this issue Mar 8, 2011 · 1 comment

Comments

@dizlexik
Copy link

dizlexik commented Mar 8, 2011

I updated from Jade 0.6.3 to 0.8.1 and the following code that worked previously is now acting differently.

  • Node
    res.render('test', { items: [1, 2, 3, 4, 5] });
  • Jade
    h1 Test
    - var count = 1
    - each item in items
    p= count++
  • Output (v0.6.3)
    1
    2
    3
    4
    5
  • Output (v0.8.1)
    2
    4
    6
    8
    10

The increment operator seems to be running twice per iteration now for some reason.
I hope this is easily fixed. I've rolled back to v0.6.3 for now.

@tj
Copy link
Contributor

tj commented Mar 8, 2011

Fixed issue with expressions being evaluated several times. closed by dacd8f9

basically the same problem as C macros :) thanks for catching this

rauchg pushed a commit to rauchg/jade that referenced this issue Oct 1, 2011
…gjs#162

basically the same problem as C macros :) thanks for catching this
This issue was closed.
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