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

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

Issue 1090313002: 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/src/codegen/js_codegen.dart » ('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..565e5fff110c366ed670fa7edf425fde58f78399 100644
--- a/lib/runtime/dart/math.js
+++ b/lib/runtime/dart/math.js
@@ -19,11 +19,19 @@ var math;
return _JenkinsSmiHash.finish(_JenkinsSmiHash.combine(_JenkinsSmiHash.combine(_JenkinsSmiHash.combine(_JenkinsSmiHash.combine(0, dart.as(a, core.int)), dart.as(b, core.int)), dart.as(c, core.int)), dart.as(d, core.int)));
}
}
+ let x$ = Symbol('x');
+ let y$ = Symbol('y');
let Point$ = dart.generic(function(T) {
class Point extends core.Object {
+ get x() {
+ return this[x$];
+ }
+ get y() {
+ return this[y$];
+ }
Point(x, y) {
- this.x = x;
- this.y = y;
+ this[x$] = x;
+ this[y$] = y;
}
toString() {
return `Point(${this.x}, ${this.y})`;
@@ -134,13 +142,29 @@ var math;
return _RectangleBase;
});
let _RectangleBase = _RectangleBase$();
+ let left$ = Symbol('left');
+ let top$ = Symbol('top');
+ let width$ = Symbol('width');
+ let height$ = Symbol('height');
let Rectangle$ = dart.generic(function(T) {
class Rectangle extends _RectangleBase$(T) {
+ get left() {
+ return this[left$];
+ }
+ get top() {
+ return this[top$];
+ }
+ get width() {
+ return this[width$];
+ }
+ get height() {
+ return this[height$];
+ }
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);
+ 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);
super._RectangleBase();
}
fromPoints(a, b) {
@@ -155,13 +179,27 @@ var math;
return Rectangle;
});
let Rectangle = Rectangle$();
+ let left$0 = Symbol('left');
+ let top$0 = Symbol('top');
let _width = Symbol('_width');
let _height = Symbol('_height');
let MutableRectangle$ = dart.generic(function(T) {
class MutableRectangle extends _RectangleBase$(T) {
+ get left() {
+ return this[left$0];
+ }
+ set left(value) {
+ this[left$0] = value;
+ }
+ get top() {
+ return this[top$0];
+ }
+ set top(value) {
+ this[top$0] = value;
+ }
MutableRectangle(left, top, width, height) {
- this.left = left;
- this.top = top;
+ this[left$0] = left;
+ this[top$0] = 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/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698