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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart

Issue 548253003: First end-to-end capability in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 3 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/dart_backend/backend_ast_to_frontend_ast.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart
index 320add26d315570ceff8ef7ffeb3cd25efa8319b..9db5ef25b9c7b16ab133c915a4f8c6cda2016e46 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart
@@ -23,6 +23,10 @@ tree.FunctionExpression emit(dart2js.TreeElementMapping treeElements,
/// backend.
const bool INSERT_NEW_BACKEND_COMMENT = true;
+/// The comment inserted in front of every function body.
+const String NEW_BACKEND_COMMENT =
+ INSERT_NEW_BACKEND_COMMENT ? '/* new backend */ ' : '';
+
/// Converts backend ASTs to frontend ASTs.
class TreePrinter {
dart2js.TreeElementMapping treeElements;
@@ -236,11 +240,12 @@ class TreePrinter {
tree.Node makeStaticReceiver(elements.Element element) {
if (treeElements == null) return null;
- if (element.enclosingElement is elements.ClassElement) {
+ if (element.isStatic) {
+ elements.ClassElement enclosingClass = element.enclosingClass;
tree.Send send = new tree.Send(
null,
- makeIdentifier(element.enclosingElement.name));
- treeElements[send] = element.enclosingElement;
+ makeIdentifier(enclosingClass.name));
+ treeElements[send] = enclosingClass;
return send;
} else {
return null;
@@ -579,7 +584,7 @@ class TreePrinter {
/// A comment token to be inserted when [INSERT_NEW_BACKEND_COMMENT] is true.
final SymbolToken newBackendComment = new SymbolToken(
- const PrecedenceInfo('/* new backend */ ', 0, OPEN_CURLY_BRACKET_TOKEN),
+ const PrecedenceInfo(NEW_BACKEND_COMMENT, 0, OPEN_CURLY_BRACKET_TOKEN),
-1);
tree.Node makeFunctionBody(Statement stmt) {

Powered by Google App Engine
This is Rietveld 408576698