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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_helper.dart

Issue 13947004: dart2js: Allow 'throw' when inlining (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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: sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index badbb4dd1186584f34d1bf51708783def14f5ac9..c53f88f2a14702bf5ce91516a6314e375d8fa342 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -634,6 +634,15 @@ $throw(ex) {
}
/**
+ * This version of the $throw helper actually does the throw too. It is
+ * possible to call this in a JS expression context, where the throw statement
+ * is not allowed.
ngeoffray 2013/04/10 12:06:39 Please also add that a helper is never inlined. If
erikcorry 2013/04/10 12:52:32 Done.
+ */
+throwExpression(ex) {
+ JS('void', 'throw #', $throw(ex));
+}
+
+/**
* Wrapper class for throwing exceptions.
*/
class DartError {

Powered by Google App Engine
This is Rietveld 408576698