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() => new js.JsObject(js.context["Object"]); | 10 newJsMap() => new js.JsObject(js.context["Object"]); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 final _promiseConstructor = js.context['Promise']; | 55 final _promiseConstructor = js.context['Promise']; |
56 bool isJavaScriptPromise(value) => value is js.JsObject && value['constructor']
== _promiseConstructor; | 56 bool isJavaScriptPromise(value) => value is js.JsObject && value['constructor']
== _promiseConstructor; |
57 | 57 |
58 Future convertNativePromiseToDartFuture(js.JsObject promise) { | 58 Future convertNativePromiseToDartFuture(js.JsObject promise) { |
59 var completer = new Completer(); | 59 var completer = new Completer(); |
60 var newPromise = promise | 60 var newPromise = promise |
61 .callMethod("then", [(result) => completer.complete(result)]) | 61 .callMethod("then", [(result) => completer.complete(result)]) |
62 .callMethod("catch", [(result) => completer.completeError(result)]); | 62 .callMethod("catch", [(result) => completer.completeError(result)]); |
63 return completer.future; | 63 return completer.future; |
64 } | 64 } |
| 65 |
| 66 convertDartToNative_DateTime(DateTime date) { |
| 67 return new js.JsObject(js.context["Date"], [date.millisecondsSinceEpoch]); |
| 68 } |
OLD | NEW |