OLD | NEW |
1 @JS() | 1 @JS() |
2 library js_util.base; | 2 library js_util.base; |
3 | 3 |
4 import 'package:js/js.dart'; | 4 import 'package:js/js.dart'; |
5 import 'package:quiver_iterables/iterables.dart'; | 5 import 'package:quiver_iterables/iterables.dart'; |
6 | 6 |
7 // js_util library uses the technique described in | 7 // js_util library uses the technique described in |
8 // https://github.com/dart-lang/sdk/issues/25053 | 8 // https://github.com/dart-lang/sdk/issues/25053 |
9 // because dart2js compiler does not support [] operator. | 9 // because dart2js compiler does not support [] operator. |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 for (final keyValuePair in zip([o.keys, o.values])) { | 50 for (final keyValuePair in zip([o.keys, o.values])) { |
51 setValue(newObj, keyValuePair[0], toJS(keyValuePair[1])); | 51 setValue(newObj, keyValuePair[0], toJS(keyValuePair[1])); |
52 } | 52 } |
53 return newObj; | 53 return newObj; |
54 } else if (o is List) { | 54 } else if (o is List) { |
55 return o.map((e) => toJS(e)).toList(); | 55 return o.map((e) => toJS(e)).toList(); |
56 } else { | 56 } else { |
57 return o; | 57 return o; |
58 } | 58 } |
59 } | 59 } |
OLD | NEW |