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

Unified Diff: lib/compiler/implementation/js_backend/backend.dart

Issue 10830303: Refactor Library/CompilationUnit and how we define local Scope. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix reference in dart2js_mirror.dart Created 8 years, 4 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: lib/compiler/implementation/js_backend/backend.dart
diff --git a/lib/compiler/implementation/js_backend/backend.dart b/lib/compiler/implementation/js_backend/backend.dart
index b5772286e187d8cca43c5a40c6ee60d831599e3b..da7e00d1d2889c8f298c50acb1d6f7d6ce65d363 100644
--- a/lib/compiler/implementation/js_backend/backend.dart
+++ b/lib/compiler/implementation/js_backend/backend.dart
@@ -146,7 +146,8 @@ class JavaScriptBackend extends Backend {
// If there are field setters but there is only constructor then the type
// of the field is determined by the assignments in the constructor
// body.
- if (classElement.constructors.length == 1) {
+ var constructors = classElement.constructors;
+ if (constructors.head !== null && constructors.tail === null) {
return fieldConstructorSetters[classElement][field];
} else {
return HType.UNKNOWN;

Powered by Google App Engine
This is Rietveld 408576698