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

Unified Diff: lib/runtime/dart/math.js

Issue 1093143004: fixes #52, fields shadowing getters/setters or other fields (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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 | « lib/runtime/dart/isolate.js ('k') | lib/runtime/dart/typed_data.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/math.js
diff --git a/lib/runtime/dart/math.js b/lib/runtime/dart/math.js
index ad6a382788c631272f5522865eea3cd80bf41e33..7a960393cb5adacb09848731ec6013fd6ce19929 100644
--- a/lib/runtime/dart/math.js
+++ b/lib/runtime/dart/math.js
@@ -22,8 +22,8 @@ var math;
let Point$ = dart.generic(function(T) {
class Point extends core.Object {
Point(x, y) {
- this.x = x;
- this.y = y;
+ dart.initField(Point, this, 'x', x);
+ dart.initField(Point, this, 'y', y);
}
toString() {
return `Point(${this.x}, ${this.y})`;
@@ -137,10 +137,10 @@ var math;
let Rectangle$ = dart.generic(function(T) {
class Rectangle extends _RectangleBase$(T) {
Rectangle(left, top, width, height) {
- this.left = left;
- this.top = top;
- this.width = dart.as(width['<'](0) ? dart.notNull(width['unary-']()) * 0 : width, T);
- this.height = dart.as(height['<'](0) ? dart.notNull(height['unary-']()) * 0 : height, T);
+ dart.initField(Rectangle, this, 'left', left);
+ dart.initField(Rectangle, this, 'top', top);
+ dart.initField(Rectangle, this, 'width', dart.as(width['<'](0) ? dart.notNull(width['unary-']()) * 0 : width, T));
+ dart.initField(Rectangle, this, 'height', dart.as(height['<'](0) ? dart.notNull(height['unary-']()) * 0 : height, T));
super._RectangleBase();
}
fromPoints(a, b) {
@@ -160,8 +160,8 @@ var math;
let MutableRectangle$ = dart.generic(function(T) {
class MutableRectangle extends _RectangleBase$(T) {
MutableRectangle(left, top, width, height) {
- this.left = left;
- this.top = top;
+ dart.initField(MutableRectangle, this, 'left', left);
+ dart.initField(MutableRectangle, this, 'top', top);
this[_width] = dart.as(width['<'](0) ? _clampToZero(width) : width, T);
this[_height] = dart.as(height['<'](0) ? _clampToZero(height) : height, T);
super._RectangleBase();
« no previous file with comments | « lib/runtime/dart/isolate.js ('k') | lib/runtime/dart/typed_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698