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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1062823004: Fix a couple codegen crashers (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 5 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
« no previous file with comments | « no previous file | test/codegen/cascade.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index dda805bcf8fdd0fcb8ed805b5732cf9836ae6b07..3a4194c6676b2869e25715dae14c4db78679f8ac 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -1760,8 +1760,8 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
} else if (expr is PropertyAccess) {
PropertyAccess prop = expr;
return new PropertyAccess(
- _bindValue(scope, 'o', prop.target, context: context), prop.operator,
- prop.propertyName)..staticType = expr.staticType;
+ _bindValue(scope, 'o', _getTarget(prop), context: context),
+ prop.operator, prop.propertyName)..staticType = expr.staticType;
} else if (expr is PrefixedIdentifier) {
PrefixedIdentifier ident = expr;
return new PrefixedIdentifier(
@@ -2022,14 +2022,14 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
// This could incorrectly shadow a user's name.
var savedCatch = _catchParameter;
- if (clauses.length == 1) {
+ if (clauses.length == 1 && clauses.single.exceptionParameter != null) {
// Special case for a single catch.
_catchParameter = clauses.single.exceptionParameter;
} else {
_catchParameter = _createTemporary('e', rules.provider.dynamicType);
}
- JS.Statement catchBody = null;
+ JS.Statement catchBody = js.statement('throw #;', _visit(_catchParameter));
for (var clause in clauses.reversed) {
catchBody = _catchClauseGuard(clause, catchBody);
}
« no previous file with comments | « no previous file | test/codegen/cascade.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698