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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/runtime_data.dart

Issue 360493002: Emit declarations for typedefs that are needed by reflection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698