| Index: pkg/compiler/lib/src/js_backend/backend.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
|
| index 0dc1979039187ffa76be071bdb06acbb3cb87b99..af9cf061c56956c634141373f6362f98d5c94b2b 100644
|
| --- a/pkg/compiler/lib/src/js_backend/backend.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/backend.dart
|
| @@ -2361,10 +2361,16 @@ class JavaScriptBackend extends Backend {
|
| parameter.metadata.forEach(onMetadata);
|
| }
|
| }
|
| - if (element.enclosingElement is ClassElement) {
|
| - // Use [enclosingElement] instead of [enclosingClass] to ensure that
|
| - // we process patch class metadata for patch and injected members.
|
| - processElementMetadata(element.enclosingElement);
|
| + if (element.enclosingClass != null) {
|
| + // Only process library of top level fields/methods
|
| + // (and not for classes).
|
| + // TODO(johnniwinther): Fix this: We are missing some metadata on
|
| + // libraries (example: in co19/Language/Metadata/before_export_t01).
|
| + if (element.enclosingElement is ClassElement) {
|
| + // Use [enclosingElement] instead of [enclosingClass] to ensure that
|
| + // we process patch class metadata for patch and injected members.
|
| + processElementMetadata(element.enclosingElement);
|
| + }
|
| } else {
|
| processLibraryMetadata(element.library);
|
| }
|
|
|