| 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 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 Loading... |
| 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 Loading... |
| 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 | |
| OLD | NEW |