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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2625343002: Fix metadata processing (Closed)
Patch Set: Move comment Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library js_backend.backend; 5 library js_backend.backend;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
10 10
(...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 2354
2355 void processElementMetadata(Element element) { 2355 void processElementMetadata(Element element) {
2356 if (_registeredMetadata.add(element)) { 2356 if (_registeredMetadata.add(element)) {
2357 element.metadata.forEach(onMetadata); 2357 element.metadata.forEach(onMetadata);
2358 if (element.isFunction) { 2358 if (element.isFunction) {
2359 FunctionElement function = element; 2359 FunctionElement function = element;
2360 for (ParameterElement parameter in function.parameters) { 2360 for (ParameterElement parameter in function.parameters) {
2361 parameter.metadata.forEach(onMetadata); 2361 parameter.metadata.forEach(onMetadata);
2362 } 2362 }
2363 } 2363 }
2364 if (element.enclosingElement is ClassElement) { 2364 if (element.enclosingClass != null) {
2365 // Use [enclosingElement] instead of [enclosingClass] to ensure that 2365 // Only process library of top level fields/methods
2366 // we process patch class metadata for patch and injected members. 2366 // (and not for classes).
2367 processElementMetadata(element.enclosingElement); 2367 // TODO(johnniwinther): Fix this: We are missing some metadata on
2368 // libraries (example: in co19/Language/Metadata/before_export_t01).
2369 if (element.enclosingElement is ClassElement) {
2370 // Use [enclosingElement] instead of [enclosingClass] to ensure that
2371 // we process patch class metadata for patch and injected members.
2372 processElementMetadata(element.enclosingElement);
2373 }
2368 } else { 2374 } else {
2369 processLibraryMetadata(element.library); 2375 processLibraryMetadata(element.library);
2370 } 2376 }
2371 } 2377 }
2372 } 2378 }
2373 2379
2374 entities.forEach(processElementMetadata); 2380 entities.forEach(processElementMetadata);
2375 } 2381 }
2376 2382
2377 void onQueueClosed() { 2383 void onQueueClosed() {
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
3277 @override 3283 @override
3278 bool isNativeClass(ClassElement element) { 3284 bool isNativeClass(ClassElement element) {
3279 return helpers.backend.isNative(element); 3285 return helpers.backend.isNative(element);
3280 } 3286 }
3281 3287
3282 @override 3288 @override
3283 bool isNativeMember(MemberElement element) { 3289 bool isNativeMember(MemberElement element) {
3284 return helpers.backend.isNative(element); 3290 return helpers.backend.isNative(element);
3285 } 3291 }
3286 } 3292 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698