Skip to content

Commit b0ea812

Browse files
committed
Implement encodeReturn
1 parent 5811a3c commit b0ea812

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/FlowSummaryPrivate.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,14 @@ module Steps = Private::Steps<FlowSummaryStepInput>;
380380
* `arg` will be printed in square brackets (`[]`) after the result, unless
381381
* `arg` is the empty string.
382382
*/
383-
string encodeReturn(ReturnKind rk, string arg) { none() }
383+
string encodeReturn(ReturnKind rk, string arg) {
384+
result = "ReturnValue" and
385+
(
386+
rk = MkNormalReturnKind() and arg = ""
387+
or
388+
rk = MkExceptionalReturnKind() and arg = "exception"
389+
)
390+
}
384391

385392
/**
386393
* Gets the textual representation of without-content `c` used in MaD.

0 commit comments

Comments
 (0)