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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 27983005: Make getLineDash return [] instead of null if it has not yet been set. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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:
Download patch
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 6615ea2212b7b0045a2339b61838f994c7a47169..2c573d3fb436a072eac1b399e69ce3be65c97300 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -1745,7 +1745,7 @@ class CanvasRenderingContext2D extends CanvasRenderingContext {
@DomName('CanvasRenderingContext2D.getLineDash')
@DocsEditable()
- List<num> getLineDash() native "CanvasRenderingContext2D_getLineDash_Callback";
+ List<num> _getLineDash() native "CanvasRenderingContext2D_getLineDash_Callback";
bool isPointInPath(num x, num y, [String winding]) {
if (winding != null) {
@@ -2082,6 +2082,15 @@ class CanvasRenderingContext2D extends CanvasRenderingContext {
destX, destY, destWidth, destHeight);
}
+ @DomName('CanvasRenderingContext2D.getLineDash')
+ List<num> getLineDash() {
+ var result = _getLineDash();
+ if (result == null) {
+ result = [];
+ setLineDash(result);
+ }
+ return result;
+ }
// TODO(amouravski): Add Dartium native methods for drawImage once we figure
// out how to not break native bindings.
}

Powered by Google App Engine
This is Rietveld 408576698