Repository navigation
UndefinedObject: don't report continue in a for loop offset - #1364
Open
barrymcgee wants to merge 1 commit into
Open
barrymcgee wants to merge 1 commit into
barrymcgee wants to merge 1 commit into
Conversation
{% for x in y offset: continue %} resumes a loop where the previous loop over the same collection stopped. continue is a keyword there, but the check read it as a variable lookup and reported "Unknown object 'continue' used." Dawn, Craft and Sense all hit this in sections/main-product.liquid. Only for supports it, so tablerow, other arguments and continue.<property> are still reported.
barrymcgee
marked this pull request as ready for review
October 22, 2026 11:38
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you adding in this PR?
UndefinedObjectno longer reportscontinuein{% for ... offset: continue %}.In a
fortag,offset: continueis a Liquid keyword. It starts the loop where the last loop over the same collection stopped. The check readcontinueas a variable lookup and reported:Dawn, Craft and Sense hit this in their own code, in
sections/main-product.liquid:{% for product in recommendations.products limit: n offset: continue %}The check now skips
continueonly when all of these are true:continue, notcontinue.size).offset:argument.for. Ruby Liquid supportsoffset: continueonly infor, sotablerowis still reported.{{ continue }},limit: continue,offset: continue.sizeandtablerow ... offset: continueare still reported.What's next? Any followup issues?
None for this check. Dawn has a separate PR for its other Theme Check warnings.
Tophatting
offset: continuecases are not reported. This spec fails without the fix.undefined-object/index.spec.tspass. Prettier is clean.theme-check-nodewith this change no longer reportscontinueon Dawnmain.{% liquid %}tag form andfor ... reversed offset: continueare not reported.Before you deploy
changeset