$parse static method

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

Wrapper of num.parse

Implementation

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

  try {
    result = int.parse(source, radix: radix);
  } on FormatException catch (e) {
    runtime.$throw($FormatException.wrap(e));
    return null;
  }

  return $int(result);
}