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

Unified Diff: frog/gen.dart

Issue 8590017: Fix "is Object" to always be true in Dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: take2 after syncing Created 9 years, 1 month 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
« no previous file with comments | « frog/frogsh ('k') | frog/type.dart » ('j') | frog/value.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/gen.dart
diff --git a/frog/gen.dart b/frog/gen.dart
index 78fd0bd95dbe121248150a27191295173edb1b74..190ef53b48b859f36499038ad8bf90dac8e78bba 100644
--- a/frog/gen.dart
+++ b/frog/gen.dart
@@ -1324,7 +1324,7 @@ class MethodGenerator implements TreeVisitor {
}
_genToDartException(ex.code, node);
- if (!ex.type.isVar) {
+ if (!ex.type.isVarOrObject) {
var test = ex.instanceOf(this, ex.type, catch_.exception.span,
isTrue:false, forceCheck:true);
writer.writeln('if (${test.code}) throw ${ex.code};');
@@ -1345,7 +1345,7 @@ class MethodGenerator implements TreeVisitor {
}
_genToDartException(ex.code, node);
- // We need a rethrow unless we encounter a "var" catch
+ // We need a rethrow unless we encounter a "var" or "Object" catch
bool needsRethrow = true;
for (int i = 0; i < node.catches.length; i++) {
@@ -1353,7 +1353,7 @@ class MethodGenerator implements TreeVisitor {
_pushBlock();
var tmp = _scope.declare(catch_.exception);
- if (!tmp.type.isVar) {
+ if (!tmp.type.isVarOrObject) {
var test = ex.instanceOf(this, tmp.type, catch_.exception.span,
isTrue:true, forceCheck:true);
if (i == 0) {
@@ -1375,7 +1375,7 @@ class MethodGenerator implements TreeVisitor {
visitStatementsInBlock(catch_.body);
_popBlock();
- if (tmp.type.isVar) {
+ if (tmp.type.isVarOrObject) {
// We matched this for sure; no need to keep going
if (i + 1 < node.catches.length) {
world.warning('Unreachable catch clause', node.catches[i + 1]);
« no previous file with comments | « frog/frogsh ('k') | frog/type.dart » ('j') | frog/value.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698