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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java

Issue 10516006: Issue 3268. Support for replacing 'assert' statement with 'assert' function (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes for review comments Created 8 years, 6 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: compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
index 080d3bd0637bfa240ae04ad42a59cca98aef5565..07abae93c7bc0f9659ce7f98e092a570ae91b643 100644
--- a/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
+++ b/compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java
@@ -123,6 +123,10 @@ public class TopLevelElementBuilder {
Element oldElement = scope.declareElement(newElement.getName(), newElement);
// We had already node with such name, report duplicate.
if (oldElement != null) {
+ // ignore "assert"
+ if (Elements.isArtificialAssertMethod(oldElement)) {
+ return;
+ }
// Getter/setter can shared same name, but not setter/setter and getter/getter.
if (newElement.getModifiers().isAbstractField()
&& oldElement.getModifiers().isAbstractField()) {

Powered by Google App Engine
This is Rietveld 408576698