UnaryOperator constructor

UnaryOperator(
  1. dynamic exp
)

Creates a UnaryOperator from the given argument.

If the argument is not an expression, it will be wrapped in an appropriate literal.

  • A (positive) number will be encapsulated in a Number Literal,
  • A string will be encapsulated in a Variable Literal.

Implementation

UnaryOperator(dynamic exp) {
  this.exp = _toExpression(exp);
}