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

Unified Diff: sdk/lib/_internal/lib/js_mirrors.dart

Issue 467623002: Don't inherit metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update copyright year. Created 6 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: sdk/lib/_internal/lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index 6bdd46e8035095c94e33e41aedee59c85502cf17..c54dc57cb3d3f28492c5eaa7170b8219b2b39a80 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -2759,7 +2759,10 @@ Symbol computeQualifiedName(DeclarationMirror owner, Symbol simpleName) {
List extractMetadata(victim) {
preserveMetadata();
- var metadataFunction = JS('', '#["@"]', victim);
+ var metadataFunction;
+ if (JS('bool', 'Object.prototype.hasOwnProperty.call(#, "@")', victim)) {
+ metadataFunction = JS('', '#["@"]', victim);
+ }
if (metadataFunction != null) return JS('', '#()', metadataFunction);
if (JS('bool', 'typeof # != "function"', victim)) return const [];
if (JS('bool', '# in #', r'$metadataIndex', victim)) {
« no previous file with comments | « no previous file | tests/lib/mirrors/inherited_metadata_test.dart » ('j') | tests/lib/mirrors/inherited_metadata_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698