OLD | NEW |
---|---|
1 part of html_common; | 1 part of html_common; |
2 | 2 |
3 convertDartToNative_PrepareForStructuredClone(value) => | 3 convertDartToNative_PrepareForStructuredClone(value) => |
4 new _StructuredCloneDartium().convertDartToNative_PrepareForStructuredClone( value); | 4 new _StructuredCloneDartium().convertDartToNative_PrepareForStructuredClone( value); |
5 | 5 |
6 convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) => | 6 convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) => |
7 new _AcceptStructuredCloneDartium().convertNativeToDart_AcceptStructuredClon e(object, mustCopy: mustCopy); | 7 new _AcceptStructuredCloneDartium().convertNativeToDart_AcceptStructuredClon e(object, mustCopy: mustCopy); |
8 | 8 |
9 class _StructuredCloneDartium extends _StructuredClone { | 9 class _StructuredCloneDartium extends _StructuredClone { |
10 newJsMap() => js.JsNative.newObject(); | 10 newJsMap() => js.JsNative.newObject(); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 while (prototype != null) { | 260 while (prototype != null) { |
261 // We're a Dart class that's pointing to a JS class. | 261 // We're a Dart class that's pointing to a JS class. |
262 var constructor = js.JsNative.getProperty(prototype, 'constructor'); | 262 var constructor = js.JsNative.getProperty(prototype, 'constructor'); |
263 if (constructor != null) { | 263 if (constructor != null) { |
264 jsTypeName = js.JsNative.getProperty(constructor, 'name'); | 264 jsTypeName = js.JsNative.getProperty(constructor, 'name'); |
265 type = getHtmlCreateType(jsTypeName); | 265 type = getHtmlCreateType(jsTypeName); |
266 if (type != null) return type; | 266 if (type != null) return type; |
267 } | 267 } |
268 prototype = js.JsNative.getProperty(prototype, '__proto__'); | 268 prototype = js.JsNative.getProperty(prototype, '__proto__'); |
269 } | 269 } |
270 } catch (e, stacktrace) { | 270 } catch (e) { |
271 if (e is DebugAssertException) print("${e.message}\n ${stacktrace}"); | 271 // This case can happen for cross frame objects. |
272 else print("${stacktrace}"); | 272 if (js.JsNative.hasProperty(e, "postMessage")) { |
Alan Knight
2016/04/12 17:05:58
Is this safe? There are quite a few other things w
Jacob
2016/04/12 17:08:51
This is the exact same conversion used in dart2js.
| |
273 // assume this is a Window. To match Dart2JS, separate conversion code | |
274 // in dart:html will switch the wrapper to a cross frame window as | |
275 // required. | |
276 // TODO(jacobr): we could consider removing this code completely. | |
277 return Window.instanceRuntimeType; | |
278 } | |
273 } | 279 } |
274 return js.JSObject.instanceRuntimeType; | 280 return js.JSObject.instanceRuntimeType; |
275 } | 281 } |
OLD | NEW |