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

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

Issue 1356653003: Operator precedence in isJavaScriptSimpleObject (Closed) Base URL: https://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 | no next file » | 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"]);
(...skipping 26 matching lines...) Expand all
37 bool isJavaScriptArray(value) => value is js.JsArray; 37 bool isJavaScriptArray(value) => value is js.JsArray;
38 38
39 final _object = js.context["Object"]; 39 final _object = js.context["Object"];
40 final _getPrototypeOf = _object["getPrototypeOf"]; 40 final _getPrototypeOf = _object["getPrototypeOf"];
41 _getProto(object) { 41 _getProto(object) {
42 return _getPrototypeOf.apply([object]); 42 return _getPrototypeOf.apply([object]);
43 } 43 }
44 final _objectProto = js.context["Object"]["prototype"]; 44 final _objectProto = js.context["Object"]["prototype"];
45 45
46 bool isJavaScriptSimpleObject(value) { 46 bool isJavaScriptSimpleObject(value) {
47 if (!value is js.JsObject) return false; 47 if (value is! js.JsObject) return false;
48 var proto = _getProto(value); 48 var proto = _getProto(value);
49 return proto == _objectProto || proto == null; 49 return proto == _objectProto || proto == null;
50 } 50 }
51 bool isImmutableJavaScriptArray(value) => 51 bool isImmutableJavaScriptArray(value) =>
52 isJavaScriptArray(value) && value["immutable$list"] != null; 52 isJavaScriptArray(value) && value["immutable$list"] != null;
53 53
54 final _promiseConstructor = js.context['Promise']; 54 final _promiseConstructor = js.context['Promise'];
55 bool isJavaScriptPromise(value) => value is js.JsObject && value['constructor'] == _promiseConstructor; 55 bool isJavaScriptPromise(value) => value is js.JsObject && value['constructor'] == _promiseConstructor;
56 56
57 Future convertNativePromiseToDartFuture(js.JsObject promise) { 57 Future convertNativePromiseToDartFuture(js.JsObject promise) {
58 var completer = new Completer(); 58 var completer = new Completer();
59 var newPromise = promise 59 var newPromise = promise
60 .callMethod("then", [(result) => completer.complete(result)]) 60 .callMethod("then", [(result) => completer.complete(result)])
61 .callMethod("catch", [(result) => completer.completeError(result)]); 61 .callMethod("catch", [(result) => completer.completeError(result)]);
62 return completer.future; 62 return completer.future;
63 } 63 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698