Merge branch 'feature/pstewart-refactor' of https://git.protevus.com/protevus/platform into feature/pstewart-refactor

This commit is contained in:
Patrick Stewart 2024-11-29 13:21:37 -07:00
commit b1bafb418e
2 changed files with 9 additions and 12 deletions

View file

@ -117,12 +117,14 @@ class Scanner {
// Create and register factory function // Create and register factory function
final factory = _createConstructorFactory(type, constructor); final factory = _createConstructorFactory(type, constructor);
Reflector.registerConstructorFactory(type, constructor.name, factory); if (factory != null) {
Reflector.registerConstructorFactory(type, constructor.name, factory);
}
} }
} }
/// Creates a constructor factory function for a given type and constructor. /// Creates a constructor factory function for a given type and constructor.
static Function _createConstructorFactory( static Function? _createConstructorFactory(
Type type, ConstructorInfo constructor) { Type type, ConstructorInfo constructor) {
final wrapper = _FactoryWrapper(type, constructor.name); final wrapper = _FactoryWrapper(type, constructor.name);
return (List<dynamic> args, [Map<Symbol, dynamic>? namedArgs]) { return (List<dynamic> args, [Map<Symbol, dynamic>? namedArgs]) {

View file

@ -61,20 +61,15 @@ class IsolateMirrorImpl implements IsolateMirror {
if (identical(this, other)) return true; if (identical(this, other)) return true;
if (other is! IsolateMirrorImpl) return false; if (other is! IsolateMirrorImpl) return false;
return _debugName == other._debugName && // Only compare debug name and isCurrent flag
_isCurrent == other._isCurrent && // Two mirrors pointing to the same isolate should be equal
_rootLibrary == other._rootLibrary && return _debugName == other._debugName && _isCurrent == other._isCurrent;
_underlyingIsolate == other._underlyingIsolate;
} }
@override @override
int get hashCode { int get hashCode {
return Object.hash( // Hash code should be consistent with equals
_debugName, return Object.hash(_debugName, _isCurrent);
_isCurrent,
_rootLibrary,
_underlyingIsolate,
);
} }
@override @override