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

Unified Diff: test/codegen/expect/sunflower/sunflower.js

Issue 1965213003: simplify constructors, fixes #564 (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/expect/opassign.js ('k') | test/codegen/expect/sunflower/sunflower.js.map » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/sunflower/sunflower.js
diff --git a/test/codegen/expect/sunflower/sunflower.js b/test/codegen/expect/sunflower/sunflower.js
index 414c05c116c90615a4c4ed624cefa8412ada794f..7e3ed9a060ae81e74797fe6ccbd2bae08a5b92d0 100644
--- a/test/codegen/expect/sunflower/sunflower.js
+++ b/test/codegen/expect/sunflower/sunflower.js
@@ -64,17 +64,17 @@ dart_library.library('sunflower', null, /* Imports */[
};
dart.fn(sunflower.draw, dart.void, []);
circle.Circle = class Circle extends core.Object {
- Circle(x, y, radius) {
+ new(x, y, radius) {
this.x = x;
this.y = y;
this.radius = radius;
}
};
dart.setSignature(circle.Circle, {
- constructors: () => ({Circle: [circle.Circle, [core.num, core.num, core.num]]})
+ constructors: () => ({new: [circle.Circle, [core.num, core.num, core.num]]})
});
painter.CirclePainter = class CirclePainter extends core.Object {
- CirclePainter() {
+ new() {
this.color = painter.ORANGE;
}
draw(context) {
@@ -93,14 +93,14 @@ dart_library.library('sunflower', null, /* Imports */[
methods: () => ({draw: [dart.void, [html.CanvasRenderingContext2D]]})
});
sunflower.SunflowerSeed = class SunflowerSeed extends dart.mixin(circle.Circle, painter.CirclePainter) {
- SunflowerSeed(x, y, radius, color) {
+ new(x, y, radius, color) {
if (color === void 0) color = null;
- super.Circle(x, y, radius);
+ super.new(x, y, radius);
if (color != null) this.color = color;
}
};
dart.setSignature(sunflower.SunflowerSeed, {
- constructors: () => ({SunflowerSeed: [sunflower.SunflowerSeed, [core.num, core.num, core.num], [core.String]]})
+ constructors: () => ({new: [sunflower.SunflowerSeed, [core.num, core.num, core.num], [core.String]]})
});
painter.ORANGE = "orange";
painter.RED = "red";
« no previous file with comments | « test/codegen/expect/opassign.js ('k') | test/codegen/expect/sunflower/sunflower.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698