OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 /// Contains encoding, decoding and detection functionality for the |
| 6 /// representation of program data at runtime. |
| 7 /// |
| 8 /// This library is shared between the compiler and the runtime system. |
| 9 library dart2js.runtime_data; |
| 10 |
| 11 |
| 12 String encodeTypedefFieldDescriptor(int typeIndex) { |
| 13 return ":$typeIndex;"; |
| 14 } |
| 15 |
| 16 bool isTypedefDescriptor(String descriptor) { |
| 17 return descriptor.startsWith(':'); |
| 18 } |
| 19 |
| 20 int getTypeFromTypedef(String descriptor) { |
| 21 return int.parse(descriptor.substring(1, descriptor.length - 1)); |
| 22 } |
OLD | NEW |