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

Side by Side Diff: frog/element.dart

Issue 9110027: Some cleanups to Frog to avoid looking up its builtin types too much (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed dead files Created 8 years, 11 months 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/gen.dart » ('j') | frog/member.dart » ('J')
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.
(...skipping 18 matching lines...) Expand all
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;
32 32
33 int hashCode() => name.hashCode(); 33 int hashCode() => name.hashCode();
34 34
35 /** Will return a safe name to refer to this element with in JS code. */ 35 /** Will return a safe name to refer to this element with in JS code. */
36 String get jsname() => _jsname; 36 String get jsname() => _jsname;
37 37
38 /** The native name of this element if it has one. */ 38 /** The native name of this element if it has one. */
39 String get nativeName() => null; 39 String get nativeName() => _jsname;
40 40
41 /** Avoid the native name if hidden native. */ 41 /** Avoid the native name if hidden native. */
42 bool get avoidNativeName() => false; 42 bool get avoidNativeName() => false;
43 43
44 /** 44 /**
45 * [jsname] priority of this element, if two elements conflict. 45 * [jsname] priority of this element, if two elements conflict.
46 * Higher one gets the name. 46 * Higher one gets the name.
47 */ 47 */
48 int get jsnamePriority() => isNative ? 2 : (library.isCore ? 1 : 0); 48 int get jsnamePriority() => isNative ? 2 : (library.isCore ? 1 : 0);
49 49
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 name = typeRef.func.name.name; 125 name = typeRef.func.name.name;
126 } 126 }
127 // Totally bogus! 127 // Totally bogus!
128 typeRef.type = library.getOrAddFunctionType(this, name, typeRef.func); 128 typeRef.type = library.getOrAddFunctionType(this, name, typeRef.func);
129 } else { 129 } else {
130 world.internalError('unknown type reference', node.span); 130 world.internalError('unknown type reference', node.span);
131 } 131 }
132 return node.type; 132 return node.type;
133 } 133 }
134 } 134 }
OLDNEW
« no previous file with comments | « frog/corejs.dart ('k') | frog/gen.dart » ('j') | frog/member.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698