Skip to content

Clarify truthiness definitions in logical operators#1176

Closed
NullVoxPopuli wants to merge 1 commit intomainfrom
NullVoxPopuli-patch-2
Closed

Clarify truthiness definitions in logical operators#1176
NullVoxPopuli wants to merge 1 commit intomainfrom
NullVoxPopuli-patch-2

Conversation

@NullVoxPopuli
Copy link
Copy Markdown
Contributor

@NullVoxPopuli NullVoxPopuli commented Apr 27, 2026

Been doing some pondering as implementing

The RFC was originally written under an assumption that ember-truth-helpers used a JavaScript definition of truthiness, and wanted to use a handlebars definition of truthiness.

It's worth bringing this up again because:

However, if and unless are still using handlebars truthiness, and their behavior is a good argument for keeping the RFC as is.

And, TS can and does represent handlebars semantics now https://github.com/jmurphyau/ember-truth-helpers/blob/master/type-tests/utils/truth-convert.test.ts

Other discussions from the past:

Important

I think we should keep the RFC as-is, and keep handlebars truthiness semantics. Because we can't really have some utils be one kind of truthy and if/unless be another kind

Updated definitions to clarify that truthiness is based on JavaScript's definition instead of Handlebars'.
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.

1 participant