| Index: dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| diff --git a/dart/sdk/lib/_internal/lib/js_mirrors.dart b/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| index fd1dd30ad3060dafc01647dde627d9482d3d9630..dc58e3835cfcf565b726017f0cf619d1c8a44612 100644
|
| --- a/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| +++ b/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| @@ -20,10 +20,14 @@ import 'dart:_js_helper' show
|
| import 'dart:_interceptors' show Interceptor;
|
| import 'dart:_js_names';
|
|
|
| -/// No-op method that is called to inform the compiler that
|
| -/// tree-shaking needs to be disabled.
|
| +/// No-op method that is called to inform the compiler that tree-shaking needs
|
| +/// to be disabled.
|
| disableTreeShaking() => preserveNames();
|
|
|
| +/// No-op method that is called to inform the compiler that metadata must be
|
| +/// preserved at runtime.
|
| +preserveMetadata() {}
|
| +
|
| String getName(Symbol symbol) {
|
| preserveNames();
|
| return n(symbol);
|
| @@ -185,7 +189,10 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror
|
| return result;
|
| }
|
|
|
| - List<InstanceMirror> get metadata => _metadata.map(reflect).toList();
|
| + List<InstanceMirror> get metadata {
|
| + preserveMetadata();
|
| + return _metadata.map(reflect).toList();
|
| + }
|
| }
|
|
|
| String n(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
|
| @@ -584,6 +591,7 @@ class JsVariableMirror extends JsDeclarationMirror implements VariableMirror {
|
| Symbol get qualifiedName => computeQualifiedName(owner, simpleName);
|
|
|
| List<InstanceMirror> get metadata {
|
| + preserveMetadata();
|
| if (_metadata == null) {
|
| _metadata = (_metadataFunction == null)
|
| ? const [] : JS('', '#()', _metadataFunction);
|
| @@ -718,6 +726,7 @@ Symbol computeQualifiedName(DeclarationMirror owner, Symbol simpleName) {
|
| }
|
|
|
| List extractMetadata(victim) {
|
| + preserveMetadata();
|
| var metadataFunction = JS('', '#["@"]', victim);
|
| return (metadataFunction == null)
|
| ? const [] : JS('', '#()', metadataFunction);
|
|
|