Options
All
  • Public
  • Public/Protected
  • All
Menu

Class If

Simple two-way conditional expression.

Hierarchy

Index

Constructors

constructor

  • Create a new If expression.

    When this If expression is executed, the condition will be evaluated, and if it produces a true value, thenBranch will be executed and used as the return value for this expression. Otherwise, elseBranch will be executed and used as the return value, if it is provided.

    Parameters

    • cond: Expr

      The condition to check. Must evaluate to uint64.

    • thenBranch: Expr

      Expression to evaluate if the condition is true.

    • Optional elseBranch: Expr

      Expression to evaluate if the condition is false. Must evaluate to the same type as thenBranch, if provided. Defaults to None.

    Returns If

Properties

cond

cond: Expr

Optional elseBranch

elseBranch: Expr

thenBranch

thenBranch: Expr

Methods

And

  • Take the logical And of this expression and another one.

    This expression must evaluate to uint64.

    This is the same as using And() with two arguments.

    Parameters

    Returns Expr

Or

  • Take the logical Or of this expression and another one.

    This expression must evaluate to uint64.

    This is the same as using Or() with two arguments.

    Parameters

    Returns Expr

add

and

eq

ge

gt

invert

le

lt

mod

mul

ne

or

sub

teal

toString

  • toString(): string

truediv

typeOf

xor

Generated using TypeDoc