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; | 5 part of js_backend; |
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 with _MinifiedFieldNamer, | 10 class MinifyNamer extends Namer with _MinifiedFieldNamer, |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 /// [selector] and return-type specialization. | 335 /// [selector] and return-type specialization. |
336 @override | 336 @override |
337 jsAst.Name nameForGetOneShotInterceptor(Selector selector, | 337 jsAst.Name nameForGetOneShotInterceptor(Selector selector, |
338 Iterable<ClassElement> classes) { | 338 Iterable<ClassElement> classes) { |
339 String root = selector.isOperator | 339 String root = selector.isOperator |
340 ? operatorNameToIdentifier(selector.name) | 340 ? operatorNameToIdentifier(selector.name) |
341 : privateName(selector.memberName); | 341 : privateName(selector.memberName); |
342 String prefix = selector.isGetter | 342 String prefix = selector.isGetter |
343 ? r"$get" | 343 ? r"$get" |
344 : selector.isSetter ? r"$set" : ""; | 344 : selector.isSetter ? r"$set" : ""; |
345 String arity = selector.isCall ? "${selector.argumentCount}" : ""; | 345 String callSuffix = |
| 346 selector.isCall ? callSuffixForStructure(selector.callStructure) : ""; |
346 String suffix = suffixForGetInterceptor(classes); | 347 String suffix = suffixForGetInterceptor(classes); |
347 String fullName = "\$intercepted$prefix\$$root$arity\$$suffix"; | 348 String fullName = "\$intercepted$prefix\$$root$callSuffix\$$suffix"; |
348 return _disambiguateInternalGlobal(fullName); | 349 return _disambiguateInternalGlobal(fullName); |
349 } | 350 } |
350 } | 351 } |
351 | 352 |
OLD | NEW |