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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Interpreter warning from Jekyll::Renderer #7448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch 馃憤
Note: Renderer
has a :layouts=
method to set the value of @layouts
I don鈥檛 think the goal here is memorization. Looking back at Git history, we used to set |
@pathawks That's the insight I was hoping for. I couldn't tell from the test suite which way to go here. All tests pass in either case. If you'd like me to switch to just removing the warning (and not adding memoization), I can proceed accordingly (by setting the value in the initializer like you suggested). |
Yeah, let鈥檚 go that route instead. 馃憤馃徏 |
IMHO, there wouldn't be much of an issue because with this memoization, calling |
- assign a default value to @layouts in Jekyll::Renderer
f21c053
to
38cd6eb
Compare
Code updated. |
Thanks @mojavelinux 馃憤 @jekyllbot: merge +fix |
Thank you all for reviewing! |
Change OR operator to a lazy assignment in Jekyll::Renderer#layouts
This is a 馃悰 bug fix.
Summary
When warnings are enabled, Jekyll emits a rather insidious warning message (inidious because of how many times it occurs).
This patch fixes the problem.
Context
Based on other methods in the Jekyll::Renderer class, I believe the intention is to use a lazy assignment operator here instead of an OR operation.
If that's not the case, then I can update the patch to allow the OR operator to be used without emitting a warning.
Semver Changes
Patch.