| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this | 1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in | 2 // source code is governed by a BSD-style license that can be found in |
| 3 // the LICENSE file. | 3 // the LICENSE file. |
| 4 | 4 |
| 5 library reflectable.encoding_constants; | 5 library reflectable.encoding_constants; |
| 6 | 6 |
| 7 // The first `flagsBit-1` bits are used to enumerate the "kind" of the | 7 // The first `flagsBit-1` bits are used to enumerate the "kind" of the |
| 8 // declaration. The more significant bits are flags. | 8 // declaration. The more significant bits are flags. |
| 9 const flagsBit = 4; | 9 const flagsBit = 4; |
| 10 | 10 |
| 11 // Kinds: | 11 // Kinds: |
| 12 const generativeConstructor = 0; | 12 const generativeConstructor = 0; |
| 13 const factoryConstructor = 1; | 13 const factoryConstructor = 1; |
| 14 const method = 2; | 14 const method = 2; |
| 15 const getter = 3; | 15 const getter = 3; |
| 16 const setter = 4; | 16 const setter = 4; |
| 17 const field = 5; | 17 const field = 5; |
| 18 const parameter = 6; |
| 18 | 19 |
| 19 // Flags: | 20 // Flags: |
| 20 const staticAttribute = 1 << (flagsBit); | 21 const staticAttribute = 1 << (flagsBit); |
| 21 const privateAttribute = 1 << (flagsBit + 1); | 22 const privateAttribute = 1 << (flagsBit + 1); |
| 22 const syntheticAttribute = 1 << (flagsBit + 2); | 23 const syntheticAttribute = 1 << (flagsBit + 2); |
| 23 const constAttribute = 1 << (flagsBit + 3); | 24 const constAttribute = 1 << (flagsBit + 3); |
| 24 const redirectingConstructorAttribute = 1 << (flagsBit + 4); | 25 const redirectingConstructorAttribute = 1 << (flagsBit + 4); |
| 25 const abstractAttribute = 1 << (flagsBit + 5); | 26 const abstractAttribute = 1 << (flagsBit + 5); |
| 26 const finalAttribute = 1 << (flagsBit + 6); | 27 const finalAttribute = 1 << (flagsBit + 6); |
| 28 const hasDefaultValueAttribute = 1 << (flagsBit + 7); |
| 29 const optionalAttribute = 1 << (flagsBit + 8); |
| 30 const namedAttribute = 1 << (flagsBit + 9); |
| 31 const dynamicAttribute = 1 << (flagsBit + 10); |
| 32 const classTypeAttribute = 1 << (flagsBit + 11); |
| 27 | 33 |
| 28 int kindFromEncoding(int encoding) => encoding & ((1 << flagsBit) - 1); | 34 int kindFromEncoding(int encoding) => encoding & ((1 << flagsBit) - 1); |
| OLD | NEW |