| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 void registerThrowRuntimeError() {} | 148 void registerThrowRuntimeError() {} |
| 149 void registerAbstractClassInstantiation() {} | 149 void registerAbstractClassInstantiation() {} |
| 150 void registerFallThroughError() {} | 150 void registerFallThroughError() {} |
| 151 void registerSuperNoSuchMethod() {} | 151 void registerSuperNoSuchMethod() {} |
| 152 void registerConstantMap() {} | 152 void registerConstantMap() {} |
| 153 void registerRuntimeType() {} | 153 void registerRuntimeType() {} |
| 154 | 154 |
| 155 bool isNullImplementation(ClassElement cls) { | 155 bool isNullImplementation(ClassElement cls) { |
| 156 return cls == compiler.nullClass; | 156 return cls == compiler.nullClass; |
| 157 } | 157 } |
| 158 ClassElement get intImplementation => compiler.intClass; |
| 159 ClassElement get doubleImplementation => compiler.doubleClass; |
| 160 ClassElement get numImplementation => compiler.numClass; |
| 161 ClassElement get stringImplementation => compiler.stringClass; |
| 162 ClassElement get listImplementation => compiler.listClass; |
| 163 ClassElement get mapImplementation => compiler.mapClass; |
| 164 ClassElement get functionImplementation => compiler.functionClass; |
| 165 ClassElement get typeImplementation => compiler.typeClass; |
| 166 ClassElement get boolImplementation => compiler.boolClass; |
| 167 ClassElement get nullImplementation => compiler.nullClass; |
| 158 } | 168 } |
| 159 | 169 |
| 160 /** | 170 /** |
| 161 * Key class used in [TokenMap] in which the hash code for a token is based | 171 * Key class used in [TokenMap] in which the hash code for a token is based |
| 162 * on the [charOffset]. | 172 * on the [charOffset]. |
| 163 */ | 173 */ |
| 164 class TokenKey { | 174 class TokenKey { |
| 165 final Token token; | 175 final Token token; |
| 166 TokenKey(this.token); | 176 TokenKey(this.token); |
| 167 int get hashCode => token.charOffset; | 177 int get hashCode => token.charOffset; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 ClassElement boolClass; | 268 ClassElement boolClass; |
| 259 ClassElement numClass; | 269 ClassElement numClass; |
| 260 ClassElement intClass; | 270 ClassElement intClass; |
| 261 ClassElement doubleClass; | 271 ClassElement doubleClass; |
| 262 ClassElement stringClass; | 272 ClassElement stringClass; |
| 263 ClassElement functionClass; | 273 ClassElement functionClass; |
| 264 ClassElement nullClass; | 274 ClassElement nullClass; |
| 265 ClassElement listClass; | 275 ClassElement listClass; |
| 266 ClassElement typeClass; | 276 ClassElement typeClass; |
| 267 ClassElement mapClass; | 277 ClassElement mapClass; |
| 268 ClassElement mapLiteralClass; | |
| 269 ClassElement jsInvocationMirrorClass; | 278 ClassElement jsInvocationMirrorClass; |
| 270 /// Document class from dart:mirrors. | 279 /// Document class from dart:mirrors. |
| 271 ClassElement documentClass; | 280 ClassElement documentClass; |
| 272 Element assertMethod; | 281 Element assertMethod; |
| 273 Element identicalFunction; | 282 Element identicalFunction; |
| 274 Element functionApplyMethod; | 283 Element functionApplyMethod; |
| 275 Element invokeOnMethod; | 284 Element invokeOnMethod; |
| 276 Element createInvocationMirrorElement; | 285 Element createInvocationMirrorElement; |
| 277 | 286 |
| 278 Element get currentElement => _currentElement; | 287 Element get currentElement => _currentElement; |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 objectClass = lookupCoreClass('Object'); | 562 objectClass = lookupCoreClass('Object'); |
| 554 boolClass = lookupCoreClass('bool'); | 563 boolClass = lookupCoreClass('bool'); |
| 555 numClass = lookupCoreClass('num'); | 564 numClass = lookupCoreClass('num'); |
| 556 intClass = lookupCoreClass('int'); | 565 intClass = lookupCoreClass('int'); |
| 557 doubleClass = lookupCoreClass('double'); | 566 doubleClass = lookupCoreClass('double'); |
| 558 stringClass = lookupCoreClass('String'); | 567 stringClass = lookupCoreClass('String'); |
| 559 functionClass = lookupCoreClass('Function'); | 568 functionClass = lookupCoreClass('Function'); |
| 560 listClass = lookupCoreClass('List'); | 569 listClass = lookupCoreClass('List'); |
| 561 typeClass = lookupCoreClass('Type'); | 570 typeClass = lookupCoreClass('Type'); |
| 562 mapClass = lookupCoreClass('Map'); | 571 mapClass = lookupCoreClass('Map'); |
| 563 // TODO: find a proper way to get to the implementation class. | |
| 564 mapLiteralClass = lookupCoreClass('LinkedHashMap'); | |
| 565 if (!missingCoreClasses.isEmpty) { | 572 if (!missingCoreClasses.isEmpty) { |
| 566 internalErrorOnElement(coreLibrary, | 573 internalErrorOnElement(coreLibrary, |
| 567 'dart:core library does not contain required classes: ' | 574 'dart:core library does not contain required classes: ' |
| 568 '$missingCoreClasses'); | 575 '$missingCoreClasses'); |
| 569 } | 576 } |
| 570 | 577 |
| 571 final List missingHelperClasses = []; | 578 final List missingHelperClasses = []; |
| 572 ClassElement lookupHelperClass(String name) { | 579 ClassElement lookupHelperClass(String name) { |
| 573 ClassElement result = jsHelperLibrary.find(new SourceString(name)); | 580 ClassElement result = jsHelperLibrary.find(new SourceString(name)); |
| 574 if (result == null) { | 581 if (result == null) { |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 | 1178 |
| 1172 void close() {} | 1179 void close() {} |
| 1173 | 1180 |
| 1174 toString() => name; | 1181 toString() => name; |
| 1175 | 1182 |
| 1176 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1183 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1177 static NullSink outputProvider(String name, String extension) { | 1184 static NullSink outputProvider(String name, String extension) { |
| 1178 return new NullSink('$name.$extension'); | 1185 return new NullSink('$name.$extension'); |
| 1179 } | 1186 } |
| 1180 } | 1187 } |
| OLD | NEW |