[DF] support for fastutil::evalText#2448
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for treating evalText() like an eval()-style built-in evaluation function in the dataflow engine, and extends slicing test coverage accordingly.
Changes:
- Register
evalTextas a built-in handled by the existingEvalprocessor. - Extend eval-string resolution logic to optionally accept direct string/symbol/function-call arguments (not only
parse(text=...)). - Add backward slicing tests covering
evalText()usage patterns (direct, indirect, conditional string selection, etc.).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/functionality/slicing/backward/static-backward-program-slices/eval.test.ts | Adds new slicing tests for evalText() scenarios. |
| src/dataflow/internal/process/functions/call/built-in/built-in-eval.ts | Extends eval code-string resolution to support direct arguments when configured. |
| src/dataflow/environments/default-builtin-config.ts | Registers evalText to be processed by the built-in eval handler with the new flag enabled. |
Comments suppressed due to low confidence (1)
src/dataflow/internal/process/functions/call/built-in/built-in-eval.ts:53
processEvalCallstill bails out unlessargs.length === 1. This meansevalText("...", env(...))(andeval(expr, envir, ...)) will skip string evaluation entirely, reducing slicing precision and emitting a misleading warning. Consider accepting 1+ arguments (use the first as the code expression, optionally interpret/ignore the rest), and update the warning to include the actual function name (e.g.,evalvsevalText) and the supported signature.
): DataflowInformation {
if(args.length !== 1 || args[0] === EmptyArgument || !args[0].value) {
dataflowLogger.warn(`Expected exactly one argument for eval currently, but got ${args.length} instead, skipping`);
return processKnownFunctionCall({ name, args, rootId, data, origin: 'default' }).information;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
src/dataflow/internal/process/functions/call/built-in/built-in-eval.ts:54
- The warning message is hard-coded to
eval, but this processor now also handlesevalText(via config). Please use the actual called function name (e.g., fromname.content) in the warning so diagnostics are correct for both functions.
if(args.length !== 1 || args[0] === EmptyArgument || !args[0].value) {
dataflowLogger.warn(`Expected exactly one argument for eval currently, but got ${args.length} instead, skipping`);
return processKnownFunctionCall({ name, args, rootId, data, origin: 'default' }).information;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.