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

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

Issue 10916172: num implements Comparable and Hashable. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« no previous file with comments | « no previous file | lib/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import('../tree/tree.dart'); 9 #import('../tree/tree.dart');
10 #import('../scanner/scannerlib.dart'); 10 #import('../scanner/scannerlib.dart');
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 // TODO(ahe): Remove this case: Legacy support for pre-0.11 spec. 1544 // TODO(ahe): Remove this case: Legacy support for pre-0.11 spec.
1545 return selector; 1545 return selector;
1546 } else if (str === '?') { 1546 } else if (str === '?') {
1547 return selector; 1547 return selector;
1548 } else { 1548 } else {
1549 throw new Exception('Unhandled selector: ${selector.slowToString()}'); 1549 throw new Exception('Unhandled selector: ${selector.slowToString()}');
1550 } 1550 }
1551 return new SourceString('operator\$$str'); 1551 return new SourceString('operator\$$str');
1552 } 1552 }
1553 1553
1554 static bool isStringSupertype(Element element, Compiler compiler) { 1554 static bool isNumberOrStringSupertype(Element element, Compiler compiler) {
1555 LibraryElement coreLibrary = compiler.coreLibrary; 1555 LibraryElement coreLibrary = compiler.coreLibrary;
1556 return (element == coreLibrary.find(const SourceString('Comparable'))) 1556 return (element == coreLibrary.find(const SourceString('Comparable')))
1557 || (element == coreLibrary.find(const SourceString('Hashable'))) 1557 || (element == coreLibrary.find(const SourceString('Hashable')));
1558 || (element == coreLibrary.find(const SourceString('Pattern'))); 1558 }
1559
1560 static bool isStringOnlySupertype(Element element, Compiler compiler) {
1561 LibraryElement coreLibrary = compiler.coreLibrary;
1562 return element == coreLibrary.find(const SourceString('Pattern'));
1559 } 1563 }
1560 1564
1561 static bool isListSupertype(Element element, Compiler compiler) { 1565 static bool isListSupertype(Element element, Compiler compiler) {
1562 LibraryElement coreLibrary = compiler.coreLibrary; 1566 LibraryElement coreLibrary = compiler.coreLibrary;
1563 return (element == coreLibrary.find(const SourceString('Collection'))) 1567 return (element == coreLibrary.find(const SourceString('Collection')))
1564 || (element == coreLibrary.find(const SourceString('Iterable'))); 1568 || (element == coreLibrary.find(const SourceString('Iterable')));
1565 } 1569 }
1566 } 1570 }
1567 1571
1568 class LabelElement extends Element { 1572 class LabelElement extends Element {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 1688
1685 MetadataAnnotation ensureResolved(Compiler compiler) { 1689 MetadataAnnotation ensureResolved(Compiler compiler) {
1686 if (resolutionState == STATE_NOT_STARTED) { 1690 if (resolutionState == STATE_NOT_STARTED) {
1687 compiler.resolver.resolveMetadataAnnotation(this); 1691 compiler.resolver.resolveMetadataAnnotation(this);
1688 } 1692 }
1689 return this; 1693 return this;
1690 } 1694 }
1691 1695
1692 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 1696 String toString() => 'MetadataAnnotation($value, $resolutionState)';
1693 } 1697 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698