OLD | NEW |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ClassElement closureClass; | 120 ClassElement closureClass; |
121 ClassElement dynamicClass; | 121 ClassElement dynamicClass; |
122 ClassElement boolClass; | 122 ClassElement boolClass; |
123 ClassElement numClass; | 123 ClassElement numClass; |
124 ClassElement intClass; | 124 ClassElement intClass; |
125 ClassElement doubleClass; | 125 ClassElement doubleClass; |
126 ClassElement stringClass; | 126 ClassElement stringClass; |
127 ClassElement functionClass; | 127 ClassElement functionClass; |
128 ClassElement nullClass; | 128 ClassElement nullClass; |
129 ClassElement listClass; | 129 ClassElement listClass; |
| 130 ClassElement typeClass; |
130 ClassElement mapClass; | 131 ClassElement mapClass; |
131 ClassElement jsInvocationMirrorClass; | 132 ClassElement jsInvocationMirrorClass; |
132 Element assertMethod; | 133 Element assertMethod; |
133 Element identicalFunction; | 134 Element identicalFunction; |
134 Element functionApplyMethod; | 135 Element functionApplyMethod; |
135 Element invokeOnMethod; | 136 Element invokeOnMethod; |
136 | 137 |
137 Element get currentElement => _currentElement; | 138 Element get currentElement => _currentElement; |
138 withCurrentElement(Element element, f()) { | 139 withCurrentElement(Element element, f()) { |
139 Element old = currentElement; | 140 Element old = currentElement; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 return result; | 397 return result; |
397 } | 398 } |
398 objectClass = lookupSpecialClass(const SourceString('Object')); | 399 objectClass = lookupSpecialClass(const SourceString('Object')); |
399 boolClass = lookupSpecialClass(const SourceString('bool')); | 400 boolClass = lookupSpecialClass(const SourceString('bool')); |
400 numClass = lookupSpecialClass(const SourceString('num')); | 401 numClass = lookupSpecialClass(const SourceString('num')); |
401 intClass = lookupSpecialClass(const SourceString('int')); | 402 intClass = lookupSpecialClass(const SourceString('int')); |
402 doubleClass = lookupSpecialClass(const SourceString('double')); | 403 doubleClass = lookupSpecialClass(const SourceString('double')); |
403 stringClass = lookupSpecialClass(const SourceString('String')); | 404 stringClass = lookupSpecialClass(const SourceString('String')); |
404 functionClass = lookupSpecialClass(const SourceString('Function')); | 405 functionClass = lookupSpecialClass(const SourceString('Function')); |
405 listClass = lookupSpecialClass(const SourceString('List')); | 406 listClass = lookupSpecialClass(const SourceString('List')); |
| 407 typeClass = lookupSpecialClass(const SourceString('Type')); |
406 mapClass = lookupSpecialClass(const SourceString('Map')); | 408 mapClass = lookupSpecialClass(const SourceString('Map')); |
407 jsInvocationMirrorClass = | 409 jsInvocationMirrorClass = |
408 lookupSpecialClass(const SourceString('JSInvocationMirror')); | 410 lookupSpecialClass(const SourceString('JSInvocationMirror')); |
409 closureClass = lookupSpecialClass(const SourceString('Closure')); | 411 closureClass = lookupSpecialClass(const SourceString('Closure')); |
410 dynamicClass = lookupSpecialClass(const SourceString('Dynamic_')); | 412 dynamicClass = lookupSpecialClass(const SourceString('Dynamic_')); |
411 nullClass = lookupSpecialClass(const SourceString('Null')); | 413 nullClass = lookupSpecialClass(const SourceString('Null')); |
412 types = new Types(this, dynamicClass); | 414 types = new Types(this, dynamicClass); |
413 if (!coreLibValid) { | 415 if (!coreLibValid) { |
414 cancel('core library does not contain required classes'); | 416 cancel('core library does not contain required classes'); |
415 } | 417 } |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 908 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
907 // information on assertion errors. | 909 // information on assertion errors. |
908 if (condition is Function){ | 910 if (condition is Function){ |
909 condition = condition(); | 911 condition = condition(); |
910 } | 912 } |
911 if (spannable == null || !condition) { | 913 if (spannable == null || !condition) { |
912 throw new SpannableAssertionFailure(spannable, message); | 914 throw new SpannableAssertionFailure(spannable, message); |
913 } | 915 } |
914 return true; | 916 return true; |
915 } | 917 } |
OLD | NEW |