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 * Names are generated through three stages: | 10 * Names are generated through three stages: |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 case JsGetName.IS_INDEXABLE_FIELD_NAME: | 506 case JsGetName.IS_INDEXABLE_FIELD_NAME: |
507 Element cls = backend.findHelper('JavaScriptIndexingBehavior'); | 507 Element cls = backend.findHelper('JavaScriptIndexingBehavior'); |
508 return operatorIs(cls); | 508 return operatorIs(cls); |
509 case JsGetName.NULL_CLASS_TYPE_NAME: | 509 case JsGetName.NULL_CLASS_TYPE_NAME: |
510 return runtimeTypeName(compiler.nullClass); | 510 return runtimeTypeName(compiler.nullClass); |
511 case JsGetName.OBJECT_CLASS_TYPE_NAME: | 511 case JsGetName.OBJECT_CLASS_TYPE_NAME: |
512 return runtimeTypeName(compiler.objectClass); | 512 return runtimeTypeName(compiler.objectClass); |
513 case JsGetName.FUNCTION_CLASS_TYPE_NAME: | 513 case JsGetName.FUNCTION_CLASS_TYPE_NAME: |
514 return runtimeTypeName(compiler.functionClass); | 514 return runtimeTypeName(compiler.functionClass); |
515 default: | 515 default: |
516 compiler.reportError( | 516 compiler.reportErrorMessage( |
517 node, MessageKind.GENERIC, | 517 node, |
| 518 MessageKind.GENERIC, |
518 {'text': 'Error: Namer has no name for "$name".'}); | 519 {'text': 'Error: Namer has no name for "$name".'}); |
519 return asName('BROKEN'); | 520 return asName('BROKEN'); |
520 } | 521 } |
521 } | 522 } |
522 | 523 |
523 /// Return a reference to the given [name]. | 524 /// Return a reference to the given [name]. |
524 /// | 525 /// |
525 /// This is used to ensure that every use site of a name has a unique node so | 526 /// This is used to ensure that every use site of a name has a unique node so |
526 /// that we can properly attribute source information. | 527 /// that we can properly attribute source information. |
527 jsAst.Name _newReference(jsAst.Name name) { | 528 jsAst.Name _newReference(jsAst.Name name) { |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1992 } | 1993 } |
1993 } | 1994 } |
1994 } | 1995 } |
1995 } | 1996 } |
1996 | 1997 |
1997 enum NamingScope { | 1998 enum NamingScope { |
1998 global, | 1999 global, |
1999 instance, | 2000 instance, |
2000 constant | 2001 constant |
2001 } | 2002 } |
OLD | NEW |