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

Unified Diff: pkg/compiler/lib/src/js_backend/backend_serialization.dart

Issue 2731163002: Split js interop registration into library/class/member elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 9 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/field_naming_mixin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend_serialization.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend_serialization.dart b/pkg/compiler/lib/src/js_backend/backend_serialization.dart
index f1ea95b75ad8ea3f74e9ee09e5c708e6ef4499db..eacdf1bcdf311e2a3bc5a4a27675e48fe6d2f453 100644
--- a/pkg/compiler/lib/src/js_backend/backend_serialization.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_serialization.dart
@@ -39,7 +39,9 @@ class JavaScriptBackendSerialization implements BackendSerialization {
deserializer = new JavaScriptBackendDeserializer(nativeData);
}
-const Key JS_INTEROP_NAME = const Key('jsInteropName');
+const Key JS_INTEROP_LIBRARY_NAME = const Key('jsInteropLibraryName');
+const Key JS_INTEROP_CLASS_NAME = const Key('jsInteropClassName');
+const Key JS_INTEROP_MEMBER_NAME = const Key('jsInteropMemberName');
const Key NATIVE_MEMBER_NAME = const Key('nativeMemberName');
const Key NATIVE_CLASS_TAG_INFO = const Key('nativeClassTagInfo');
const Key NATIVE_METHOD_BEHAVIOR = const Key('nativeMethodBehavior');
@@ -58,9 +60,17 @@ class JavaScriptBackendSerializer implements SerializerPlugin {
return encoder ??= createEncoder(_BACKEND_DATA_TAG);
}
- String jsInteropName = nativeData.jsInteropNames[element];
- if (jsInteropName != null) {
- getEncoder().setString(JS_INTEROP_NAME, jsInteropName);
+ String jsInteropLibraryName = nativeData.jsInteropLibraryNames[element];
+ if (jsInteropLibraryName != null) {
+ getEncoder().setString(JS_INTEROP_LIBRARY_NAME, jsInteropLibraryName);
+ }
+ String jsInteropClassName = nativeData.jsInteropClassNames[element];
+ if (jsInteropClassName != null) {
+ getEncoder().setString(JS_INTEROP_CLASS_NAME, jsInteropClassName);
+ }
+ String jsInteropMemberName = nativeData.jsInteropMemberNames[element];
+ if (jsInteropMemberName != null) {
+ getEncoder().setString(JS_INTEROP_MEMBER_NAME, jsInteropMemberName);
}
String nativeMemberName = nativeData.nativeMemberName[element];
if (nativeMemberName != null) {
@@ -107,10 +117,20 @@ class JavaScriptBackendDeserializer implements DeserializerPlugin {
void onElement(Element element, ObjectDecoder getDecoder(String tag)) {
ObjectDecoder decoder = getDecoder(_BACKEND_DATA_TAG);
if (decoder != null) {
- String jsInteropName =
- decoder.getString(JS_INTEROP_NAME, isOptional: true);
- if (jsInteropName != null) {
- nativeData.jsInteropNames[element] = jsInteropName;
+ String jsInteropLibraryName =
+ decoder.getString(JS_INTEROP_LIBRARY_NAME, isOptional: true);
+ if (jsInteropLibraryName != null) {
+ nativeData.jsInteropLibraryNames[element] = jsInteropLibraryName;
+ }
+ String jsInteropClassName =
+ decoder.getString(JS_INTEROP_CLASS_NAME, isOptional: true);
+ if (jsInteropClassName != null) {
+ nativeData.jsInteropClassNames[element] = jsInteropClassName;
+ }
+ String jsInteropMemberName =
+ decoder.getString(JS_INTEROP_MEMBER_NAME, isOptional: true);
+ if (jsInteropMemberName != null) {
+ nativeData.jsInteropMemberNames[element] = jsInteropMemberName;
}
String nativeMemberName =
decoder.getString(NATIVE_MEMBER_NAME, isOptional: true);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/field_naming_mixin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698