strange comma when using 'for in' #3

Closed
LnL7 opened this Issue Apr 9, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@LnL7

LnL7 commented Apr 9, 2012

  • (ck.compile -> div -> div a for a in ['1','2'])({})

This template wil generate the following HTML, but also includes a comma...

  • <div><div>1</div><div>2</div>,</div>

I think it's generated by line 37

@aeosynth

This comment has been minimized.

Show comment Hide comment
@aeosynth

aeosynth Apr 9, 2012

Owner
div a for a in ['1','2']

is equivalent to

[div('1'), div('2')]

and i'm pretty sure that's throwing something off; arrays aren't expected

Owner

aeosynth commented Apr 9, 2012

div a for a in ['1','2']

is equivalent to

[div('1'), div('2')]

and i'm pretty sure that's throwing something off; arrays aren't expected

shamrin added a commit to shamrin/ck that referenced this issue Jul 20, 2012

@shamrin

This comment has been minimized.

Show comment Hide comment
@shamrin

shamrin Jul 20, 2012

Contributor

Comma appears because in JavaScript:

[undefined,undefined].toString() == ','
Contributor

shamrin commented Jul 20, 2012

Comma appears because in JavaScript:

[undefined,undefined].toString() == ','

aeosynth added a commit that referenced this issue Aug 10, 2012

Merge pull request #6 from shamrin/autoescape
Fix autoescape (#4), ignore non-strings (#3)

@aeosynth aeosynth closed this Aug 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment