Chromium Code Reviews| Index: lib/html/dart2js/html_dart2js.dart |
| diff --git a/lib/html/dart2js/html_dart2js.dart b/lib/html/dart2js/html_dart2js.dart |
| index 5ba916d5c536c404b98c0187c8c65b801560856c..e4fb6d244f36581fcfeaeb5c9e9c1d8803d491ce 100644 |
| --- a/lib/html/dart2js/html_dart2js.dart |
| +++ b/lib/html/dart2js/html_dart2js.dart |
| @@ -3943,21 +3943,12 @@ class _CanvasRenderingContext2DImpl extends _CanvasRenderingContextImpl implemen |
| void moveTo(num x, num y) native; |
| void putImageData(ImageData imagedata, num dx, num dy, [dirtyX = _default, dirtyY = _default, dirtyWidth = _default, dirtyHeight = _default]) { |
| - if ((imagedata is ImageData || imagedata == null) && |
| - (dx is num || dx == null) && |
| - (dy is num || dy == null) && |
| - _default == dirtyX && |
| - _default == dirtyY && |
| - _default == dirtyWidth && |
| - _default == dirtyHeight) { |
| + if (_default == dirtyX) { |
| var imagedata_1 = _convertDartToNative_ImageData(imagedata); |
| _putImageData_1(imagedata_1, dx, dy); |
| return; |
| } |
| - if ((imagedata is ImageData || imagedata == null) && |
| - (dx is num || dx == null) && |
| - (dy is num || dy == null) && |
| - (dirtyX is num || dirtyX == null) && |
| + if ((dirtyX is num || dirtyX == null) && |
| (dirtyY is num || dirtyY == null) && |
| (dirtyWidth is num || dirtyWidth == null) && |
| (dirtyHeight is num || dirtyHeight == null)) { |
| @@ -4018,21 +4009,12 @@ class _CanvasRenderingContext2DImpl extends _CanvasRenderingContextImpl implemen |
| _webkitGetImageDataHD_1(sx, sy, sw, sh) native "webkitGetImageDataHD"; |
| void webkitPutImageDataHD(ImageData imagedata, num dx, num dy, [dirtyX = _default, dirtyY = _default, dirtyWidth = _default, dirtyHeight = _default]) { |
| - if ((imagedata is ImageData || imagedata == null) && |
| - (dx is num || dx == null) && |
| - (dy is num || dy == null) && |
| - _default == dirtyX && |
| - _default == dirtyY && |
| - _default == dirtyWidth && |
| - _default == dirtyHeight) { |
| + if (_default == dirtyX) { |
| var imagedata_1 = _convertDartToNative_ImageData(imagedata); |
| _webkitPutImageDataHD_1(imagedata_1, dx, dy); |
| return; |
| } |
| - if ((imagedata is ImageData || imagedata == null) && |
| - (dx is num || dx == null) && |
| - (dy is num || dy == null) && |
| - (dirtyX is num || dirtyX == null) && |
| + if ((dirtyX is num || dirtyX == null) && |
| (dirtyY is num || dirtyY == null) && |
| (dirtyWidth is num || dirtyWidth == null) && |
| (dirtyHeight is num || dirtyHeight == null)) { |
| @@ -7968,8 +7950,7 @@ class _IDBIndexImpl implements IDBIndex native "*IDBIndex" { |
| _IDBRequestImpl _getKey_2(key) native "getKey"; |
| _IDBRequestImpl openCursor([key_OR_range = _default, direction = _default]) { |
| - if (_default == key_OR_range && |
| - _default == direction) { |
| + if (_default == key_OR_range) { |
| return _openCursor_1(); |
| } |
| if ((key_OR_range is IDBKeyRange || key_OR_range == null) && |
| @@ -7990,8 +7971,7 @@ class _IDBIndexImpl implements IDBIndex native "*IDBIndex" { |
| var key_2 = _convertDartToNative_IDBKey(key_OR_range); |
| return _openCursor_5(key_2, direction); |
| } |
| - if (_default == key_OR_range && |
| - _default == direction) { |
| + if (_default == key_OR_range) { |
| return _openCursor_6(); |
| } |
| if ((key_OR_range is IDBKeyRange || key_OR_range == null) && |
| @@ -8020,8 +8000,7 @@ class _IDBIndexImpl implements IDBIndex native "*IDBIndex" { |
| _IDBRequestImpl _openCursor_9(key, int direction) native "openCursor"; |
| _IDBRequestImpl openKeyCursor([key_OR_range = _default, direction = _default]) { |
| - if (_default == key_OR_range && |
| - _default == direction) { |
| + if (_default == key_OR_range) { |
| return _openKeyCursor_1(); |
| } |
| if ((key_OR_range is IDBKeyRange || key_OR_range == null) && |
| @@ -8042,8 +8021,7 @@ class _IDBIndexImpl implements IDBIndex native "*IDBIndex" { |
| var key_2 = _convertDartToNative_IDBKey(key_OR_range); |
| return _openKeyCursor_5(key_2, direction); |
| } |
| - if (_default == key_OR_range && |
| - _default == direction) { |
| + if (_default == key_OR_range) { |
| return _openKeyCursor_6(); |
| } |
| if ((key_OR_range is IDBKeyRange || key_OR_range == null) && |
| @@ -8130,26 +8108,22 @@ class _IDBObjectStoreImpl implements IDBObjectStore native "*IDBObjectStore" { |
| _IDBRequestImpl _count_3(key) native "count"; |
| _IDBIndexImpl createIndex(String name, keyPath, [options = _default]) { |
| - if ((name is String || name == null) && |
| - (keyPath is List<String> || keyPath == null) && |
| + if ((keyPath is List<String> || keyPath == null) && |
| _default == options) { |
| List keyPath_1 = _convertDartToNative_StringArray(keyPath); |
| return _createIndex_1(name, keyPath_1); |
| } |
| - if ((name is String || name == null) && |
| - (keyPath is List<String> || keyPath == null) && |
| + if ((keyPath is List<String> || keyPath == null) && |
| (options is Map || options == null)) { |
| List keyPath_2 = _convertDartToNative_StringArray(keyPath); |
| var options_3 = _convertDartToNative_Dictionary(options); |
| return _createIndex_2(name, keyPath_2, options_3); |
| } |
| - if ((name is String || name == null) && |
| - (keyPath is String || keyPath == null) && |
| + if ((keyPath is String || keyPath == null) && |
| _default == options) { |
| return _createIndex_3(name, keyPath); |
| } |
| - if ((name is String || name == null) && |
| - (keyPath is String || keyPath == null) && |
| + if ((keyPath is String || keyPath == null) && |
| (options is Map || options == null)) { |
| var options_4 = _convertDartToNative_Dictionary(options); |
| return _createIndex_4(name, keyPath, options_4); |
| @@ -8192,8 +8166,7 @@ class _IDBObjectStoreImpl implements IDBObjectStore native "*IDBObjectStore" { |
| _IDBIndexImpl index(String name) native; |
| _IDBRequestImpl openCursor([key_OR_range = _default, direction = _default]) { |
| - if (_default == key_OR_range && |
| - _default == direction) { |
| + if (_default == key_OR_range) { |
| return _openCursor_1(); |
| } |
| if ((key_OR_range is IDBKeyRange || key_OR_range == null) && |
| @@ -8214,8 +8187,7 @@ class _IDBObjectStoreImpl implements IDBObjectStore native "*IDBObjectStore" { |
| var key_2 = _convertDartToNative_IDBKey(key_OR_range); |
| return _openCursor_5(key_2, direction); |
| } |
| - if (_default == key_OR_range && |
| - _default == direction) { |
| + if (_default == key_OR_range) { |
| return _openCursor_6(); |
| } |
| if ((key_OR_range is IDBKeyRange || key_OR_range == null) && |
| @@ -16899,64 +16871,31 @@ class _WebGLRenderingContextImpl extends _CanvasRenderingContextImpl implements |
| void stencilOpSeparate(int face, int fail, int zfail, int zpass) native; |
| void texImage2D(int target, int level, int internalformat, int format_OR_width, int height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [format = _default, type = _default, pixels = _default]) { |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (internalformat is int || internalformat == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| + if ((border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| (format is int || format == null) && |
| (type is int || type == null) && |
| (pixels is ArrayBufferView || pixels == null)) { |
| _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (internalformat is int || internalformat == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| - _default == format && |
| - _default == type && |
| - _default == pixels) { |
| + if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| + _default == format) { |
| var pixels_1 = _convertDartToNative_ImageData(border_OR_canvas_OR_image_OR_pixels_OR_video); |
| _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_type, pixels_1); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (internalformat is int || internalformat == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (border_OR_canvas_OR_image_OR_pixels_OR_video is ImageElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| - _default == format && |
| - _default == type && |
| - _default == pixels) { |
| + if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
|
vsm
2012/08/23 20:28:09
You can remove the check on:
border_OR_canvas_OR_i
|
| + _default == format) { |
| _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (internalformat is int || internalformat == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (border_OR_canvas_OR_image_OR_pixels_OR_video is CanvasElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| - _default == format && |
| - _default == type && |
| - _default == pixels) { |
| + if ((border_OR_canvas_OR_image_OR_pixels_OR_video is CanvasElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| + _default == format) { |
| _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (internalformat is int || internalformat == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (border_OR_canvas_OR_image_OR_pixels_OR_video is VideoElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| - _default == format && |
| - _default == type && |
| - _default == pixels) { |
| + if ((border_OR_canvas_OR_image_OR_pixels_OR_video is VideoElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && |
| + _default == format) { |
| _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video); |
| return; |
| } |
| @@ -16973,64 +16912,30 @@ class _WebGLRenderingContextImpl extends _CanvasRenderingContextImpl implements |
| void texParameteri(int target, int pname, int param) native; |
| void texSubImage2D(int target, int level, int xoffset, int yoffset, int format_OR_width, int height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [type = _default, pixels = _default]) { |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (xoffset is int || xoffset == null) && |
| - (yoffset is int || yoffset == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| + if ((canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| (type is int || type == null) && |
| (pixels is ArrayBufferView || pixels == null)) { |
| _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (xoffset is int || xoffset == null) && |
| - (yoffset is int || yoffset == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| - _default == type && |
| - _default == pixels) { |
| + if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| + _default == type) { |
| var pixels_1 = _convertDartToNative_ImageData(canvas_OR_format_OR_image_OR_pixels_OR_video); |
| _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_OR_type, pixels_1); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (xoffset is int || xoffset == null) && |
| - (yoffset is int || yoffset == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| - _default == type && |
| - _default == pixels) { |
| + if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| + _default == type) { |
| _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (xoffset is int || xoffset == null) && |
| - (yoffset is int || yoffset == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| - _default == type && |
| - _default == pixels) { |
| + if ((canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| + _default == type) { |
| _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); |
| return; |
| } |
| - if ((target is int || target == null) && |
| - (level is int || level == null) && |
| - (xoffset is int || xoffset == null) && |
| - (yoffset is int || yoffset == null) && |
| - (format_OR_width is int || format_OR_width == null) && |
| - (height_OR_type is int || height_OR_type == null) && |
| - (canvas_OR_format_OR_image_OR_pixels_OR_video is VideoElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| - _default == type && |
| - _default == pixels) { |
| + if ((canvas_OR_format_OR_image_OR_pixels_OR_video is VideoElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && |
| + _default == type) { |
| _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video); |
| return; |
| } |