call method

  1. @override
Object? call(
  1. InterpreterVisitor visitor,
  2. List<Object?> positionalArguments, [
  3. Map<String, Object?> namedArguments = const {},
  4. List<RuntimeType>? typeArguments,
])
override

Implementation

@override
Object? call(InterpreterVisitor visitor, List<Object?> positionalArguments,
    [Map<String, Object?> namedArguments = const {},
    List<RuntimeType>? typeArguments]) {
  // Establish `D4.activeVisitor` for the duration of every interpreted
  // function call. This makes the visitor available to any native code
  // path that the user function triggers — most importantly the
  // `InterpretedInstance.==` / `.hashCode` overrides, which dispatch
  // through the active visitor when native Dart collections
  // (`Map<UserCell, …>`, `Set<UserCell>`, …) look up keys. Without this
  // wrap, native container operations downstream of a `targetValue[key]`
  // (visitIndexExpression) read `D4.activeVisitor == null` and silently
  // fall back to identity hashing, breaking content-equality lookups.
  return D4.withActiveVisitor<Object?>(visitor, () {
    return _callImpl(visitor, positionalArguments, namedArguments,
        typeArguments);
  });
}