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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 15138002: Added tests to previously broken functionality and added null checks. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/web_gl/dart2js/web_gl_dart2js.dart » ('j') | tools/dom/scripts/htmldartgenerator.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 3bb3ec27a797671c48c9f6109aa6f4a086238033..56cfd19145364c2af42d2c36e19d47c792498e15 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -1211,9 +1211,11 @@ class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRend
_putImageData_1(imagedata_1, dx, dy);
return;
}
- var imagedata_2 = _convertDartToNative_ImageData(imagedata);
- _putImageData_2(imagedata_2, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
- return;
+ if (dirtyX != null && dirtyY != null && dirtyWidth != null && dirtyHeight != null) {
+ var imagedata_2 = _convertDartToNative_ImageData(imagedata);
+ _putImageData_2(imagedata_2, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
+ return;
+ }
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('putImageData')
@@ -1306,9 +1308,11 @@ class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRend
_putImageDataHD_1(imagedata_1, dx, dy);
return;
}
- var imagedata_2 = _convertDartToNative_ImageData(imagedata);
- _putImageDataHD_2(imagedata_2, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
- return;
+ if (dirtyX != null && dirtyY != null && dirtyWidth != null && dirtyHeight != null) {
+ var imagedata_2 = _convertDartToNative_ImageData(imagedata);
+ _putImageDataHD_2(imagedata_2, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
+ return;
+ }
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('webkitPutImageDataHD')
« no previous file with comments | « no previous file | sdk/lib/web_gl/dart2js/web_gl_dart2js.dart » ('j') | tools/dom/scripts/htmldartgenerator.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698