Repository navigation
Export variables inside strings as valid code - #1998
Conversation
The preprocessor marks each ${name} in a target or value, and the marks are
replaced after the command is emitted. Inside a string literal, the string
is split around the variable ("Hi " + vars["name"]). A variable that is the
whole string is used as it is. Outside a string, it's the plain lookup.
Each language says which quotes start a string and how to turn a variable
into a string (str() in Python, .to_s in Ruby).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
PR Summary by QodoExport variables inside strings as valid code
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
- Remove marker characters from command parameters, so only marks made
from ${name} are resolved
- Keep a mark with no end as it is, and don't let a backslash consume a mark
- Always convert a variable to a string inside a string literal, and use
String() in JavaScript so numbers are joined, not added
- Remove the variable checks in send keys and the Python label locator,
which can't match anymore
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 5832489 |
Description
defaultPreprocessormarks each${name}(all of them, not only the first) instead of putting the lookup in place.resolveVariablesreplaces the marks:"Hi ${name}!"becomes"Hi " + vars["name"] + "!"By.id(vars["ID"])variableInString: which quotes start a string, and how to turn a variable into a string (str()in Python,.to_sin Ruby).echoworkarounds that only handled a message that was just a variable.Motivation and Context
A variable inside a string was exported as broken code, e.g.
console.log("This is a test string vars["number"]")orBy.id("vars["ID"]"). This came from v3.Exporting every project in
tests/examplesin all six languages:timesloop, a separate bug).Types of changes
Checklist
🤖 Generated with Claude Code