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

Unified Diff: pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js

Issue 2781443003: Fix #28120, strong mode allows field overrides (Closed)
Patch Set: fix Created 3 years, 9 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
Index: pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js
diff --git a/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js b/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js
index 5f718aa6b7b9f63abe49a3af3c4a65788f4873f2..ed7254130041aade8e8b7a9c908a5769848a5c73 100644
--- a/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js
+++ b/pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js
@@ -65,12 +65,33 @@ define(['dart_sdk'], function(dart_sdk) {
};
dart.fn(sunflower.draw, VoidTovoid());
circle.Circle = class Circle extends core.Object {
+ get x() {
+ return this[x$];
+ }
+ set x(value) {
+ super.x = value;
+ }
+ get y() {
+ return this[y$];
+ }
+ set y(value) {
+ super.y = value;
+ }
+ get radius() {
+ return this[radius$];
+ }
+ set radius(value) {
+ super.radius = value;
+ }
new(x, y, radius) {
- this.x = x;
- this.y = y;
- this.radius = radius;
+ this[x$] = x;
+ this[y$] = y;
+ this[radius$] = radius;
}
};
+ const x$ = Symbol("Circle.x");
+ const y$ = Symbol("Circle.y");
+ const radius$ = Symbol("Circle.radius");
dart.setSignature(circle.Circle, {
fields: () => ({
x: core.num,
@@ -80,7 +101,13 @@ define(['dart_sdk'], function(dart_sdk) {
});
painter.CirclePainter = class CirclePainter extends core.Object {
new() {
- this.color = painter.ORANGE;
+ this[color] = painter.ORANGE;
+ }
+ get color() {
+ return this[color];
+ }
+ set color(value) {
+ this[color] = value;
}
draw(context) {
context.beginPath();
@@ -93,6 +120,7 @@ define(['dart_sdk'], function(dart_sdk) {
context.stroke();
}
};
+ const color = Symbol("CirclePainter.color");
painter.CirclePainter[dart.implements] = () => [circle.Circle];
dart.setSignature(painter.CirclePainter, {
fields: () => ({color: core.String}),
« no previous file with comments | « pkg/dev_compiler/test/codegen_expected/closure.js ('k') | pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698