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

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

Issue 10942028: Support class and typedef literals as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a comment. Created 8 years, 2 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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 const bool REPORT_EXCESS_RESOLUTION = false; 10 const bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 ClassElement closureClass; 123 ClassElement closureClass;
124 ClassElement dynamicClass; 124 ClassElement dynamicClass;
125 ClassElement boolClass; 125 ClassElement boolClass;
126 ClassElement numClass; 126 ClassElement numClass;
127 ClassElement intClass; 127 ClassElement intClass;
128 ClassElement doubleClass; 128 ClassElement doubleClass;
129 ClassElement stringClass; 129 ClassElement stringClass;
130 ClassElement functionClass; 130 ClassElement functionClass;
131 ClassElement nullClass; 131 ClassElement nullClass;
132 ClassElement listClass; 132 ClassElement listClass;
133 ClassElement typeClass;
133 ClassElement mapClass; 134 ClassElement mapClass;
134 Element assertMethod; 135 Element assertMethod;
135 Element identicalFunction; 136 Element identicalFunction;
136 Element functionApplyMethod; 137 Element functionApplyMethod;
137 138
138 Element get currentElement => _currentElement; 139 Element get currentElement => _currentElement;
139 withCurrentElement(Element element, f()) { 140 withCurrentElement(Element element, f()) {
140 Element old = currentElement; 141 Element old = currentElement;
141 _currentElement = element; 142 _currentElement = element;
142 try { 143 try {
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 return result; 368 return result;
368 } 369 }
369 objectClass = lookupSpecialClass(const SourceString('Object')); 370 objectClass = lookupSpecialClass(const SourceString('Object'));
370 boolClass = lookupSpecialClass(const SourceString('bool')); 371 boolClass = lookupSpecialClass(const SourceString('bool'));
371 numClass = lookupSpecialClass(const SourceString('num')); 372 numClass = lookupSpecialClass(const SourceString('num'));
372 intClass = lookupSpecialClass(const SourceString('int')); 373 intClass = lookupSpecialClass(const SourceString('int'));
373 doubleClass = lookupSpecialClass(const SourceString('double')); 374 doubleClass = lookupSpecialClass(const SourceString('double'));
374 stringClass = lookupSpecialClass(const SourceString('String')); 375 stringClass = lookupSpecialClass(const SourceString('String'));
375 functionClass = lookupSpecialClass(const SourceString('Function')); 376 functionClass = lookupSpecialClass(const SourceString('Function'));
376 listClass = lookupSpecialClass(const SourceString('List')); 377 listClass = lookupSpecialClass(const SourceString('List'));
378 typeClass = lookupSpecialClass(const SourceString('Type'));
377 mapClass = lookupSpecialClass(const SourceString('Map')); 379 mapClass = lookupSpecialClass(const SourceString('Map'));
378 closureClass = lookupSpecialClass(const SourceString('Closure')); 380 closureClass = lookupSpecialClass(const SourceString('Closure'));
379 dynamicClass = lookupSpecialClass(const SourceString('Dynamic_')); 381 dynamicClass = lookupSpecialClass(const SourceString('Dynamic_'));
380 nullClass = lookupSpecialClass(const SourceString('Null')); 382 nullClass = lookupSpecialClass(const SourceString('Null'));
381 types = new Types(this, dynamicClass); 383 types = new Types(this, dynamicClass);
382 if (!coreLibValid) { 384 if (!coreLibValid) {
383 cancel('core library does not contain required classes'); 385 cancel('core library does not contain required classes');
384 } 386 }
385 } 387 }
386 388
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 // TODO(johnniwinther): Use [spannable] and [message] to provide better 863 // TODO(johnniwinther): Use [spannable] and [message] to provide better
862 // information on assertion errors. 864 // information on assertion errors.
863 if (condition is Function){ 865 if (condition is Function){
864 condition = condition(); 866 condition = condition();
865 } 867 }
866 if (!condition && message != null) { 868 if (!condition && message != null) {
867 print('assertion failed: $message'); 869 print('assertion failed: $message');
868 } 870 }
869 return spannable != null && condition; 871 return spannable != null && condition;
870 } 872 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698