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

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

Issue 10942028: Support class and typedef literals as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Peter's comments. Created 8 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
Index: lib/compiler/implementation/dart_backend/backend.dart
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index 0ac9d3e8dc79923a24428aa8ee1f9ca4046d999a..101918b89bc7d6b0fab4fa0c4d91bac7535bc630 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -264,11 +264,12 @@ class DartBackend extends Backend {
* Tells whether we should output given element. Corelib classes like
* Object should not be in the resulting code.
*/
- bool shouldOutput(Element element) =>
- !identical(element.kind, ElementKind.VOID) &&
- isUserLibrary(element.getLibrary()) &&
- element is !SynthesizedConstructorElement &&
- element is !AbstractFieldElement;
+ bool shouldOutput(Element element) {
+ return !identical(element.kind, ElementKind.VOID)
+ && isUserLibrary(element.getLibrary())
+ && element is !SynthesizedConstructorElement
+ && element is !AbstractFieldElement;
+ }
final elementAsts = new Map<Element, ElementAst>();
@@ -315,8 +316,7 @@ class DartBackend extends Backend {
if (shouldOutput(classElement)) addClass(classElement);
});
resolvedElements.forEach((element, treeElements) {
- if (!shouldOutput(element)) return;
-
+ if (!shouldOutput(element) || treeElements == null) return;
ahe 2012/11/05 09:47:05 Why would treeElements be null?
var elementAst = new ElementAst.rewrite(
compiler, parse(element), treeElements, stripAsserts);
if (element.isField()) {

Powered by Google App Engine
This is Rietveld 408576698