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

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

Issue 48323003: Implement fromEnvironment on bool, int, String in dart2js. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 // Initialized when dart:mirrors is loaded. 458 // Initialized when dart:mirrors is loaded.
459 ClassElement deferredLibraryClass; 459 ClassElement deferredLibraryClass;
460 460
461 ClassElement jsInvocationMirrorClass; 461 ClassElement jsInvocationMirrorClass;
462 /// Document class from dart:mirrors. 462 /// Document class from dart:mirrors.
463 ClassElement documentClass; 463 ClassElement documentClass;
464 Element assertMethod; 464 Element assertMethod;
465 Element identicalFunction; 465 Element identicalFunction;
466 Element functionApplyMethod; 466 Element functionApplyMethod;
467 Element invokeOnMethod; 467 Element invokeOnMethod;
468 Element intEnvironment;
469 Element boolEnvironment;
470 Element stringEnvironment;
471
472 fromEnvironment(String name) => null;
468 473
469 Element get currentElement => _currentElement; 474 Element get currentElement => _currentElement;
470 475
471 String tryToString(object) { 476 String tryToString(object) {
472 try { 477 try {
473 return object.toString(); 478 return object.toString();
474 } catch (_) { 479 } catch (_) {
475 return '<exception in toString()>'; 480 return '<exception in toString()>';
476 } 481 }
477 } 482 }
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 if (mirrorSystemClass == cls) { 842 if (mirrorSystemClass == cls) {
838 mirrorSystemGetNameFunction = 843 mirrorSystemGetNameFunction =
839 cls.lookupLocalMember('getName'); 844 cls.lookupLocalMember('getName');
840 } else if (symbolClass == cls) { 845 } else if (symbolClass == cls) {
841 symbolConstructor = cls.constructors.head; 846 symbolConstructor = cls.constructors.head;
842 } else if (symbolImplementationClass == cls) { 847 } else if (symbolImplementationClass == cls) {
843 symbolValidatedConstructor = symbolImplementationClass.lookupConstructor( 848 symbolValidatedConstructor = symbolImplementationClass.lookupConstructor(
844 symbolValidatedConstructorSelector); 849 symbolValidatedConstructorSelector);
845 } else if (mirrorsUsedClass == cls) { 850 } else if (mirrorsUsedClass == cls) {
846 mirrorsUsedConstructor = cls.constructors.head; 851 mirrorsUsedConstructor = cls.constructors.head;
852 } else if (intClass == cls) {
853 intEnvironment = intClass.lookupConstructor(
854 new Selector.callConstructor('fromEnvironment', null, 2));
855 } else if (stringClass == cls) {
856 stringEnvironment = stringClass.lookupConstructor(
857 new Selector.callConstructor('fromEnvironment', null, 2));
858 } else if (boolClass == cls) {
859 boolEnvironment = boolClass.lookupConstructor(
860 new Selector.callConstructor('fromEnvironment', null, 1));
kasperl 2013/10/30 13:35:25 Again, I don't really see why bool.fromEnvironment
ngeoffray 2013/10/30 15:13:59 Done.
847 } 861 }
848 } 862 }
849 863
850 Future<LibraryElement> scanBuiltinLibrary(String filename); 864 Future<LibraryElement> scanBuiltinLibrary(String filename);
851 865
852 void initializeSpecialClasses() { 866 void initializeSpecialClasses() {
853 final List missingCoreClasses = []; 867 final List missingCoreClasses = [];
854 ClassElement lookupCoreClass(String name) { 868 ClassElement lookupCoreClass(String name) {
855 ClassElement result = coreLibrary.find(name); 869 ClassElement result = coreLibrary.find(name);
856 if (result == null) { 870 if (result == null) {
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 1637
1624 void close() {} 1638 void close() {}
1625 1639
1626 toString() => name; 1640 toString() => name;
1627 1641
1628 /// Convenience method for getting an [api.CompilerOutputProvider]. 1642 /// Convenience method for getting an [api.CompilerOutputProvider].
1629 static NullSink outputProvider(String name, String extension) { 1643 static NullSink outputProvider(String name, String extension) {
1630 return new NullSink('$name.$extension'); 1644 return new NullSink('$name.$extension');
1631 } 1645 }
1632 } 1646 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698