Any constructor

Any()

Implementation

Any()
  : super(
      methodName: "any",
      targetType: .list,
      arity: 1,
      function: (target, vm, arguments) async {
        if (arguments[0] is! ObjClosure) {
          throw RuntimeError("Any function must be a function.");
        }
        for (var element in target) {
          bool result =
              await invokeScriptClosure(vm, arguments[0], [element]) as bool;
          if (result) return true;
        }
        return false;
      },
    );