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
>=: undefined method `>=' for nil #4046
Comments
I have transferred this issue to Asciidoctor core since the same problem exists there and is inherited by Asciidoctor.js |
What this expression resolves to is:
If you try to run that in Ruby, you will get a NoMethodError. For any operation that cannot be run, I think Asciidoctor should resolve the value to false instead of raising an exception. |
There's actually a test for this scenario, but the test uses the |
…if comparison operation cannot be performed
The workaround is to enclose the value in quotes.
However, that does slightly change the semantics of the comparison. It may work for your use case, though. |
Is it the string comparison rules for JavaScript or Ruby in effect here for the Asciidoctor.js version? |
For these kinds of comparisons, the behavior seems to be the same.
|
...and even if the behavior of JavaScript differs from Ruby, the Opal abstraction layer should be normalizing any differences. |
It's pretty easy to reproduce this error even for a defined attribute:
Generally, the policy of Asciidoctor is to not crash as a result of document contents. Therefore, it's consistent with that policy to skip the block when the comparison fails. I don't think a warning is warranted since a failed comparison is a valid outcome. |
…if comparison operation cannot be performed
…if comparison operation cannot be performed
@mojavelinux thanks! |
…on operation cannot be performed (PR #4047)
This originates from:
where
{release}
is not defined anywhere. It builds without any errors when using CLI (asciidoctor -B . -a toc -d book <file>
), but not with JavaScript:Is there any option that avoids the exception?
Thanks!
The text was updated successfully, but these errors were encountered: