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

Side by Side Diff: tools/dom/src/dart2js_Conversions.dart

Issue 15431003: Cleanup of various DOM dart2js and dart_analyzer warnings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 // Conversions for Window. These check if the window is the local 6 // Conversions for Window. These check if the window is the local
7 // window, and if it's not, wraps or unwraps it with a secure wrapper. 7 // window, and if it's not, wraps or unwraps it with a secure wrapper.
8 // We need to test for EventTarget here as well as it's a base type. 8 // We need to test for EventTarget here as well as it's a base type.
9 // We omit an unwrapper for Window as no methods take a non-local 9 // We omit an unwrapper for Window as no methods take a non-local
10 // window as a parameter. 10 // window as a parameter.
(...skipping 14 matching lines...) Expand all
25 return _DOMWindowCrossFrame._createSafe(win); 25 return _DOMWindowCrossFrame._createSafe(win);
26 } 26 }
27 27
28 EventTarget _convertNativeToDart_EventTarget(e) { 28 EventTarget _convertNativeToDart_EventTarget(e) {
29 if (e == null) { 29 if (e == null) {
30 return null; 30 return null;
31 } 31 }
32 // Assume it's a Window if it contains the setInterval property. It may be 32 // Assume it's a Window if it contains the setInterval property. It may be
33 // from a different frame - without a patched prototype - so we cannot 33 // from a different frame - without a patched prototype - so we cannot
34 // rely on Dart type checking. 34 // rely on Dart type checking.
35 if (JS('bool', r'"setInterval" in #', e)) 35 if (JS('bool', r'"setInterval" in #', e)) {
36 return _DOMWindowCrossFrame._createSafe(e); 36 var window = _DOMWindowCrossFrame._createSafe(e);
37 // If it's a native window.
38 if (window is EventTarget) {
39 return window;
40 }
41 return null;
42 }
37 else 43 else
38 return e; 44 return e;
39 } 45 }
40 46
41 EventTarget _convertDartToNative_EventTarget(e) { 47 EventTarget _convertDartToNative_EventTarget(e) {
42 if (e is _DOMWindowCrossFrame) { 48 if (e is _DOMWindowCrossFrame) {
43 return e._window; 49 return e._window;
44 } else { 50 } else {
45 return e; 51 return e;
46 } 52 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 87
82 // We can get rid of this conversion if _TypedImageData implements the fields 88 // We can get rid of this conversion if _TypedImageData implements the fields
83 // with native names. 89 // with native names.
84 _convertDartToNative_ImageData(ImageData imageData) { 90 _convertDartToNative_ImageData(ImageData imageData) {
85 if (imageData is _TypedImageData) { 91 if (imageData is _TypedImageData) {
86 return JS('', '{data: #, height: #, width: #}', 92 return JS('', '{data: #, height: #, width: #}',
87 imageData.data, imageData.height, imageData.width); 93 imageData.data, imageData.height, imageData.width);
88 } 94 }
89 return imageData; 95 return imageData;
90 } 96 }
OLDNEW
« no previous file with comments | « tools/dom/src/WrappedList.dart ('k') | tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698