OLD | NEW |
1 part of "html_common_dart2js.dart"; | 1 part of html_common; |
2 | 2 |
3 /// Converts a JavaScript object with properties into a Dart Map. | 3 /// Converts a JavaScript object with properties into a Dart Map. |
4 /// Not suitable for nested objects. | 4 /// Not suitable for nested objects. |
5 Map convertNativeToDart_Dictionary(object) { | 5 Map convertNativeToDart_Dictionary(object) { |
6 if (object == null) return null; | 6 if (object == null) return null; |
7 var dict = {}; | 7 var dict = {}; |
8 var keys = JS('JSExtendableArray', 'Object.getOwnPropertyNames(#)', object); | 8 var keys = JS('JSExtendableArray', 'Object.getOwnPropertyNames(#)', object); |
9 for (final key in keys) { | 9 for (final key in keys) { |
10 dict[key] = JS('var', '#[#]', object, key); | 10 dict[key] = JS('var', '#[#]', object, key); |
11 } | 11 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 const String _serializedScriptValue = 'num|String|bool|' | 97 const String _serializedScriptValue = 'num|String|bool|' |
98 'JSExtendableArray|=Object|' | 98 'JSExtendableArray|=Object|' |
99 'Blob|File|NativeByteBuffer|NativeTypedData' | 99 'Blob|File|NativeByteBuffer|NativeTypedData' |
100 // TODO(sra): Add Date, RegExp. | 100 // TODO(sra): Add Date, RegExp. |
101 ; | 101 ; |
102 const annotation_Creates_SerializedScriptValue = | 102 const annotation_Creates_SerializedScriptValue = |
103 const Creates(_serializedScriptValue); | 103 const Creates(_serializedScriptValue); |
104 const annotation_Returns_SerializedScriptValue = | 104 const annotation_Returns_SerializedScriptValue = |
105 const Returns(_serializedScriptValue); | 105 const Returns(_serializedScriptValue); |
OLD | NEW |