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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/declarations.dart

Issue 1198293002: dart2js: Use an abstract Name class for names in the generated JavaScript ast. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix tests Created 5 years, 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 /// Enables debugging of fast/slow objects using V8-specific primitives. 7 /// Enables debugging of fast/slow objects using V8-specific primitives.
8 const DEBUG_FAST_OBJECTS = false; 8 const DEBUG_FAST_OBJECTS = false;
9 9
10 /** 10 /**
11 * Call-back for adding property with [name] and [value]. 11 * Call-back for adding property with [name] and [value].
12 */ 12 */
13 typedef jsAst.Property AddPropertyFunction(String name, jsAst.Expression value); 13 typedef jsAst.Property AddPropertyFunction(jsAst.Name name,
14 jsAst.Expression value);
14 15
15 /** 16 /**
16 * [member] is a field (instance, static, or top level). 17 * [member] is a field (instance, static, or top level).
17 * 18 *
18 * [name] is the field name that the [Namer] has picked for this field's 19 * [name] is the field name that the [Namer] has picked for this field's
19 * storage, that is, the JavaScript property name. 20 * storage, that is, the JavaScript property name.
20 * 21 *
21 * [accessorName] is the name of the accessor. For instance fields this is 22 * [accessorName] is the name of the accessor. For instance fields this is
22 * mostly the same as [name] except when [member] is shadowing a field in its 23 * mostly the same as [name] except when [member] is shadowing a field in its
23 * superclass. For other fields, they are rarely the same. 24 * superclass. For other fields, they are rarely the same.
24 * 25 *
25 * [needsGetter] and [needsSetter] represent if a getter or a setter 26 * [needsGetter] and [needsSetter] represent if a getter or a setter
26 * respectively is needed. There are many factors in this, for example, if the 27 * respectively is needed. There are many factors in this, for example, if the
27 * accessor can be inlined. 28 * accessor can be inlined.
28 * 29 *
29 * [needsCheckedSetter] indicates that a checked getter is needed, and in this 30 * [needsCheckedSetter] indicates that a checked getter is needed, and in this
30 * case, [needsSetter] is always false. [needsCheckedSetter] is only true when 31 * case, [needsSetter] is always false. [needsCheckedSetter] is only true when
31 * type assertions are enabled (checked mode). 32 * type assertions are enabled (checked mode).
32 */ 33 */
33 typedef void AcceptField(VariableElement member, 34 typedef void AcceptField(VariableElement member,
34 String name, 35 jsAst.Name name,
35 String accessorName, 36 jsAst.Name accessorName,
36 bool needsGetter, 37 bool needsGetter,
37 bool needsSetter, 38 bool needsSetter,
38 bool needsCheckedSetter); 39 bool needsCheckedSetter);
39 40
40 // Function signatures used in the generation of runtime type information. 41 // Function signatures used in the generation of runtime type information.
41 typedef void FunctionTypeSignatureEmitter(Element method, 42 typedef void FunctionTypeSignatureEmitter(Element method,
42 FunctionType methodType); 43 FunctionType methodType);
43 44
44 typedef void SubstitutionEmitter(Element element, {bool emitNull}); 45 typedef void SubstitutionEmitter(Element element, {bool emitNull});
45 46
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // characters. 81 // characters.
81 const FIELD_CODE_CHARACTERS = r"<=>?@{|}~%&'()*"; 82 const FIELD_CODE_CHARACTERS = r"<=>?@{|}~%&'()*";
82 const NO_FIELD_CODE = 0; 83 const NO_FIELD_CODE = 0;
83 const FIRST_FIELD_CODE = 1; 84 const FIRST_FIELD_CODE = 1;
84 const RANGE1_FIRST = 0x3c; // <=>?@ encodes 1..5 85 const RANGE1_FIRST = 0x3c; // <=>?@ encodes 1..5
85 const RANGE1_LAST = 0x40; 86 const RANGE1_LAST = 0x40;
86 const RANGE2_FIRST = 0x7b; // {|}~ encodes 6..9 87 const RANGE2_FIRST = 0x7b; // {|}~ encodes 6..9
87 const RANGE2_LAST = 0x7e; 88 const RANGE2_LAST = 0x7e;
88 const RANGE3_FIRST = 0x25; // %&'()*+ encodes 10..16 89 const RANGE3_FIRST = 0x25; // %&'()*+ encodes 10..16
89 const RANGE3_LAST = 0x2b; 90 const RANGE3_LAST = 0x2b;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698