| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 js_backend.namer; | 5 part of js_backend.namer; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Assigns JavaScript identifiers to Dart variables, class-names and members. | 8 * Assigns JavaScript identifiers to Dart variables, class-names and members. |
| 9 */ | 9 */ |
| 10 class MinifyNamer extends Namer | 10 class MinifyNamer extends Namer |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 cls, new _ConstructorBodyNamingScope(cls.superclass, registry)); | 345 cls, new _ConstructorBodyNamingScope(cls.superclass, registry)); |
| 346 } else { | 346 } else { |
| 347 return new _ConstructorBodyNamingScope.forClass( | 347 return new _ConstructorBodyNamingScope.forClass( |
| 348 cls, new _ConstructorBodyNamingScope(cls.superclass, registry)); | 348 cls, new _ConstructorBodyNamingScope(cls.superclass, registry)); |
| 349 } | 349 } |
| 350 }); | 350 }); |
| 351 } | 351 } |
| 352 | 352 |
| 353 String constructorBodyKeyFor(ConstructorBodyElement body) { | 353 String constructorBodyKeyFor(ConstructorBodyElement body) { |
| 354 int position = _constructors.indexOf(body.constructor); | 354 int position = _constructors.indexOf(body.constructor); |
| 355 assert(invariant(body, position >= 0, message: "constructor body missing")); | 355 assert(position >= 0, failedAt(body, "constructor body missing")); |
| 356 return "@constructorBody@${_startIndex + position}"; | 356 return "@constructorBody@${_startIndex + position}"; |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 abstract class _MinifyConstructorBodyNamer implements Namer { | 360 abstract class _MinifyConstructorBodyNamer implements Namer { |
| 361 Map<ClassElement, _ConstructorBodyNamingScope> _constructorBodyScopes = | 361 Map<ClassElement, _ConstructorBodyNamingScope> _constructorBodyScopes = |
| 362 new Map<ClassElement, _ConstructorBodyNamingScope>(); | 362 new Map<ClassElement, _ConstructorBodyNamingScope>(); |
| 363 | 363 |
| 364 @override | 364 @override |
| 365 jsAst.Name constructorBodyName(FunctionElement method) { | 365 jsAst.Name constructorBodyName(FunctionElement method) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 383 String prefix = | 383 String prefix = |
| 384 selector.isGetter ? r"$get" : selector.isSetter ? r"$set" : ""; | 384 selector.isGetter ? r"$get" : selector.isSetter ? r"$set" : ""; |
| 385 String callSuffix = selector.isCall | 385 String callSuffix = selector.isCall |
| 386 ? callSuffixForStructure(selector.callStructure).join() | 386 ? callSuffixForStructure(selector.callStructure).join() |
| 387 : ""; | 387 : ""; |
| 388 String suffix = suffixForGetInterceptor(classes); | 388 String suffix = suffixForGetInterceptor(classes); |
| 389 String fullName = "\$intercepted$prefix\$$root$callSuffix\$$suffix"; | 389 String fullName = "\$intercepted$prefix\$$root$callSuffix\$$suffix"; |
| 390 return _disambiguateInternalGlobal(fullName); | 390 return _disambiguateInternalGlobal(fullName); |
| 391 } | 391 } |
| 392 } | 392 } |
| OLD | NEW |