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

Unified Diff: frog/leg/lib/js_helper.dart

Issue 9632018: Switch-implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 9 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
Index: frog/leg/lib/js_helper.dart
diff --git a/frog/leg/lib/js_helper.dart b/frog/leg/lib/js_helper.dart
index 20c3e97e13d72a9d0ea6608684d3fce3434982bb..390a07b39c8ba5f288e16b2d703fdde29cb4302c 100644
--- a/frog/leg/lib/js_helper.dart
+++ b/frog/leg/lib/js_helper.dart
@@ -1385,3 +1385,15 @@ bool jsHasOwnProperty(var jsObject, String property) {
jsPropertyAccess(var jsObject, String property) {
return JS('var', @'$0[$1]', jsObject, property);
}
+
+
+// Called at the end of unaborted switch cases to get the (unique)
+// FallThroughError exception that will be thrown.
+FallThroughError fallThroughErrorInstance = null;
+getFallThroughError() {
+ // TODO(lrn): Redo when we support "const FallThroughError()".
+ if (fallThroughErrorInstance === null) {
+ fallThroughErrorInstance = new FallThroughError();
+ }
+ return fallThroughErrorInstance;
+}

Powered by Google App Engine
This is Rietveld 408576698