| Index: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
|
| index 13cc42b9cab04eb484b4db8e810383084580cb5f..8a2ab78ca2e963a6d8bafe774f77a257f958ef15 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
|
| @@ -105,11 +105,25 @@ class NativeEmitter {
|
| return backend.namer.isolateAccess(element);
|
| }
|
|
|
| - List<String> nativeTagsOfClass(ClassElement cls) {
|
| + // The tags string contains comma-separated 'words' which are either dispatch
|
| + // tags (having JavaScript identifier syntax) and directives that begin with
|
| + // `!`.
|
| + List<String> nativeTagsOfClassRaw(ClassElement cls) {
|
| String quotedName = cls.nativeTagInfo.slowToString();
|
| return quotedName.substring(1, quotedName.length - 1).split(',');
|
| }
|
|
|
| + List<String> nativeTagsOfClass(ClassElement cls) {
|
| + return nativeTagsOfClassRaw(cls).where((s) => !s.startsWith('!')).toList();
|
| + }
|
| +
|
| + bool nativeHasTagsMarker(ClassElement cls, String marker) {
|
| + return nativeTagsOfClassRaw(cls).contains(marker);
|
| + }
|
| +
|
| + bool nativeForcedNonLeaf(ClassElement cls) =>
|
| + nativeHasTagsMarker(cls, '!nonleaf');
|
| +
|
| /**
|
| * Writes the class definitions for the interceptors to [mainBuffer].
|
| * Writes code to associate dispatch tags with interceptors to [nativeBuffer].
|
| @@ -197,6 +211,10 @@ class NativeEmitter {
|
| } else if (extensionPoints.containsKey(classElement)) {
|
| needed = true;
|
| }
|
| + if (classElement.isNative() && nativeForcedNonLeaf(classElement)) {
|
| + needed = true;
|
| + nonleafClasses.add(classElement);
|
| + }
|
|
|
| if (needed || neededClasses.contains(classElement)) {
|
| neededClasses.add(classElement);
|
|
|