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

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: Made VM not fail on x is Null tests. 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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 objectClass = lookupCoreClass('Object'); 768 objectClass = lookupCoreClass('Object');
769 boolClass = lookupCoreClass('bool'); 769 boolClass = lookupCoreClass('bool');
770 numClass = lookupCoreClass('num'); 770 numClass = lookupCoreClass('num');
771 intClass = lookupCoreClass('int'); 771 intClass = lookupCoreClass('int');
772 doubleClass = lookupCoreClass('double'); 772 doubleClass = lookupCoreClass('double');
773 stringClass = lookupCoreClass('String'); 773 stringClass = lookupCoreClass('String');
774 functionClass = lookupCoreClass('Function'); 774 functionClass = lookupCoreClass('Function');
775 listClass = lookupCoreClass('List'); 775 listClass = lookupCoreClass('List');
776 typeClass = lookupCoreClass('Type'); 776 typeClass = lookupCoreClass('Type');
777 mapClass = lookupCoreClass('Map'); 777 mapClass = lookupCoreClass('Map');
778 nullClass = lookupCoreClass('Null');
778 stackTraceClass = lookupCoreClass('StackTrace'); 779 stackTraceClass = lookupCoreClass('StackTrace');
779 if (!missingCoreClasses.isEmpty) { 780 if (!missingCoreClasses.isEmpty) {
780 internalErrorOnElement(coreLibrary, 781 internalErrorOnElement(coreLibrary,
781 'dart:core library does not contain required classes: ' 782 'dart:core library does not contain required classes: '
782 '$missingCoreClasses'); 783 '$missingCoreClasses');
783 } 784 }
784 785
785 // The Symbol class may not exist during unit testing. 786 // The Symbol class may not exist during unit testing.
786 // TODO(ahe): It is possible that we have to require the presence 787 // TODO(ahe): It is possible that we have to require the presence
787 // of Symbol as we change how we implement noSuchMethod. 788 // of Symbol as we change how we implement noSuchMethod.
788 symbolClass = lookupCoreClass('Symbol'); 789 symbolClass = lookupCoreClass('Symbol');
789 790
790 final List missingHelperClasses = []; 791 final List missingHelperClasses = [];
791 ClassElement lookupHelperClass(String name) { 792 ClassElement lookupHelperClass(String name) {
792 ClassElement result = jsHelperLibrary.find(new SourceString(name)); 793 ClassElement result = jsHelperLibrary.find(new SourceString(name));
793 if (result == null) { 794 if (result == null) {
794 missingHelperClasses.add(name); 795 missingHelperClasses.add(name);
795 } 796 }
796 return result; 797 return result;
797 } 798 }
798 jsInvocationMirrorClass = lookupHelperClass('JSInvocationMirror'); 799 jsInvocationMirrorClass = lookupHelperClass('JSInvocationMirror');
799 boundClosureClass = lookupHelperClass('BoundClosure'); 800 boundClosureClass = lookupHelperClass('BoundClosure');
800 closureClass = lookupHelperClass('Closure'); 801 closureClass = lookupHelperClass('Closure');
801 dynamicClass = lookupHelperClass('Dynamic_'); 802 dynamicClass = lookupHelperClass('Dynamic_');
802 nullClass = lookupHelperClass('Null');
803 if (!missingHelperClasses.isEmpty) { 803 if (!missingHelperClasses.isEmpty) {
804 internalErrorOnElement(jsHelperLibrary, 804 internalErrorOnElement(jsHelperLibrary,
805 'dart:_js_helper library does not contain required classes: ' 805 'dart:_js_helper library does not contain required classes: '
806 '$missingHelperClasses'); 806 '$missingHelperClasses');
807 } 807 }
808 808
809 if (types == null) { 809 if (types == null) {
810 types = new Types(this, dynamicClass); 810 types = new Types(this, dynamicClass);
811 } 811 }
812 backend.initializeHelperClasses(); 812 backend.initializeHelperClasses();
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 1475
1476 void close() {} 1476 void close() {}
1477 1477
1478 toString() => name; 1478 toString() => name;
1479 1479
1480 /// Convenience method for getting an [api.CompilerOutputProvider]. 1480 /// Convenience method for getting an [api.CompilerOutputProvider].
1481 static NullSink outputProvider(String name, String extension) { 1481 static NullSink outputProvider(String name, String extension) {
1482 return new NullSink('$name.$extension'); 1482 return new NullSink('$name.$extension');
1483 } 1483 }
1484 } 1484 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698