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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart

Issue 693883003: Encode super calls via extra properties on prototypes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: reworked encoding 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/implementation/js_emitter/old_emitter/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
index 6c266153502120b97a67edcb207ad9877eaddfc2..0a4eea8fa1a12bcdd43dda03841b4814886277c4 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
@@ -312,9 +312,16 @@ class OldEmitter implements Emitter {
tmp.prototype = superConstructor.prototype;
var object = new tmp();
var properties = constructor.prototype;
- for (var member in properties)
- if (hasOwnProperty.call(properties, member))
- object[member] = properties[member];
+ for (var member in properties) {
+ if (hasOwnProperty.call(properties, member)) {
+ var s = member.split(':');
+ if (s.length > 1) {
+ object[s[0]] = object[s[1]] = properties[member];
+ } else {
+ object[member] = properties[member];
+ }
+ }
+ }
object.constructor = constructor;
constructor.prototype = object;
return object;
@@ -373,8 +380,8 @@ class OldEmitter implements Emitter {
if (desc instanceof Array) desc = desc[1];
/* The 'fields' are either a constructor function or a
- * string encoding fields, constructor and superclass. Get
- * the superclass and the fields in the format
+ * string encoding fields, constructor and superclass. Get the
floitsch 2014/11/04 13:35:21 Gets
herhut 2014/11/04 13:55:37 Done.
+ * superclass and fields in the format
* '[name/]Super;field1,field2'
* from the CLASS_DESCRIPTOR_PROPERTY property on the descriptor.
* The 'name/' is optional and contains the name that should be used

Powered by Google App Engine
This is Rietveld 408576698