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

Fixed #801 #815

Merged
merged 3 commits into from Mar 15, 2013

Conversation

Projects
None yet
3 participants
@raix
Contributor

raix commented Mar 14, 2013

{{#each}} broke when iterating over null eg. [1, 2, null] - evaluate.js->each tried getting property ._id from null.

@Tarang

This comment has been minimized.

Contributor

Tarang commented Mar 14, 2013

Would this work, if I ran the below in my js console

(thisvar && thisvar.subvar)

I would get an error (thisvar not being defined)

So with an array like this:

["a","b",undefined]

it would still be a problem

I think it needs to check if x exists first, then check continue to the next step (this way null and undefined and edge cases are taken care of i.e. I don't think using if(x) can be used because then 0 & false would be issues

(x==null) should take care of undefined too

var branch = null;
if(!x==null) var branch = ((x._id && x) || (typeof x === 'string' ? x : null) ||
                       Spark.UNIQUE_LABEL);
@raix

This comment has been minimized.

Contributor

raix commented Mar 14, 2013

Yep, it works even if undefined - I think the test in your browser lacks the existens of thisvar - theres no memory allocated - in evaluate.js the x is handed as a function parametre, therefore it exists, but could be a falsy

In console try:

    var foo; //foo is undefined but it exists
    if (foo) { console.log('true'); } else { console.log('false');}

raix added some commits Mar 14, 2013

Fixed reactive each
Mentioned by Chris Mather on google talk

cmather pushed a commit that referenced this pull request Mar 15, 2013

@cmather cmather merged commit 0ead1fb into meteor:devel Mar 15, 2013

@raix

This comment has been minimized.

Contributor

raix commented Mar 15, 2013

Thanks, close #801 ? :)

@cmather

This comment has been minimized.

Contributor

cmather commented Mar 15, 2013

On it :-)

@cmather

This comment has been minimized.

Contributor

cmather commented Mar 15, 2013

Thanks @raix!

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