LCOV - code coverage report

Current view
top level - src/converters - serialization_context.dart
Test
lcov.info
Date
2025-03-26
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines8988.9%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'dart:collection';
2
3import 'package:meta/meta.dart';
4
5class SerializationContext {
64 SerializationContext(bool Function(Object, Object) identical)
74 : _cache = HashMap(equals: identical);
8
9 final HashMap<Object, Object> _cache;
10
114 T? getReference<T extends Object>(Object data) {
128 final ref = _cache[data];
134 return (ref is T) ? ref : null;
14 }
15
164 void setReference<T extends Object>(Object data, T instance) {
178 _cache[data] = instance;
18 }
19}
20
21@internal
22extension SerializationContextImpl on SerializationContext {
233 void reset() => _cache.clear();
24
250 Map<Object, Object> get cache => _cache;
26}
Choose Features