CodeUnitAt constructor

CodeUnitAt()

Implementation

CodeUnitAt()
  : super(
      methodName: "codeUnitAt",
      arity: 1,
      targetType: NativeMethodTarget.string,
      function: (target, _, args) {
        final arg = args[0];
        if (arg is! int) {
          throw RuntimeError("codeUnitAt() takes an integer as an argument.");
        }
        return target.codeUnitAt(arg);
      },
    );