| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |