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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var math; 1 var math;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 class _JenkinsSmiHash extends core.Object { 4 class _JenkinsSmiHash extends core.Object {
5 static combine(hash, value) { 5 static combine(hash, value) {
6 hash = 536870911 & dart.notNull(hash) + dart.notNull(value); 6 hash = 536870911 & dart.notNull(hash) + dart.notNull(value);
7 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) << 10); 7 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) << 10);
8 return dart.notNull(hash) ^ dart.notNull(hash) >> 6; 8 return dart.notNull(hash) ^ dart.notNull(hash) >> 6;
9 } 9 }
10 static finish(hash) { 10 static finish(hash) {
11 hash = 536870911 & dart.notNull(hash) + ((67108863 & dart.notNull(hash)) < < 3); 11 hash = 536870911 & dart.notNull(hash) + ((67108863 & dart.notNull(hash)) < < 3);
12 hash = dart.notNull(hash) ^ dart.notNull(hash) >> 11; 12 hash = dart.notNull(hash) ^ dart.notNull(hash) >> 11;
13 return 536870911 & dart.notNull(hash) + ((16383 & dart.notNull(hash)) << 1 5); 13 return 536870911 & dart.notNull(hash) + ((16383 & dart.notNull(hash)) << 1 5);
14 } 14 }
15 static hash2(a, b) { 15 static hash2(a, b) {
16 return _JenkinsSmiHash.finish(_JenkinsSmiHash.combine(_JenkinsSmiHash.comb ine(0, dart.as(a, core.int)), dart.as(b, core.int))); 16 return _JenkinsSmiHash.finish(_JenkinsSmiHash.combine(_JenkinsSmiHash.comb ine(0, dart.as(a, core.int)), dart.as(b, core.int)));
17 } 17 }
18 static hash4(a, b, c, d) { 18 static hash4(a, b, c, d) {
19 return _JenkinsSmiHash.finish(_JenkinsSmiHash.combine(_JenkinsSmiHash.comb ine(_JenkinsSmiHash.combine(_JenkinsSmiHash.combine(0, dart.as(a, core.int)), da rt.as(b, core.int)), dart.as(c, core.int)), dart.as(d, core.int))); 19 return _JenkinsSmiHash.finish(_JenkinsSmiHash.combine(_JenkinsSmiHash.comb ine(_JenkinsSmiHash.combine(_JenkinsSmiHash.combine(0, dart.as(a, core.int)), da rt.as(b, core.int)), dart.as(c, core.int)), dart.as(d, core.int)));
20 } 20 }
21 } 21 }
22 let Point$ = dart.generic(function(T) { 22 let Point$ = dart.generic(function(T) {
23 class Point extends core.Object { 23 class Point extends core.Object {
24 Point(x, y) { 24 Point(x, y) {
25 this.x = x; 25 dart.initField(Point, this, 'x', x);
26 this.y = y; 26 dart.initField(Point, this, 'y', y);
27 } 27 }
28 toString() { 28 toString() {
29 return `Point(${this.x}, ${this.y})`; 29 return `Point(${this.x}, ${this.y})`;
30 } 30 }
31 ['=='](other) { 31 ['=='](other) {
32 if (!dart.is(other, Point)) 32 if (!dart.is(other, Point))
33 return false; 33 return false;
34 return dart.notNull(dart.equals(this.x, dart.dload(other, 'x'))) && dart .notNull(dart.equals(this.y, dart.dload(other, 'y'))); 34 return dart.notNull(dart.equals(this.x, dart.dload(other, 'x'))) && dart .notNull(dart.equals(this.y, dart.dload(other, 'y')));
35 } 35 }
36 get hashCode() { 36 get hashCode() {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 get bottomLeft() { 130 get bottomLeft() {
131 return new (Point$(T))(this.left, dart.as(this.top['+'](this.height), T) ); 131 return new (Point$(T))(this.left, dart.as(this.top['+'](this.height), T) );
132 } 132 }
133 } 133 }
134 return _RectangleBase; 134 return _RectangleBase;
135 }); 135 });
136 let _RectangleBase = _RectangleBase$(); 136 let _RectangleBase = _RectangleBase$();
137 let Rectangle$ = dart.generic(function(T) { 137 let Rectangle$ = dart.generic(function(T) {
138 class Rectangle extends _RectangleBase$(T) { 138 class Rectangle extends _RectangleBase$(T) {
139 Rectangle(left, top, width, height) { 139 Rectangle(left, top, width, height) {
140 this.left = left; 140 dart.initField(Rectangle, this, 'left', left);
141 this.top = top; 141 dart.initField(Rectangle, this, 'top', top);
142 this.width = dart.as(width['<'](0) ? dart.notNull(width['unary-']()) * 0 : width, T); 142 dart.initField(Rectangle, this, 'width', dart.as(width['<'](0) ? dart.no tNull(width['unary-']()) * 0 : width, T));
143 this.height = dart.as(height['<'](0) ? dart.notNull(height['unary-']()) * 0 : height, T); 143 dart.initField(Rectangle, this, 'height', dart.as(height['<'](0) ? dart. notNull(height['unary-']()) * 0 : height, T));
144 super._RectangleBase(); 144 super._RectangleBase();
145 } 145 }
146 fromPoints(a, b) { 146 fromPoints(a, b) {
147 let left = dart.as(min(a.x, b.x), T); 147 let left = dart.as(min(a.x, b.x), T);
148 let width = dart.as(core.num['-'](max(a.x, b.x), left), T); 148 let width = dart.as(core.num['-'](max(a.x, b.x), left), T);
149 let top = dart.as(min(a.y, b.y), T); 149 let top = dart.as(min(a.y, b.y), T);
150 let height = dart.as(core.num['-'](max(a.y, b.y), top), T); 150 let height = dart.as(core.num['-'](max(a.y, b.y), top), T);
151 return new (Rectangle$(T))(left, top, width, height); 151 return new (Rectangle$(T))(left, top, width, height);
152 } 152 }
153 } 153 }
154 dart.defineNamedConstructor(Rectangle, 'fromPoints'); 154 dart.defineNamedConstructor(Rectangle, 'fromPoints');
155 return Rectangle; 155 return Rectangle;
156 }); 156 });
157 let Rectangle = Rectangle$(); 157 let Rectangle = Rectangle$();
158 let _width = Symbol('_width'); 158 let _width = Symbol('_width');
159 let _height = Symbol('_height'); 159 let _height = Symbol('_height');
160 let MutableRectangle$ = dart.generic(function(T) { 160 let MutableRectangle$ = dart.generic(function(T) {
161 class MutableRectangle extends _RectangleBase$(T) { 161 class MutableRectangle extends _RectangleBase$(T) {
162 MutableRectangle(left, top, width, height) { 162 MutableRectangle(left, top, width, height) {
163 this.left = left; 163 dart.initField(MutableRectangle, this, 'left', left);
164 this.top = top; 164 dart.initField(MutableRectangle, this, 'top', top);
165 this[_width] = dart.as(width['<'](0) ? _clampToZero(width) : width, T); 165 this[_width] = dart.as(width['<'](0) ? _clampToZero(width) : width, T);
166 this[_height] = dart.as(height['<'](0) ? _clampToZero(height) : height, T); 166 this[_height] = dart.as(height['<'](0) ? _clampToZero(height) : height, T);
167 super._RectangleBase(); 167 super._RectangleBase();
168 } 168 }
169 fromPoints(a, b) { 169 fromPoints(a, b) {
170 let left = dart.as(min(a.x, b.x), T); 170 let left = dart.as(min(a.x, b.x), T);
171 let width = dart.as(core.num['-'](max(a.x, b.x), left), T); 171 let width = dart.as(core.num['-'](max(a.x, b.x), left), T);
172 let top = dart.as(min(a.y, b.y), T); 172 let top = dart.as(min(a.y, b.y), T);
173 let height = dart.as(core.num['-'](max(a.y, b.y), top), T); 173 let height = dart.as(core.num['-'](max(a.y, b.y), top), T);
174 return new (MutableRectangle$(T))(left, top, width, height); 174 return new (MutableRectangle$(T))(left, top, width, height);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 exports.sin = sin; 449 exports.sin = sin;
450 exports.cos = cos; 450 exports.cos = cos;
451 exports.tan = tan; 451 exports.tan = tan;
452 exports.acos = acos; 452 exports.acos = acos;
453 exports.asin = asin; 453 exports.asin = asin;
454 exports.atan = atan; 454 exports.atan = atan;
455 exports.sqrt = sqrt; 455 exports.sqrt = sqrt;
456 exports.exp = exp; 456 exports.exp = exp;
457 exports.log = log; 457 exports.log = log;
458 })(math || (math = {})); 458 })(math || (math = {}));
OLDNEW
« 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