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

Unified Diff: tool/input_sdk/private/ddc_runtime/classes.dart

Issue 2033543002: Wire up class hierarchy for recursive inheritance (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « test/codegen_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/tool/input_sdk/private/ddc_runtime/classes.dart b/tool/input_sdk/private/ddc_runtime/classes.dart
index 9359acea9e367fcaf83aaec2caa6efa36612ef1e..d8b06e6cd72ca795d814f50db976806ffe237678 100644
--- a/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -427,11 +427,14 @@ list(obj, elementType) =>
/// Link the extension to the type it's extending as a base class.
setBaseClass(derived, base) {
JS('', '#.prototype.__proto__ = #.prototype', derived, base);
+ // We use __proto__ to track the superclass hierarchy (see isSubtype).
+ JS('', '#.__proto__ = #', derived, base);
}
/// Like [setBaseClass] but for generic extension types, e.g. `JSArray<E>`
setExtensionBaseClass(derived, base) {
// Mark the generic type as an extension type.
JS('', '#.prototype[#] = #', derived, _extensionType, derived);
- setBaseClass(derived, base);
+ // Link the prototype objects
+ JS('', '#.prototype.__proto__ = #.prototype', derived, base);
}
« no previous file with comments | « test/codegen_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698