| Index: lib/html/dart2js/html_dart2js.dart
|
| diff --git a/lib/html/dart2js/html_dart2js.dart b/lib/html/dart2js/html_dart2js.dart
|
| index f14d542ece8c287e904e992bee7470d7e1c6c9bb..5ba916d5c536c404b98c0187c8c65b801560856c 100644
|
| --- a/lib/html/dart2js/html_dart2js.dart
|
| +++ b/lib/html/dart2js/html_dart2js.dart
|
| @@ -38573,15 +38573,23 @@ _convertDartToNative_ImageData(ImageData imageData) {
|
|
|
|
|
| /// Converts a JavaScript object with properties into a Dart Map.
|
| +/// Not suitable for nested objects.
|
| Map _convertNativeToDart_Dictionary(object) {
|
| // TODO: Implement.
|
| - return object;
|
| + var dict = {};
|
| + for (final key in JS('List', 'Object.getOwnPropertyNames(#)', object)) {
|
| + dict[key] = JS('var', '#[#]', object, key);
|
| + }
|
| + return dict;
|
| }
|
|
|
| -/// Converts a Dart map into a JavaScript object with properties.
|
| +/// Converts a flat Dart map into a JavaScript object with properties.
|
| _convertDartToNative_Dictionary(Map dict) {
|
| - // TODO: Implement.
|
| - return dict;
|
| + var object = JS('var', '{}');
|
| + dict.forEach((String key, value) {
|
| + JS('void', '#[#] = #', object, key, value);
|
| + });
|
| + return object;
|
| }
|
|
|
|
|
|
|