Home Reference Source Repository
import {IfStatement} from 'esast/src/ast.js'
public class | source

IfStatement

Extends:

NodeStatement → IfStatement

An if (or if ... else) statement.

Constructor Summary

Public Constructor
public

constructor(test: *, consequent: *, alternate: *)

Member Summary

Public Members
public
public
public

Inherited Summary

From class Node
public get

type: *

For compatibility with other AST representations, all Node instances have a 'type' property that is the name of that type.
public

toJSON(): *

Convert to JSON.
public

toString(): *

Public Constructors

public constructor(test: *, consequent: *, alternate: *) source

Params:

NameTypeAttributeDescription
test *
consequent *
alternate *

Public Members

public alternate: Statement source

public consequent: Statement source

public test: Expression source