| library; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:collection" as col; |
| import "dart:_internal" as _in; |
| |
| import "dart:collection"; |
| |
| abstract class _MyMap&Object&MapMixin<K extends core::Object? = dynamic, V extends core::Object? = dynamic> extends core::Object implements col::MapBase<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%> /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ { |
| const synthetic constructor •() → self::_MyMap&Object&MapMixin<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%> |
| : super core::Object::•() |
| ; |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ containsKey(core::Object? key) → core::bool |
| return this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::contains}(key){(core::Object?) → core::bool}; |
| abstract operator /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ [](core::Object? key) → self::_MyMap&Object&MapMixin::V?; |
| abstract operator /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ []=(covariant-by-class self::_MyMap&Object&MapMixin::K% key, covariant-by-class self::_MyMap&Object&MapMixin::V% value) → void; |
| abstract method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ clear() → void; |
| abstract method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ remove(core::Object? key) → self::_MyMap&Object&MapMixin::V?; |
| abstract get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ keys() → core::Iterable<self::_MyMap&Object&MapMixin::K%>; |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ cast<RK extends core::Object? = dynamic, RV extends core::Object? = dynamic>() → core::Map<self::_MyMap&Object&MapMixin::cast::RK%, self::_MyMap&Object&MapMixin::cast::RV%> |
| return core::Map::castFrom<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%, self::_MyMap&Object&MapMixin::cast::RK%, self::_MyMap&Object&MapMixin::cast::RV%>(this); |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ forEach((self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void action) → void { |
| { |
| synthesized core::Iterator<self::_MyMap&Object&MapMixin::K%> :sync-for-iterator = this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::iterator}{core::Iterator<self::_MyMap&Object&MapMixin::K%>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| self::_MyMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_MyMap&Object&MapMixin::K%}; |
| { |
| action(key, let self::_MyMap&Object&MapMixin::V? #t1 = this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} in #t1 == null ?{self::_MyMap&Object&MapMixin::V%} let self::_MyMap&Object&MapMixin::V? #t2 = #t1 in #t2 == null ?{self::_MyMap&Object&MapMixin::V%} #t2 as self::_MyMap&Object&MapMixin::V% : #t2{self::_MyMap&Object&MapMixin::V%} : #t1{self::_MyMap&Object&MapMixin::V%}){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void}; |
| } |
| } |
| } |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ addAll(covariant-by-class core::Map<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%> other) → void { |
| other.{core::Map::forEach}((self::_MyMap&Object&MapMixin::K% key, self::_MyMap&Object&MapMixin::V% value) → void { |
| this.{col::MapBase::[]=}(key, value){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void}; |
| }){((self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void) → void}; |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ containsValue(core::Object? value) → core::bool { |
| { |
| synthesized core::Iterator<self::_MyMap&Object&MapMixin::K%> :sync-for-iterator = this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::iterator}{core::Iterator<self::_MyMap&Object&MapMixin::K%>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| self::_MyMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_MyMap&Object&MapMixin::K%}; |
| { |
| if(this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} =={core::Object::==}{(core::Object) → core::bool} value) |
| return true; |
| } |
| } |
| } |
| return false; |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ putIfAbsent(covariant-by-class self::_MyMap&Object&MapMixin::K% key, covariant-by-class () → self::_MyMap&Object&MapMixin::V% ifAbsent) → self::_MyMap&Object&MapMixin::V% { |
| if(this.{col::MapBase::containsKey}(key){(core::Object?) → core::bool}) { |
| return let self::_MyMap&Object&MapMixin::V? #t3 = this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} in #t3 == null ?{self::_MyMap&Object&MapMixin::V%} let self::_MyMap&Object&MapMixin::V? #t4 = #t3 in #t4 == null ?{self::_MyMap&Object&MapMixin::V%} #t4 as self::_MyMap&Object&MapMixin::V% : #t4{self::_MyMap&Object&MapMixin::V%} : #t3{self::_MyMap&Object&MapMixin::V%}; |
| } |
| return let final self::_MyMap&Object&MapMixin::K% #t5 = key in let final self::_MyMap&Object&MapMixin::V% #t6 = ifAbsent(){() → self::_MyMap&Object&MapMixin::V%} in let final void #t7 = this.{col::MapBase::[]=}(#t5, #t6){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void} in #t6; |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ update(covariant-by-class self::_MyMap&Object&MapMixin::K% key, covariant-by-class (self::_MyMap&Object&MapMixin::V%) → self::_MyMap&Object&MapMixin::V% update, {covariant-by-class () →? self::_MyMap&Object&MapMixin::V% ifAbsent = #C1}) → self::_MyMap&Object&MapMixin::V% { |
| if(this.{col::MapBase::containsKey}(key){(core::Object?) → core::bool}) { |
| return let final self::_MyMap&Object&MapMixin::K% #t8 = key in let final self::_MyMap&Object&MapMixin::V% #t9 = update(let self::_MyMap&Object&MapMixin::V? #t10 = this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} in #t10 == null ?{self::_MyMap&Object&MapMixin::V%} let self::_MyMap&Object&MapMixin::V? #t11 = #t10 in #t11 == null ?{self::_MyMap&Object&MapMixin::V%} #t11 as self::_MyMap&Object&MapMixin::V% : #t11{self::_MyMap&Object&MapMixin::V%} : #t10{self::_MyMap&Object&MapMixin::V%}){(self::_MyMap&Object&MapMixin::V%) → self::_MyMap&Object&MapMixin::V%} in let final void #t12 = this.{col::MapBase::[]=}(#t8, #t9){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void} in #t9; |
| } |
| if(!(ifAbsent == null)) { |
| return let final self::_MyMap&Object&MapMixin::K% #t13 = key in let final self::_MyMap&Object&MapMixin::V% #t14 = ifAbsent{() → self::_MyMap&Object&MapMixin::V%}(){() → self::_MyMap&Object&MapMixin::V%} in let final void #t15 = this.{col::MapBase::[]=}(#t13, #t14){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void} in #t14; |
| } |
| throw new core::ArgumentError::value(key, "key", "Key not in map."); |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ updateAll(covariant-by-class (self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → self::_MyMap&Object&MapMixin::V% update) → void { |
| { |
| synthesized core::Iterator<self::_MyMap&Object&MapMixin::K%> :sync-for-iterator = this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::iterator}{core::Iterator<self::_MyMap&Object&MapMixin::K%>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| self::_MyMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_MyMap&Object&MapMixin::K%}; |
| { |
| this.{col::MapBase::[]=}(key, update(key, let self::_MyMap&Object&MapMixin::V? #t16 = this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} in #t16 == null ?{self::_MyMap&Object&MapMixin::V%} let self::_MyMap&Object&MapMixin::V? #t17 = #t16 in #t17 == null ?{self::_MyMap&Object&MapMixin::V%} #t17 as self::_MyMap&Object&MapMixin::V% : #t17{self::_MyMap&Object&MapMixin::V%} : #t16{self::_MyMap&Object&MapMixin::V%}){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → self::_MyMap&Object&MapMixin::V%}){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void}; |
| } |
| } |
| } |
| } |
| get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ entries() → core::Iterable<core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>> { |
| return this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::map}<core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>>((self::_MyMap&Object&MapMixin::K% key) → core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%> => new core::MapEntry::_<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>(key, let self::_MyMap&Object&MapMixin::V? #t18 = this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} in #t18 == null ?{self::_MyMap&Object&MapMixin::V%} let self::_MyMap&Object&MapMixin::V? #t19 = #t18 in #t19 == null ?{self::_MyMap&Object&MapMixin::V%} #t19 as self::_MyMap&Object&MapMixin::V% : #t19{self::_MyMap&Object&MapMixin::V%} : #t18{self::_MyMap&Object&MapMixin::V%})){((self::_MyMap&Object&MapMixin::K%) → core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>) → core::Iterable<core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>>}; |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ map<K2 extends core::Object? = dynamic, V2 extends core::Object? = dynamic>((self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → core::MapEntry<self::_MyMap&Object&MapMixin::map::K2%, self::_MyMap&Object&MapMixin::map::V2%> transform) → core::Map<self::_MyMap&Object&MapMixin::map::K2%, self::_MyMap&Object&MapMixin::map::V2%> { |
| core::Map<self::_MyMap&Object&MapMixin::map::K2%, self::_MyMap&Object&MapMixin::map::V2%> result = <self::_MyMap&Object&MapMixin::map::K2%, self::_MyMap&Object&MapMixin::map::V2%>{}; |
| { |
| synthesized core::Iterator<self::_MyMap&Object&MapMixin::K%> :sync-for-iterator = this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::iterator}{core::Iterator<self::_MyMap&Object&MapMixin::K%>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| self::_MyMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_MyMap&Object&MapMixin::K%}; |
| { |
| core::MapEntry<self::_MyMap&Object&MapMixin::map::K2%, self::_MyMap&Object&MapMixin::map::V2%> entry = transform(key, let self::_MyMap&Object&MapMixin::V? #t20 = this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} in #t20 == null ?{self::_MyMap&Object&MapMixin::V%} let self::_MyMap&Object&MapMixin::V? #t21 = #t20 in #t21 == null ?{self::_MyMap&Object&MapMixin::V%} #t21 as self::_MyMap&Object&MapMixin::V% : #t21{self::_MyMap&Object&MapMixin::V%} : #t20{self::_MyMap&Object&MapMixin::V%}){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → core::MapEntry<self::_MyMap&Object&MapMixin::map::K2%, self::_MyMap&Object&MapMixin::map::V2%>}; |
| result.{core::Map::[]=}(entry.{core::MapEntry::key}{self::_MyMap&Object&MapMixin::map::K2%}, entry.{core::MapEntry::value}{self::_MyMap&Object&MapMixin::map::V2%}){(self::_MyMap&Object&MapMixin::map::K2%, self::_MyMap&Object&MapMixin::map::V2%) → void}; |
| } |
| } |
| } |
| return result; |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ addEntries(covariant-by-class core::Iterable<core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>> newEntries) → void { |
| { |
| synthesized core::Iterator<core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>> :sync-for-iterator = newEntries.{core::Iterable::iterator}{core::Iterator<core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%> entry = :sync-for-iterator.{core::Iterator::current}{core::MapEntry<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>}; |
| { |
| this.{col::MapBase::[]=}(entry.{core::MapEntry::key}{self::_MyMap&Object&MapMixin::K%}, entry.{core::MapEntry::value}{self::_MyMap&Object&MapMixin::V%}){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → void}; |
| } |
| } |
| } |
| } |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ removeWhere((self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → core::bool test) → void { |
| core::List<self::_MyMap&Object&MapMixin::K%> keysToRemove = core::_GrowableList::•<self::_MyMap&Object&MapMixin::K%>(0); |
| { |
| synthesized core::Iterator<self::_MyMap&Object&MapMixin::K%> :sync-for-iterator = this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::iterator}{core::Iterator<self::_MyMap&Object&MapMixin::K%>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| self::_MyMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_MyMap&Object&MapMixin::K%}; |
| { |
| if(test(key, let self::_MyMap&Object&MapMixin::V? #t22 = this.{col::MapBase::[]}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?} in #t22 == null ?{self::_MyMap&Object&MapMixin::V%} let self::_MyMap&Object&MapMixin::V? #t23 = #t22 in #t23 == null ?{self::_MyMap&Object&MapMixin::V%} #t23 as self::_MyMap&Object&MapMixin::V% : #t23{self::_MyMap&Object&MapMixin::V%} : #t22{self::_MyMap&Object&MapMixin::V%}){(self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%) → core::bool}) |
| keysToRemove.{core::List::add}(key){(self::_MyMap&Object&MapMixin::K%) → void}; |
| } |
| } |
| } |
| { |
| synthesized core::Iterator<self::_MyMap&Object&MapMixin::K%> :sync-for-iterator = keysToRemove.{core::Iterable::iterator}{core::Iterator<self::_MyMap&Object&MapMixin::K%>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| self::_MyMap&Object&MapMixin::K% key = :sync-for-iterator.{core::Iterator::current}{self::_MyMap&Object&MapMixin::K%}; |
| { |
| this.{col::MapBase::remove}(key){(core::Object?) → self::_MyMap&Object&MapMixin::V?}; |
| } |
| } |
| } |
| } |
| get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ length() → core::int |
| return this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::length}{core::int}; |
| get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ isEmpty() → core::bool |
| return this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::isEmpty}{core::bool}; |
| get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ isNotEmpty() → core::bool |
| return this.{col::MapBase::keys}{core::Iterable<self::_MyMap&Object&MapMixin::K%>}.{core::Iterable::isNotEmpty}{core::bool}; |
| get /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ values() → core::Iterable<self::_MyMap&Object&MapMixin::V%> |
| return new col::_MapBaseValueIterable::•<self::_MyMap&Object&MapMixin::K%, self::_MyMap&Object&MapMixin::V%>(this); |
| method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ toString() → core::String |
| return col::MapBase::mapToString(this); |
| static method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ mapToString(core::Map<core::Object?, core::Object?> m) → core::String { |
| if(_in::isToStringVisiting(m)) { |
| return "{...}"; |
| } |
| core::StringBuffer result = new core::StringBuffer::•(); |
| try { |
| _in::toStringVisiting.{core::List::add}(m){(core::Object) → void}; |
| result.{core::StringBuffer::write}("{"){(core::Object?) → void}; |
| core::bool first = true; |
| m.{core::Map::forEach}((core::Object? k, core::Object? v) → void { |
| if(!first) { |
| result.{core::StringBuffer::write}(", "){(core::Object?) → void}; |
| } |
| first = false; |
| result.{core::StringBuffer::write}(k){(core::Object?) → void}; |
| result.{core::StringBuffer::write}(": "){(core::Object?) → void}; |
| result.{core::StringBuffer::write}(v){(core::Object?) → void}; |
| }){((core::Object?, core::Object?) → void) → void}; |
| result.{core::StringBuffer::write}("}"){(core::Object?) → void}; |
| } |
| finally { |
| assert(core::identical(_in::toStringVisiting.{core::Iterable::last}{core::Object}, m)); |
| _in::toStringVisiting.{core::List::removeLast}(){() → core::Object}; |
| } |
| return result.{core::StringBuffer::toString}(){() → core::String}; |
| } |
| static method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ _fillMapWithMappedIterable(core::Map<core::Object?, core::Object?> map, core::Iterable<core::Object?> iterable, (core::Object?) →? core::Object? key, (core::Object?) →? core::Object? value) → void { |
| key == null ?{(core::Object?) →? core::Object?} key = #C2 : null; |
| value == null ?{(core::Object?) →? core::Object?} value = #C2 : null; |
| { |
| synthesized core::Iterator<core::Object?> :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator<core::Object?>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| core::Object? element = :sync-for-iterator.{core::Iterator::current}{core::Object?}; |
| { |
| map.{core::Map::[]=}(key{(core::Object?) → core::Object?}(element){(core::Object?) → core::Object?}, value{(core::Object?) → core::Object?}(element){(core::Object?) → core::Object?}){(core::Object?, core::Object?) → void}; |
| } |
| } |
| } |
| } |
| static method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ _id(core::Object? x) → core::Object? |
| return x; |
| static method /* from org-dartlang-sdk:///sdk/lib/collection/maps.dart */ _fillMapWithIterables(core::Map<core::Object?, core::Object?> map, core::Iterable<core::Object?> keys, core::Iterable<core::Object?> values) → void { |
| core::Iterator<core::Object?> keyIterator = keys.{core::Iterable::iterator}{core::Iterator<core::Object?>}; |
| core::Iterator<core::Object?> valueIterator = values.{core::Iterable::iterator}{core::Iterator<core::Object?>}; |
| core::bool hasNextKey = keyIterator.{core::Iterator::moveNext}(){() → core::bool}; |
| core::bool hasNextValue = valueIterator.{core::Iterator::moveNext}(){() → core::bool}; |
| while (hasNextKey && hasNextValue) { |
| map.{core::Map::[]=}(keyIterator.{core::Iterator::current}{core::Object?}, valueIterator.{core::Iterator::current}{core::Object?}){(core::Object?, core::Object?) → void}; |
| hasNextKey = keyIterator.{core::Iterator::moveNext}(){() → core::bool}; |
| hasNextValue = valueIterator.{core::Iterator::moveNext}(){() → core::bool}; |
| } |
| if(hasNextKey || hasNextValue) { |
| throw new core::ArgumentError::•("Iterables do not have same length."); |
| } |
| } |
| } |
| class MyMap<K extends core::Object? = dynamic, V extends core::Object? = dynamic> extends self::_MyMap&Object&MapMixin<self::MyMap::K%, self::MyMap::V%> { |
| field core::int containsKeyCount = 0; |
| field core::int indexGetCount = 0; |
| final field core::Map<self::MyMap::K%, self::MyMap::V%> _map; |
| constructor •(core::Map<self::MyMap::K%, self::MyMap::V%> _map) → self::MyMap<self::MyMap::K%, self::MyMap::V%> |
| : self::MyMap::_map = _map, super self::_MyMap&Object&MapMixin::•() |
| ; |
| method containsKey(core::Object? key) → core::bool { |
| this.{self::MyMap::containsKeyCount} = this.{self::MyMap::containsKeyCount}{core::int}.{core::num::+}(1){(core::num) → core::int}; |
| return this.{self::MyMap::_map}{core::Map<self::MyMap::K%, self::MyMap::V%>}.{core::Map::containsKey}(key){(core::Object?) → core::bool}; |
| } |
| operator [](core::Object? key) → self::MyMap::V? { |
| this.{self::MyMap::indexGetCount} = this.{self::MyMap::indexGetCount}{core::int}.{core::num::+}(1){(core::num) → core::int}; |
| return this.{self::MyMap::_map}{core::Map<self::MyMap::K%, self::MyMap::V%>}.{core::Map::[]}(key){(core::Object?) → self::MyMap::V?}; |
| } |
| operator []=(covariant-by-class self::MyMap::K% key, covariant-by-class self::MyMap::V% value) → void |
| return let final core::Map<self::MyMap::K%, self::MyMap::V%> #t24 = this.{self::MyMap::_map}{core::Map<self::MyMap::K%, self::MyMap::V%>} in let final self::MyMap::K% #t25 = key in let final self::MyMap::V% #t26 = value in let final void #t27 = #t24.{core::Map::[]=}(#t25, #t26){(self::MyMap::K%, self::MyMap::V%) → void} in #t26; |
| method clear() → void |
| return this.{self::MyMap::_map}{core::Map<self::MyMap::K%, self::MyMap::V%>}.{core::Map::clear}(){() → void}; |
| get keys() → core::Iterable<self::MyMap::K%> |
| return this.{self::MyMap::_map}{core::Map<self::MyMap::K%, self::MyMap::V%>}.{core::Map::keys}{core::Iterable<self::MyMap::K%>}; |
| method remove(core::Object? key) → self::MyMap::V? |
| return this.{self::MyMap::_map}{core::Map<self::MyMap::K%, self::MyMap::V%>}.{core::Map::remove}(key){(core::Object?) → self::MyMap::V?}; |
| } |
| static get hasUnsoundNullSafety() → core::bool |
| return #C3 is core::List<core::Object>; |
| static method method(core::Map<core::int, core::String?> m) → core::int { |
| #L1: |
| { |
| final synthesized core::Map<core::int, core::String?> #0#0 = m; |
| synthesized core::String? #0#3; |
| synthesized core::bool #0#3#isSet = false; |
| synthesized core::bool #0#2; |
| synthesized core::bool #0#2#isSet = false; |
| { |
| if((!((#0#3#isSet ?{core::String?} #0#3{core::String?} : let final core::bool* #t28 = #0#3#isSet = true in #0#3 = #0#0.{core::Map::[]}(#C4){(core::Object?) → core::String?}) == null) || null is core::String? && (#0#2#isSet ?{core::bool} #0#2{core::bool} : let final core::bool* #t29 = #0#2#isSet = true in #0#2 = #0#0.{core::Map::containsKey}(#C4){(core::Object?) → core::bool})) && #C5 =={core::String::==}{(core::Object) → core::bool} (#0#3#isSet ?{core::String?} #0#3{core::String?} : let final core::bool* #t30 = #0#3#isSet = true in #0#3 = #0#0.{core::Map::[]}(#C4){(core::Object?) → core::String?})) { |
| { |
| return 0; |
| } |
| } |
| } |
| { |
| if((!((#0#3#isSet ?{core::String?} #0#3{core::String?} : let final core::bool* #t31 = #0#3#isSet = true in #0#3 = #0#0.{core::Map::[]}(#C4){(core::Object?) → core::String?}) == null) || null is core::String? && (#0#2#isSet ?{core::bool} #0#2{core::bool} : let final core::bool* #t32 = #0#2#isSet = true in #0#2 = #0#0.{core::Map::containsKey}(#C4){(core::Object?) → core::bool})) && #C6 =={core::String::==}{(core::Object) → core::bool} (#0#3#isSet ?{core::String?} #0#3{core::String?} : let final core::bool* #t33 = #0#3#isSet = true in #0#3 = #0#0.{core::Map::[]}(#C4){(core::Object?) → core::String?})) { |
| { |
| return 1; |
| } |
| } |
| } |
| } |
| return 2; |
| } |
| static method test(core::Map<core::int, core::String> map, {required core::int expectedValue, required core::int expectedContainsKeyCount, required core::int expectedIndexGetCount}) → dynamic { |
| self::MyMap<core::int, core::String> myMap = new self::MyMap::•<core::int, core::String>(map); |
| self::expect(expectedValue, self::method(myMap), "Unexpected value for ${map}."); |
| self::expect(expectedContainsKeyCount, myMap.{self::MyMap::containsKeyCount}{core::int}, "Unexpected containsKey count for ${map}."); |
| self::expect(expectedIndexGetCount, myMap.{self::MyMap::indexGetCount}{core::int}, "Unexpected indexGet count for ${map}."); |
| } |
| static method main() → dynamic { |
| self::test(<core::int, core::String>{0: "foo"}, expectedValue: 2, expectedContainsKeyCount: 1, expectedIndexGetCount: self::hasUnsoundNullSafety ?{core::int} 0 : 1); |
| self::test(<core::int, core::String>{1: "foo"}, expectedValue: 0, expectedContainsKeyCount: self::hasUnsoundNullSafety ?{core::int} 1 : 0, expectedIndexGetCount: 1); |
| self::test(<core::int, core::String>{1: "bar"}, expectedValue: 1, expectedContainsKeyCount: self::hasUnsoundNullSafety ?{core::int} 1 : 0, expectedIndexGetCount: 1); |
| self::test(<core::int, core::String>{1: "baz"}, expectedValue: 2, expectedContainsKeyCount: self::hasUnsoundNullSafety ?{core::int} 1 : 0, expectedIndexGetCount: 1); |
| } |
| static method expect(dynamic expected, dynamic actual, dynamic message) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "${message} Expected ${expected}, actual ${actual}"; |
| } |
| |
| constants { |
| #C1 = null |
| #C2 = static-tearoff col::MapBase::_id |
| #C3 = <Null>[] |
| #C4 = 1 |
| #C5 = "foo" |
| #C6 = "bar" |
| } |
| |
| Extra constant evaluation status: |
| Evaluated: IsExpression @ org-dartlang-testcase:///caching_constants.dart:7:49 -> BoolConstant(false) |
| Evaluated: IsExpression @ org-dartlang-testcase:///caching_constants.dart:38:12 -> BoolConstant(true) |
| Evaluated: IsExpression @ org-dartlang-testcase:///caching_constants.dart:40:12 -> BoolConstant(true) |
| Extra constant evaluation: evaluated: 513, effectively constant: 3 |