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

Side by Side Diff: pkg/compiler/lib/src/js_backend/minify_namer.dart

Issue 1214853008: Use 'a' as the first field name rather than 'Q'. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | 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 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 usedNames.add(freshName); 48 usedNames.add(freshName);
49 return new StringBackedName(freshName); 49 return new StringBackedName(freshName);
50 } 50 }
51 51
52 // From issue 7554. These should not be used on objects (as instance 52 // From issue 7554. These should not be used on objects (as instance
53 // variables) because they clash with names from the DOM. However, it is 53 // variables) because they clash with names from the DOM. However, it is
54 // OK to use them as fields, as we only access fields directly if we know 54 // OK to use them as fields, as we only access fields directly if we know
55 // the receiver type. 55 // the receiver type.
56 static const List<String> _reservedNativeProperties = const <String>[ 56 static const List<String> _reservedNativeProperties = const <String>[
57 'Q', 'a', 'b', 'c', 'd', 'e', 'f', 'r', 'x', 'y', 'z', 57 'a', 'b', 'c', 'd', 'e', 'f', 'r', 'x', 'y', 'z', 'Q',
58 // 2-letter: 58 // 2-letter:
59 'ch', 'cx', 'cy', 'db', 'dx', 'dy', 'fr', 'fx', 'fy', 'go', 'id', 'k1', 59 'ch', 'cx', 'cy', 'db', 'dx', 'dy', 'fr', 'fx', 'fy', 'go', 'id', 'k1',
60 'k2', 'k3', 'k4', 'r1', 'r2', 'rx', 'ry', 'x1', 'x2', 'y1', 'y2', 60 'k2', 'k3', 'k4', 'r1', 'r2', 'rx', 'ry', 'x1', 'x2', 'y1', 'y2',
61 // 3-letter: 61 // 3-letter:
62 'add', 'all', 'alt', 'arc', 'CCW', 'cmp', 'dir', 'end', 'get', 'in1', 62 'add', 'all', 'alt', 'arc', 'CCW', 'cmp', 'dir', 'end', 'get', 'in1',
63 'in2', 'INT', 'key', 'log', 'low', 'm11', 'm12', 'm13', 'm14', 'm21', 63 'in2', 'INT', 'key', 'log', 'low', 'm11', 'm12', 'm13', 'm14', 'm21',
64 'm22', 'm23', 'm24', 'm31', 'm32', 'm33', 'm34', 'm41', 'm42', 'm43', 64 'm22', 'm23', 'm24', 'm31', 'm32', 'm33', 'm34', 'm41', 'm42', 'm43',
65 'm44', 'max', 'min', 'now', 'ONE', 'put', 'red', 'rel', 'rev', 'RGB', 65 'm44', 'max', 'min', 'now', 'ONE', 'put', 'red', 'rel', 'rev', 'RGB',
66 'sdp', 'set', 'src', 'tag', 'top', 'uid', 'uri', 'url', 'URL', 66 'sdp', 'set', 'src', 'tag', 'top', 'uid', 'uri', 'url', 'URL',
67 // 4-letter: 67 // 4-letter:
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 @override 248 @override
249 jsAst.Name instanceFieldPropertyName(Element element) { 249 jsAst.Name instanceFieldPropertyName(Element element) {
250 jsAst.Name proposed = _minifiedInstanceFieldPropertyName(element); 250 jsAst.Name proposed = _minifiedInstanceFieldPropertyName(element);
251 if (proposed != null) { 251 if (proposed != null) {
252 return proposed; 252 return proposed;
253 } 253 }
254 return super.instanceFieldPropertyName(element); 254 return super.instanceFieldPropertyName(element);
255 } 255 }
256 } 256 }
257
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698