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

[BUGFIX beta] fix(glimmer/utils/to-bool): htmlSafe #18148

Merged

Conversation

buschtoens
Copy link
Contributor

Fixes #17486.

@buschtoens
Copy link
Contributor Author

@rwjblue Can you try restarting the build? There was a timeout.

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

@rwjblue
Copy link
Member

rwjblue commented Jun 27, 2019

I've restarted a few times, IE11 continues to fail in the same general way. 🤔

import { isArray } from '@ember/-internals/runtime';
import { Opaque } from '@glimmer/interfaces';

export default function toBool(predicate: Opaque): boolean {
if (isArray(predicate)) {
return (predicate as { length: number }).length !== 0;
} else if (isHTMLSafe(predicate)) {
return Boolean(String(predicate));
Copy link
Member

Choose a reason for hiding this comment

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

Can we call the string? predicate.toString()?

import { isArray } from '@ember/-internals/runtime';
import { Opaque } from '@glimmer/interfaces';

export default function toBool(predicate: Opaque): boolean {
if (isArray(predicate)) {
return (predicate as { length: number }).length !== 0;
} else if (isHTMLSafe(predicate)) {
return Boolean(String(predicate));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So like this?

Suggested change
return Boolean(String(predicate));
return Boolean(predicate.toString());

Copy link
Member

Choose a reason for hiding this comment

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

ya, thats what I was thinking, but I'm not really sure if thats the issue or not (was just grasping at straws a bit)

@locks locks self-assigned this Apr 19, 2020
@buschtoens buschtoens force-pushed the 17486-fix-template-if-empty-htmlSafe branch from 813f8dc to f94de89 Compare December 4, 2020 09:57
@locks
Copy link
Contributor

locks commented Dec 4, 2020

Thanks for the help!

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.

Empty htmlSafe string is treated as truthy
3 participants