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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java

Issue 10907215: Issue 3553. Stop treating static final variables as constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks for tests Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 package com.google.dart.compiler.resolver; 5 package com.google.dart.compiler.resolver;
6 6
7 import com.google.common.annotations.VisibleForTesting; 7 import com.google.common.annotations.VisibleForTesting;
8 import com.google.common.collect.Lists; 8 import com.google.common.collect.Lists;
9 import com.google.common.collect.Maps; 9 import com.google.common.collect.Maps;
10 import com.google.dart.compiler.DartCompilationError; 10 import com.google.dart.compiler.DartCompilationError;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 @Override 275 @Override
276 public Void visitMethodDefinition(DartMethodDefinition node) { 276 public Void visitMethodDefinition(DartMethodDefinition node) {
277 node.setElement(Elements.methodFromMethodNode(node, library)); 277 node.setElement(Elements.methodFromMethodNode(node, library));
278 return null; 278 return null;
279 } 279 }
280 280
281 @Override 281 @Override
282 public Void visitField(DartField node) { 282 public Void visitField(DartField node) {
283 Modifiers modifiers = node.getModifiers(); 283 Modifiers modifiers = node.getModifiers();
284 if (modifiers.isFinal()) {
285 // final top-level fields are implicitly compile-time constants.
286 modifiers = modifiers.makeConstant();
287 }
288 node.setElement(Elements.fieldFromNode(node, library, node.getObsoleteMeta data(), modifiers)); 284 node.setElement(Elements.fieldFromNode(node, library, node.getObsoleteMeta data(), modifiers));
289 return null; 285 return null;
290 } 286 }
291 } 287 }
292 } 288 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698