| 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 8453ab675048837c6e801707bcc1ce8f5c029cca..2887c43e96c54ee929b4c4cdeee517e96f7c0d8f 100644
|
| --- a/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| +++ b/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| @@ -33,6 +33,8 @@ import 'dart:_interceptors' show
|
| JSExtendableArray;
|
| import 'dart:_js_names';
|
|
|
| +const String METHODS_WITH_OPTIONAL_ARGUMENTS = r'$methodsWithOptionalArguments';
|
| +
|
| /// No-op method that is called to inform the compiler that tree-shaking needs
|
| /// to be disabled.
|
| disableTreeShaking() => preserveNames();
|
| @@ -1007,7 +1009,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror
|
| List<String> keys = extractKeys(prototype);
|
| var result = <JsMethodMirror>[];
|
| for (String key in keys) {
|
| - if (key == '') continue;
|
| + if (isReflectiveDataInPrototype(key)) continue;
|
| String simpleName = mangledNames[key];
|
| // [simpleName] can be null if [key] represents an implementation
|
| // detail, for example, a bailout method, or runtime type support.
|
| @@ -1026,7 +1028,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror
|
| int length = keys.length;
|
| for (int i = 0; i < length; i++) {
|
| String mangledName = keys[i];
|
| - if (mangledName == '') continue; // Skip static field descriptor.
|
| + if (isReflectiveDataInPrototype(mangledName)) continue;
|
| String unmangledName = mangledName;
|
| var jsFunction = JS('', '#[#]', owner._globalObject, mangledName);
|
|
|
| @@ -1895,6 +1897,14 @@ bool isOperatorName(String name) {
|
| }
|
| }
|
|
|
| +/// Returns true if the key represent ancillary reflection data, that is, not a
|
| +/// method.
|
| +bool isReflectiveDataInPrototype(String key) {
|
| + if (key == '' || key == METHODS_WITH_OPTIONAL_ARGUMENTS) return true;
|
| + String firstChar = key[0];
|
| + return firstChar == '*' || firstChar == '+';
|
| +}
|
| +
|
| // Copied from package "unmodifiable_collection".
|
| // TODO(ahe): Lobby to get it added to dart:collection.
|
| class UnmodifiableMapView<K, V> implements Map<K, V> {
|
|
|