Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: sdk/lib/html/html_common/conversions_dartium.dart

Issue 1371503002: Fix one level of error in postmessage tests, suppress nested list tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"]);
11 putIntoMap(map, key, value) => map[key] = value; 11 putIntoMap(map, key, value) => map[key] = value;
12 newJsList(length) => new js.JsArray(); 12 // TODO(alanknight): Don't create two extra lists to get a fixed-length JS lis t.
13 newJsList(length) => new js.JsArray.from(new List(length));
13 cloneNotRequired(e) => e is js.JsObject; 14 cloneNotRequired(e) => e is js.JsObject;
14 } 15 }
15 16
16 class _AcceptStructuredCloneDartium extends _AcceptStructuredClone { 17 class _AcceptStructuredCloneDartium extends _AcceptStructuredClone {
17 newDartList(length) => new List(length); 18 newDartList(length) => new List(length);
18 19
19 // JsObjects won't be identical, but will be equal only if the underlying 20 // JsObjects won't be identical, but will be equal only if the underlying
20 // Js entities are identical. 21 // Js entities are identical.
21 bool identicalInJs(a, b) => 22 bool identicalInJs(a, b) =>
22 (a is js.JsObject) ? a == b : identical(a, b); 23 (a is js.JsObject) ? a == b : identical(a, b);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 final _promiseConstructor = js.context['Promise']; 55 final _promiseConstructor = js.context['Promise'];
55 bool isJavaScriptPromise(value) => value is js.JsObject && value['constructor'] == _promiseConstructor; 56 bool isJavaScriptPromise(value) => value is js.JsObject && value['constructor'] == _promiseConstructor;
56 57
57 Future convertNativePromiseToDartFuture(js.JsObject promise) { 58 Future convertNativePromiseToDartFuture(js.JsObject promise) {
58 var completer = new Completer(); 59 var completer = new Completer();
59 var newPromise = promise 60 var newPromise = promise
60 .callMethod("then", [(result) => completer.complete(result)]) 61 .callMethod("then", [(result) => completer.complete(result)])
61 .callMethod("catch", [(result) => completer.completeError(result)]); 62 .callMethod("catch", [(result) => completer.completeError(result)]);
62 return completer.future; 63 return completer.future;
63 } 64 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698