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

Unified 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: Also emit the precompiled constructor for typedefs; it is needed by CSP mode. 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/runtime_data.dart
diff --git a/sdk/lib/_internal/compiler/implementation/runtime_data.dart b/sdk/lib/_internal/compiler/implementation/runtime_data.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0a5688dce52cf433fa2deeb39faf771a198069f6
--- /dev/null
+++ b/sdk/lib/_internal/compiler/implementation/runtime_data.dart
@@ -0,0 +1,18 @@
+/// Contains encoding, decoding and detection functionality for the
Johnni Winther 2014/08/04 13:49:52 Needs copyright.
+/// representation of program data at runtime.
+///
+/// This library is shared between the compiler and the runtime system.
+library dart2js.runtime_data;
+
+
+String encodeTypedefFieldDescriptor(int typeIndex) {
+ return ":$typeIndex;";
+}
+
+bool isTypedefDescriptor(String descriptor) {
+ return descriptor.startsWith(':');
+}
+
+int getTypeFromTypedef(String descriptor) {
+ return int.parse(descriptor.substring(1, descriptor.length - 1));
+}

Powered by Google App Engine
This is Rietveld 408576698