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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 23012003: Add Null class to dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Marked test failing due to new dart2js mirror bug. Created 7 years, 4 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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 objectClass = lookupCoreClass('Object'); 773 objectClass = lookupCoreClass('Object');
774 boolClass = lookupCoreClass('bool'); 774 boolClass = lookupCoreClass('bool');
775 numClass = lookupCoreClass('num'); 775 numClass = lookupCoreClass('num');
776 intClass = lookupCoreClass('int'); 776 intClass = lookupCoreClass('int');
777 doubleClass = lookupCoreClass('double'); 777 doubleClass = lookupCoreClass('double');
778 stringClass = lookupCoreClass('String'); 778 stringClass = lookupCoreClass('String');
779 functionClass = lookupCoreClass('Function'); 779 functionClass = lookupCoreClass('Function');
780 listClass = lookupCoreClass('List'); 780 listClass = lookupCoreClass('List');
781 typeClass = lookupCoreClass('Type'); 781 typeClass = lookupCoreClass('Type');
782 mapClass = lookupCoreClass('Map'); 782 mapClass = lookupCoreClass('Map');
783 nullClass = lookupCoreClass('Null');
783 stackTraceClass = lookupCoreClass('StackTrace'); 784 stackTraceClass = lookupCoreClass('StackTrace');
784 if (!missingCoreClasses.isEmpty) { 785 if (!missingCoreClasses.isEmpty) {
785 internalErrorOnElement(coreLibrary, 786 internalErrorOnElement(coreLibrary,
786 'dart:core library does not contain required classes: ' 787 'dart:core library does not contain required classes: '
787 '$missingCoreClasses'); 788 '$missingCoreClasses');
788 } 789 }
789 790
790 // The Symbol class may not exist during unit testing. 791 // The Symbol class may not exist during unit testing.
791 // TODO(ahe): It is possible that we have to require the presence 792 // TODO(ahe): It is possible that we have to require the presence
792 // of Symbol as we change how we implement noSuchMethod. 793 // of Symbol as we change how we implement noSuchMethod.
793 symbolClass = lookupCoreClass('Symbol'); 794 symbolClass = lookupCoreClass('Symbol');
794 795
795 final List missingHelperClasses = []; 796 final List missingHelperClasses = [];
796 ClassElement lookupHelperClass(String name) { 797 ClassElement lookupHelperClass(String name) {
797 ClassElement result = jsHelperLibrary.find(new SourceString(name)); 798 ClassElement result = jsHelperLibrary.find(new SourceString(name));
798 if (result == null) { 799 if (result == null) {
799 missingHelperClasses.add(name); 800 missingHelperClasses.add(name);
800 } 801 }
801 return result; 802 return result;
802 } 803 }
803 jsInvocationMirrorClass = lookupHelperClass('JSInvocationMirror'); 804 jsInvocationMirrorClass = lookupHelperClass('JSInvocationMirror');
804 boundClosureClass = lookupHelperClass('BoundClosure'); 805 boundClosureClass = lookupHelperClass('BoundClosure');
805 closureClass = lookupHelperClass('Closure'); 806 closureClass = lookupHelperClass('Closure');
806 dynamicClass = lookupHelperClass('Dynamic_'); 807 dynamicClass = lookupHelperClass('Dynamic_');
807 nullClass = lookupHelperClass('Null');
808 if (!missingHelperClasses.isEmpty) { 808 if (!missingHelperClasses.isEmpty) {
809 internalErrorOnElement(jsHelperLibrary, 809 internalErrorOnElement(jsHelperLibrary,
810 'dart:_js_helper library does not contain required classes: ' 810 'dart:_js_helper library does not contain required classes: '
811 '$missingHelperClasses'); 811 '$missingHelperClasses');
812 } 812 }
813 813
814 if (types == null) { 814 if (types == null) {
815 types = new Types(this, dynamicClass); 815 types = new Types(this, dynamicClass);
816 } 816 }
817 backend.initializeHelperClasses(); 817 backend.initializeHelperClasses();
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 1480
1481 void close() {} 1481 void close() {}
1482 1482
1483 toString() => name; 1483 toString() => name;
1484 1484
1485 /// Convenience method for getting an [api.CompilerOutputProvider]. 1485 /// Convenience method for getting an [api.CompilerOutputProvider].
1486 static NullSink outputProvider(String name, String extension) { 1486 static NullSink outputProvider(String name, String extension) {
1487 return new NullSink('$name.$extension'); 1487 return new NullSink('$name.$extension');
1488 } 1488 }
1489 } 1489 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698