$tryParse static method

$Value $tryParse(
  1. Runtime runtime,
  2. $Value? target,
  3. List<$Value?> args
)
override

Wrapper of num.tryParse

Implementation

static $Value $tryParse(Runtime runtime, $Value? target, List<$Value?> args) {
  final source = args[0]!.$value as String;
  final radix = args[1]?.$value as int?;

  final result = int.tryParse(source, radix: radix);

  if (result == null) {
    return $null();
  }

  return $int(result);
}