lib/src/ast/nodes.dart:182 in dinja 1.0.0 writes to stdout:
print('DEBUG: For loop on Function: ${iterableVal.name}');
It sits inside ForStatement.execute, immediately before throw Exception('Expected iterable in for loop: got ...'). Every other DEBUG print in the package is commented out; this one was missed.
A library should not write to stdout — the line surfaces in the output of any application embedding dinja.
When it fires: a {% for %} iterating a value that resolves to a JinjaFunction — a bare builtin/global (range, dict, namespace, strftime_now, ...) or a method referenced without parentheses, e.g. {% for k, v in m.items %}.
Suggested fix: fold the function name into the exception thrown two lines later, so the diagnostic survives without touching stdout.
Found while auditing llamadart, which depends on dinja for chat-template capability detection.
lib/src/ast/nodes.dart:182in dinja 1.0.0 writes to stdout:It sits inside
ForStatement.execute, immediately beforethrow Exception('Expected iterable in for loop: got ...'). Every other DEBUG print in the package is commented out; this one was missed.A library should not write to stdout — the line surfaces in the output of any application embedding dinja.
When it fires: a
{% for %}iterating a value that resolves to aJinjaFunction— a bare builtin/global (range,dict,namespace,strftime_now, ...) or a method referenced without parentheses, e.g.{% for k, v in m.items %}.Suggested fix: fold the function name into the exception thrown two lines later, so the diagnostic survives without touching stdout.
Found while auditing llamadart, which depends on dinja for chat-template capability detection.