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

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

Issue 753113002: Encode super calls via extra properties on prototypes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incremental Compilation Support restored. Created 6 years, 1 month 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/compiler/js_lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart b/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
index 5f613d37079abbf891ba64dff62a97645616f613..1c0433d09d6ea373118e2b99fe2daf743980edd1 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_mirrors.dart
@@ -733,6 +733,8 @@ Map<Symbol, Mirror> filterMembers(List<MethodMirror> methods,
}
// Constructors aren't 'members'.
if (method.isConstructor) continue;
+ // Filter out synthetic tear-off stubs
+ if (JS('bool', r'!!#.$getterStub', method._jsFunction)) continue;
// Use putIfAbsent to filter-out getters corresponding to variables.
result.putIfAbsent(method.simpleName, () => method);
}
@@ -1664,6 +1666,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror
if (simpleName == null) continue;
var function = JS('', '#[#]', prototype, key);
if (isNoSuchMethodStub(function)) continue;
+ if (isAliasedSuperMethod(function, key)) continue;
var mirror =
new JsMethodMirror.fromUnmangledName(
simpleName, function, false, false);
@@ -2905,6 +2908,13 @@ bool isNoSuchMethodStub(var jsFunction) {
return JS('bool', r'#.$reflectable == 2', jsFunction);
}
+/// Returns true if [key] is only an aliased entry for [function] in the
+/// prototype.
+bool isAliasedSuperMethod(var jsFunction, String key) {
+ var stubName = JS('String|Null', r'#.$stubName', jsFunction);
+ return stubName != null && key != stubName;
+}
+
class NoSuchStaticMethodError extends Error implements NoSuchMethodError {
static const int MISSING_CONSTRUCTOR = 0;
static const int MISSING_METHOD = 1;

Powered by Google App Engine
This is Rietveld 408576698