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') |