Skip to content

All values in Liquid are truthy except nil and false.#26

Merged
harttle merged 2 commits into
harttle:masterfrom
chenos:master
Mar 21, 2017
Merged

All values in Liquid are truthy except nil and false.#26
harttle merged 2 commits into
harttle:masterfrom
chenos:master

Conversation

@chenos
Copy link
Copy Markdown
Contributor

@chenos chenos commented Mar 20, 2017

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.001%) to 98.874% when pulling d8119e6 on chenos:master into 2ae6874 on harttle:master.

Comment thread src/syntax.js Outdated

function isFalsy(val) {
return !isTruthy(val);
return false === val || undefined === val;
Copy link
Copy Markdown
Owner

@harttle harttle Mar 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding, ruby's nil is null or undefined in javascript.

So

return false === val || undefined === val || null === val;

Comment thread test/tags/for.js
});

it('should support for reversed in the first position', function() {
it('should support for reversed in the middle position', function() {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.001%) to 98.874% when pulling 7400e06 on chenos:master into 2ae6874 on harttle:master.

@harttle harttle merged commit 6677486 into harttle:master Mar 21, 2017
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

Successfully merging this pull request may close these issues.

3 participants