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

Unified Diff: sdk/lib/html/src/dart2js_Conversions.dart

Issue 11369128: Changes to allow more precise inference of live native classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/html/src/dart2js_Conversions.dart
diff --git a/sdk/lib/html/src/dart2js_Conversions.dart b/sdk/lib/html/src/dart2js_Conversions.dart
index b5daaf300f2a707d6c1e84b6190401c5af5e6b79..b0452bec855fa920bf63fc4df82cf175939f5f8e 100644
--- a/sdk/lib/html/src/dart2js_Conversions.dart
+++ b/sdk/lib/html/src/dart2js_Conversions.dart
@@ -61,6 +61,15 @@ class _TypedImageData implements ImageData {
}
ImageData _convertNativeToDart_ImageData(nativeImageData) {
+
+ // None of the native getters that return ImageData have the type ImageData
+ // since that is incorrect for FireFox (which returns a plain Object). So we
+ // need something that tells the compiler that the ImageData class has been
+ // instantiated.
+ // TODO(sra): Remove this when all the ImageData returning APIs have been
+ // annotated as returning the union ImageData + Object.
+ JS('ImageData', '0');
+
if (nativeImageData is ImageData) return nativeImageData;
// On Firefox the above test fails because imagedata is a plain object.
@@ -76,7 +85,7 @@ ImageData _convertNativeToDart_ImageData(nativeImageData) {
// with native names.
_convertDartToNative_ImageData(ImageData imageData) {
if (imageData is _TypedImageData) {
- return JS('Object', '{data: #, height: #, width: #}',
+ return JS('', '{data: #, height: #, width: #}',
imageData.data, imageData.height, imageData.width);
}
return imageData;

Powered by Google App Engine
This is Rietveld 408576698