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

Side by Side Diff: lib/compiler/implementation/elements/elements.dart

Issue 11140018: Ensure that ClassElement.lookupConstructor fails when looking up default constructor using Selector… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use [==] and [!=] instead of [identical] for SourceString comparison. 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 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 library elements; 5 library elements;
6 6
7 import 'dart:uri'; 7 import 'dart:uri';
8 8
9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed. 9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed.
10 import '../../compiler.dart' as api_e; 10 import '../../compiler.dart' as api_e;
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 return result; 1475 return result;
1476 } 1476 }
1477 1477
1478 // TODO(aprelev@gmail.com): Peter believes that it would be great to 1478 // TODO(aprelev@gmail.com): Peter believes that it would be great to
1479 // make noMatch a required argument. Peter's suspicion is that most 1479 // make noMatch a required argument. Peter's suspicion is that most
1480 // callers of this method would benefit from using the noMatch method. 1480 // callers of this method would benefit from using the noMatch method.
1481 Element lookupConstructor(Selector selector, [Element noMatch(Element)]) { 1481 Element lookupConstructor(Selector selector, [Element noMatch(Element)]) {
1482 SourceString normalizedName; 1482 SourceString normalizedName;
1483 SourceString className = this.name; 1483 SourceString className = this.name;
1484 SourceString constructorName = selector.name; 1484 SourceString constructorName = selector.name;
1485 if (!identical(constructorName, const SourceString('')) && 1485 if (constructorName != const SourceString('')) {
1486 ((className == null) ||
1487 (constructorName.slowToString() != className.slowToString()))) {
1488 normalizedName = Elements.constructConstructorName(className, 1486 normalizedName = Elements.constructConstructorName(className,
1489 constructorName); 1487 constructorName);
1490 } else { 1488 } else {
1491 normalizedName = className; 1489 normalizedName = className;
1492 } 1490 }
1493 Element result = localLookup(normalizedName); 1491 Element result = localLookup(normalizedName);
1494 return validateConstructorLookupResults(selector, result, noMatch); 1492 return validateConstructorLookupResults(selector, result, noMatch);
1495 } 1493 }
1496 1494
1497 Element lookupFactoryConstructor(Selector selector, 1495 Element lookupFactoryConstructor(Selector selector,
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1933 1931
1934 MetadataAnnotation ensureResolved(Compiler compiler) { 1932 MetadataAnnotation ensureResolved(Compiler compiler) {
1935 if (resolutionState == STATE_NOT_STARTED) { 1933 if (resolutionState == STATE_NOT_STARTED) {
1936 compiler.resolver.resolveMetadataAnnotation(this); 1934 compiler.resolver.resolveMetadataAnnotation(this);
1937 } 1935 }
1938 return this; 1936 return this;
1939 } 1937 }
1940 1938
1941 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 1939 String toString() => 'MetadataAnnotation($value, $resolutionState)';
1942 } 1940 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/resolution/members.dart » ('j') | tests/compiler/dart2js/resolver_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698