doWhileLoop

Coverity Documentation

Version
latest

Matches do ... while loops.

This pattern only matches nodes of type statement.

Properties

doWhileLoop produces a record that contains the following properties:

Name Type Description
bodyStatement statement The statement that the loop iterates. Frequently, this is a blockStatement.
conditionExpression expression The condition that causes the loop to terminate

Inherits properties from:

Example

The doWhileLoop pattern matches the following loop:


JavaScript code follows
    do {
        i++;
    } while(true);

In this instance, CodeXM sets the .conditionExpression property to the literal true, and the .bodyStatement property to the statement {i++;}.