generatorReturnValue

Coverity Documentation

Version
latest

This pattern, together with a generatorReturnStatement, matches non-void returns in generator-function bodies.

A valueExpression property holds the return value.

This pattern only matches nodes of type statement.

Properties

generatorReturnValue produces a record that contains the following property:

Name Type Description
valueExpression expression The expression that generates the return value

Inherits properties from:

Example

The generatorReturnValue pattern matches the following case:

JavaScript code follows
    function* gen(x) {
        yield 1;
        return x;
    };

In this instance, the .valueExpression property is the expression "x".