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

Unified Diff: pkg/compiler/lib/src/kernel/native_basic_data.dart

Issue 2995643002: Support jsinterop/world_test from .dill (Closed)
Patch Set: Created 3 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: pkg/compiler/lib/src/kernel/native_basic_data.dart
diff --git a/pkg/compiler/lib/src/kernel/native_basic_data.dart b/pkg/compiler/lib/src/kernel/native_basic_data.dart
index c8463018189df9fa5b95e24d66be6e2baf067ef3..ec07f7a6a79757de5cb44b6b06b76ff07d843d25 100644
--- a/pkg/compiler/lib/src/kernel/native_basic_data.dart
+++ b/pkg/compiler/lib/src/kernel/native_basic_data.dart
@@ -129,18 +129,33 @@ class KernelAnnotationProcessor implements AnnotationProcessor {
{'cls': cls.name, 'member': member.name});
}
- if (function is ConstructorEntity &&
- function.isFactoryConstructor &&
- isAnonymous) {
- if (function.parameterStructure.requiredParameters > 0) {
+ checkFunctionParameters(function);
+ });
+ elementEnvironment.forEachConstructor(cls,
+ (ConstructorEntity constructor) {
+ String memberName = getJsInteropName(
+ library, elementEnvironment.getMemberMetadata(constructor));
+ if (memberName != null) {
+ _nativeBasicDataBuilder.markAsJsInteropMember(
+ constructor, memberName);
+ }
+
+ if (!constructor.isExternal) {
+ reporter.reportErrorMessage(
+ constructor,
+ MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
+ {'cls': cls.name, 'member': constructor.name});
+ }
+ if (constructor.isFactoryConstructor && isAnonymous) {
+ if (constructor.parameterStructure.requiredParameters > 0) {
reporter.reportErrorMessage(
- function,
+ constructor,
MessageKind
.JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS,
{'cls': cls.name});
}
} else {
- checkFunctionParameters(function);
+ checkFunctionParameters(constructor);
Siggi Cherem (dart-lang) 2017/08/09 16:11:15 isn't the constructor included in `forEachClassMem
Johnni Winther 2017/08/10 08:02:08 It isn't.
}
});
}

Powered by Google App Engine
This is Rietveld 408576698