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

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

Issue 1988683004: Use _extensionType for detecting prototype inheritance. (Closed) Base URL: https://github.com/dart-lang/dev_compiler@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 | « lib/runtime/dart_sdk.js ('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 722aa0c0979807294cf8da9c50684c00bb1b295f..ae3f863d4b668df9fc1dcb56e07aa7b1a0fb5c1e 100644
--- a/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -280,11 +280,6 @@ defineExtensionNames(names) =>
JS('', '#.forEach(#)', names, getExtensionSymbol);
-/// A map from peer class prototypes to the Dart class prototype. This is used
-/// to recognize when Dart subclass inheritance corresponds to JavaScript
-/// prototype inheritance.
-final _installedDartPeers = JS('', 'new Map()');
-
/// Install properties in prototype-first order. Properties / descriptors from
/// more specific types should overwrite ones from less specific types.
void _installProperties(jsProto, extProto) {
@@ -293,13 +288,12 @@ void _installProperties(jsProto, extProto) {
// constructor.
var coreObjProto = JS('', '#.prototype', Object);
+ var parentsExtension =
+ JS('', '(#.__proto__)[#]', jsProto, _extensionType);
var installedParent =
- JS('', '#.get(#.__proto__)', _installedDartPeers, jsProto);
+ JS('', '# && #.prototype', parentsExtension, parentsExtension);
_installProperties2(jsProto, extProto, coreObjProto, installedParent);
-
- // Mark this jsProto as being the prototype for the extension class.
- JS('', '#.set(#, #)', _installedDartPeers, jsProto, extProto);
}
void _installProperties2(jsProto, extProto, coreObjProto, installedParent) {
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698