Skip to content

Commit ee19eb2

Browse files
Merge pull request #273 from cleandart/5.5.0/polyfill-jsmap-values-for-ie11
Make JsBackedMap.values MSIE 11 compatible
2 parents 3a1dc59 + c66b92a commit ee19eb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/react_client/js_backed_map.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class JsBackedMap extends MapBase<dynamic, dynamic> {
3838

3939
// Private helpers with narrower typing than we want to expose, for use in other methods
4040
List<dynamic> get _keys => _Object.keys(jsObject);
41-
List<dynamic> get _values => _Object.values(jsObject);
41+
// Use keys to access the value instead oof `Object.values` since MSIE 11 doesn't support it
42+
List<dynamic> get _values => _keys.map((key) => this[key]).toList();
4243

4344
/// Adds all key/value pairs of the JS object [jsOther] to this map.
4445
///

0 commit comments

Comments
 (0)