Repository navigation
Conversation
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.
{{ value is iterable }}returnsfalsefor mappings, although the interpreter already supports iterating their keys. As a result, an iterable guard skips a valid mapping loop.Include
ObjectValuein the test and cover empty/nonempty mappings, other value types, and a guarded key loop. This matches Jinja’s iterable test.Validation: 772 tests pass across the templates, utilities, interpreter, formatting, and memory suites; Jinja build (including TypeScript declarations), ESLint, formatting, and
git diff --checkpass. The three mapping regressions fail before the change.The model-download e2e suite is excluded: this checkout lacks a built
@huggingface/hubworkspace dependency.Note
Low Risk
Narrow runtime change to one built-in test predicate plus tests; no auth, I/O, or broad interpreter refactor.
Overview
The built-in
iterabletest now treats mappings (ObjectValue) as iterable, alongside arrays and strings, so{{ value is iterable }}matches Jinja and guards like{% if value is iterable %}{% for key in value %}…work for dict-like values.The predicate in
runtime.tswas widened to useinstanceofforArrayValue,StringValue, andObjectValue. New regression tests cover empty/non-empty objects, strings, arrays, and non-iterables, plus a guarded key loop over a mapping.Reviewed by Cursor Bugbot for commit 9dbc96d. Bugbot is set up for automated code reviews on this repo. Configure here.