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

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

Issue 1918033002: Remove virtualField helper, just emit getters/setters in codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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/language/final_field_override_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 683aed56ea36990f5418c19bf7777b1c0d4b9fed..adaf1d984f98c1c594bceb7043266b41b401e324 100644
--- a/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -230,27 +230,6 @@ setSignature(f, signature) => JS('', '''(() => {
hasMethod(obj, name) => JS('', '$getMethodType($obj, $name) !== void 0');
///
-/// This is called whenever a derived class needs to introduce a new field,
-/// shadowing a field or getter/setter pair on its parent.
-///
-/// This is important because otherwise, trying to read or write the field
-/// would end up calling the getter or setter, and one of those might not even
-/// exist, resulting in a runtime error. Even if they did exist, that's the
-/// wrong behavior if a new field was declared.
-///
-virtualField(subclass, fieldName) => JS('', '''(() => {
- // If the field is already overridden, do nothing.
- let prop = $getOwnPropertyDescriptor($subclass.prototype, $fieldName);
- if (prop) return;
-
- let symbol = Symbol($subclass.name + '.' + $fieldName.toString());
- $defineProperty($subclass.prototype, $fieldName, {
- get: function() { return this[symbol]; },
- set: function(x) { this[symbol] = x; }
- });
-})()''');
-
-///
/// Given a class and an initializer method name, creates a constructor
/// function with the same name. For example `new SomeClass.name(args)`.
///
« no previous file with comments | « test/codegen/language/final_field_override_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698