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

Unified Diff: pkg/compiler/lib/src/kernel/element_map_mixins.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/element_map_mixins.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map_mixins.dart b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
index 8b30d0b68711fabe254fd7cb694aadfa10427d87..78a1a9a79e05d2ef9645f5d36e2361d5555e25b7 100644
--- a/pkg/compiler/lib/src/kernel/element_map_mixins.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
@@ -404,10 +404,17 @@ abstract class KernelToElementMapForImpactMixin
/// Computes the native behavior for calling [procedure].
Siggi Cherem (dart-lang) 2017/08/09 16:11:15 procedure => member
Johnni Winther 2017/08/10 08:02:08 Done.
// TODO(johnniwinther): Cache this for later use.
- native.NativeBehavior getNativeBehaviorForMethod(ir.Procedure procedure,
+ native.NativeBehavior getNativeBehaviorForMethod(ir.Member member,
{bool isJsInterop}) {
- DartType type = getFunctionType(procedure.function);
- List<ConstantValue> metadata = getMetadata(procedure.annotations);
+ DartType type;
+ if (member is ir.Procedure) {
+ type = getFunctionType(member.function);
+ } else if (member is ir.Constructor) {
+ type = getFunctionType(member.function);
+ } else {
+ failedAt(CURRENT_ELEMENT_SPANNABLE, "Unexpected method node $member.");
+ }
+ List<ConstantValue> metadata = getMetadata(member.annotations);
return nativeBehaviorBuilder.buildMethodBehavior(
type, metadata, typeLookup(resolveAsRaw: false),
isJsInterop: isJsInterop);

Powered by Google App Engine
This is Rietveld 408576698