File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,17 @@ class MapWrapper {
1414 static int size (m) {return m.length;}
1515}
1616
17+ // TODO: how to export StringMap=Map as a type?
18+ class StringMapWrapper {
19+ static HashMap create () => new HashMap ();
20+ static get (map, key) {
21+ return map[key];
22+ }
23+ static set (map, key, value) {
24+ map[key] = value;
25+ }
26+ }
27+
1728class ListWrapper {
1829 static List clone (List l) => new List .from (l);
1930 static List create () => new List ();
Original file line number Diff line number Diff line change @@ -13,6 +13,19 @@ export class MapWrapper {
1313 static size ( m ) { return m . size ; }
1414}
1515
16+ // TODO: cannot export StringMap as a type as Dart does not support
17+ // renaming types...
18+ export class StringMapWrapper {
19+ // Note: We are not using Object.create(null) here due to
20+ // performance!
21+ static create ( ) :Object { return { } ; }
22+ static get ( map , key ) {
23+ return map . hasOwnProperty ( key ) ? map [ key ] : undefined ;
24+ }
25+ static set ( map , key , value ) {
26+ map [ key ] = value ;
27+ }
28+ }
1629
1730export class ListWrapper {
1831 static create ( ) :List { return new List ( ) ; }
You can’t perform that action at this time.
0 commit comments