Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: frog/element.dart

Issue 8763001: Fix names with '$' to not conflict with operators or internal helpers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged again Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/corejs.dart ('k') | frog/frogsh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 5 /**
6 * Any abstract representation of a dart element. This includes 6 * Any abstract representation of a dart element. This includes
7 * [Library], [Type] and [Member]. 7 * [Library], [Type] and [Member].
8 */ 8 */
9 class Element implements Hashable { 9 class Element implements Hashable {
10 // TODO(jimhug): Make name final when we can do it for Library. 10 // TODO(jimhug): Make name final when we can do it for Library.
11 /** The user-visible name of this [Element]. */ 11 /** The user-visible name of this [Element]. */
12 String name; 12 String name;
13 13
14 /** A safe name to use for this [Element] in generated JS code. */ 14 /** A safe name to use for this [Element] in generated JS code. */
15 String _jsname; 15 String _jsname;
16 16
17 /** The lexically/logically enclosing [Element] for lookups. */ 17 /** The lexically/logically enclosing [Element] for lookups. */
18 Element _enclosingElement; 18 Element _enclosingElement;
19 19
20 Element(this.name, this._enclosingElement) { 20 Element(this.name, this._enclosingElement) {
21 _jsname = name; 21 _jsname = world.toJsIdentifier(name);
22 } 22 }
23 23
24 // TODO - walk tree 24 // TODO - walk tree
25 Library get library() => null; 25 Library get library() => null;
26 26
27 /** A source location for messages to the user about this [Element]. */ 27 /** A source location for messages to the user about this [Element]. */
28 SourceSpan get span() => null; 28 SourceSpan get span() => null;
29 29
30 /** Should this element be treated as native JS? */ 30 /** Should this element be treated as native JS? */
31 bool get isNative() => false; 31 bool get isNative() => false;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 name = typeRef.func.name.name; 120 name = typeRef.func.name.name;
121 } 121 }
122 // Totally bogus! 122 // Totally bogus!
123 typeRef.type = library.getOrAddFunctionType(this, name, typeRef.func); 123 typeRef.type = library.getOrAddFunctionType(this, name, typeRef.func);
124 } else { 124 } else {
125 world.internalError('unknown type reference', node.span); 125 world.internalError('unknown type reference', node.span);
126 } 126 }
127 return node.type; 127 return node.type;
128 } 128 }
129 } 129 }
OLDNEW
« no previous file with comments | « frog/corejs.dart ('k') | frog/frogsh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698