Chromium Code Reviews| 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 107961528981c75dd7f9ad625c29bfcb507a9ebc..92e02de50ef877ac1d71af39afd037f832fdcf74 100644 |
| --- a/sdk/lib/html/dart2js/html_dart2js.dart |
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart |
| @@ -1203,9 +1203,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 (dirtyHeight != null && dirtyWidth != null && dirtyY != null && dirtyX != 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') |
| @@ -1298,9 +1300,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 (dirtyHeight != null && dirtyWidth != null && dirtyY != null && dirtyX != 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') |
| @@ -13647,10 +13651,10 @@ class MediaStream extends EventTarget native "MediaStream" { |
| if (!?stream_OR_tracks) { |
| return MediaStream._create_1(); |
| } |
| - if ((stream_OR_tracks is MediaStream || stream_OR_tracks == null)) { |
| + if (stream_OR_tracks is MediaStream && stream_OR_tracks != null) { |
| return MediaStream._create_2(stream_OR_tracks); |
| } |
| - if ((stream_OR_tracks is List<MediaStreamTrack> || stream_OR_tracks == null)) { |
| + if (stream_OR_tracks is List<MediaStreamTrack> && stream_OR_tracks != null) { |
| return MediaStream._create_3(stream_OR_tracks); |
| } |
| throw new ArgumentError("Incorrect number or type of arguments"); |
| @@ -16035,10 +16039,10 @@ class Path native "Path" { |
| if (!?path_OR_text) { |
| return Path._create_1(); |
| } |
| - if ((path_OR_text is Path || path_OR_text == null)) { |
| + if (path_OR_text is Path && path_OR_text != null) { |
| return Path._create_2(path_OR_text); |
| } |
| - if ((path_OR_text is String || path_OR_text == null)) { |
| + if (path_OR_text is String && path_OR_text != null) { |
| return Path._create_3(path_OR_text); |
| } |
| throw new ArgumentError("Incorrect number or type of arguments"); |
| @@ -20723,13 +20727,13 @@ class WebSocket extends EventTarget native "WebSocket" { |
| @DomName('WebSocket.WebSocket') |
| @DocsEditable |
| factory WebSocket(String url, [protocol_OR_protocols]) { |
| - if ((url is String || url == null) && !?protocol_OR_protocols) { |
| + if (url is String && !?protocol_OR_protocols) { |
| return WebSocket._create_1(url); |
| } |
| - if ((url is String || url == null) && (protocol_OR_protocols is List<String> || protocol_OR_protocols == null)) { |
| + if (protocol_OR_protocols is List<String> && protocol_OR_protocols != null && url is String) { |
|
blois
2013/05/13 21:09:16
why are the "url is String" checks here- it's type
Andrei Mouravski
2013/05/14 00:00:53
Because that's what the code does? It was being ch
|
| return WebSocket._create_2(url, protocol_OR_protocols); |
| } |
| - if ((url is String || url == null) && (protocol_OR_protocols is String || protocol_OR_protocols == null)) { |
| + if (protocol_OR_protocols is String && protocol_OR_protocols != null && url is String) { |
| return WebSocket._create_3(url, protocol_OR_protocols); |
| } |
| throw new ArgumentError("Incorrect number or type of arguments"); |