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

Side by Side 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 unified diff | 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 »
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 x$ = Symbol('x');
23 let y$ = Symbol('y');
22 let Point$ = dart.generic(function(T) { 24 let Point$ = dart.generic(function(T) {
23 class Point extends core.Object { 25 class Point extends core.Object {
26 get x() {
27 return this[x$];
28 }
29 get y() {
30 return this[y$];
31 }
24 Point(x, y) { 32 Point(x, y) {
25 this.x = x; 33 this[x$] = x;
26 this.y = y; 34 this[y$] = y;
27 } 35 }
28 toString() { 36 toString() {
29 return `Point(${this.x}, ${this.y})`; 37 return `Point(${this.x}, ${this.y})`;
30 } 38 }
31 ['=='](other) { 39 ['=='](other) {
32 if (!dart.is(other, Point)) 40 if (!dart.is(other, Point))
33 return false; 41 return false;
34 return dart.notNull(dart.equals(this.x, dart.dload(other, 'x'))) && dart .notNull(dart.equals(this.y, dart.dload(other, 'y'))); 42 return dart.notNull(dart.equals(this.x, dart.dload(other, 'x'))) && dart .notNull(dart.equals(this.y, dart.dload(other, 'y')));
35 } 43 }
36 get hashCode() { 44 get hashCode() {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 get bottomRight() { 135 get bottomRight() {
128 return new (Point$(T))(dart.as(this.left['+'](this.width), T), dart.as(t his.top['+'](this.height), T)); 136 return new (Point$(T))(dart.as(this.left['+'](this.width), T), dart.as(t his.top['+'](this.height), T));
129 } 137 }
130 get bottomLeft() { 138 get bottomLeft() {
131 return new (Point$(T))(this.left, dart.as(this.top['+'](this.height), T) ); 139 return new (Point$(T))(this.left, dart.as(this.top['+'](this.height), T) );
132 } 140 }
133 } 141 }
134 return _RectangleBase; 142 return _RectangleBase;
135 }); 143 });
136 let _RectangleBase = _RectangleBase$(); 144 let _RectangleBase = _RectangleBase$();
145 let left$ = Symbol('left');
146 let top$ = Symbol('top');
147 let width$ = Symbol('width');
148 let height$ = Symbol('height');
137 let Rectangle$ = dart.generic(function(T) { 149 let Rectangle$ = dart.generic(function(T) {
138 class Rectangle extends _RectangleBase$(T) { 150 class Rectangle extends _RectangleBase$(T) {
151 get left() {
152 return this[left$];
153 }
154 get top() {
155 return this[top$];
156 }
157 get width() {
158 return this[width$];
159 }
160 get height() {
161 return this[height$];
162 }
139 Rectangle(left, top, width, height) { 163 Rectangle(left, top, width, height) {
140 this.left = left; 164 this[left$] = left;
141 this.top = top; 165 this[top$] = top;
142 this.width = dart.as(width['<'](0) ? dart.notNull(width['unary-']()) * 0 : width, T); 166 this[width$] = dart.as(width['<'](0) ? dart.notNull(width['unary-']()) * 0 : width, T);
143 this.height = dart.as(height['<'](0) ? dart.notNull(height['unary-']()) * 0 : height, T); 167 this[height$] = dart.as(height['<'](0) ? dart.notNull(height['unary-']() ) * 0 : height, T);
144 super._RectangleBase(); 168 super._RectangleBase();
145 } 169 }
146 fromPoints(a, b) { 170 fromPoints(a, b) {
147 let left = dart.as(min(a.x, b.x), T); 171 let left = dart.as(min(a.x, b.x), T);
148 let width = dart.as(core.num['-'](max(a.x, b.x), left), T); 172 let width = dart.as(core.num['-'](max(a.x, b.x), left), T);
149 let top = dart.as(min(a.y, b.y), T); 173 let top = dart.as(min(a.y, b.y), T);
150 let height = dart.as(core.num['-'](max(a.y, b.y), top), T); 174 let height = dart.as(core.num['-'](max(a.y, b.y), top), T);
151 return new (Rectangle$(T))(left, top, width, height); 175 return new (Rectangle$(T))(left, top, width, height);
152 } 176 }
153 } 177 }
154 dart.defineNamedConstructor(Rectangle, 'fromPoints'); 178 dart.defineNamedConstructor(Rectangle, 'fromPoints');
155 return Rectangle; 179 return Rectangle;
156 }); 180 });
157 let Rectangle = Rectangle$(); 181 let Rectangle = Rectangle$();
182 let left$0 = Symbol('left');
183 let top$0 = Symbol('top');
158 let _width = Symbol('_width'); 184 let _width = Symbol('_width');
159 let _height = Symbol('_height'); 185 let _height = Symbol('_height');
160 let MutableRectangle$ = dart.generic(function(T) { 186 let MutableRectangle$ = dart.generic(function(T) {
161 class MutableRectangle extends _RectangleBase$(T) { 187 class MutableRectangle extends _RectangleBase$(T) {
188 get left() {
189 return this[left$0];
190 }
191 set left(value) {
192 this[left$0] = value;
193 }
194 get top() {
195 return this[top$0];
196 }
197 set top(value) {
198 this[top$0] = value;
199 }
162 MutableRectangle(left, top, width, height) { 200 MutableRectangle(left, top, width, height) {
163 this.left = left; 201 this[left$0] = left;
164 this.top = top; 202 this[top$0] = top;
165 this[_width] = dart.as(width['<'](0) ? _clampToZero(width) : width, T); 203 this[_width] = dart.as(width['<'](0) ? _clampToZero(width) : width, T);
166 this[_height] = dart.as(height['<'](0) ? _clampToZero(height) : height, T); 204 this[_height] = dart.as(height['<'](0) ? _clampToZero(height) : height, T);
167 super._RectangleBase(); 205 super._RectangleBase();
168 } 206 }
169 fromPoints(a, b) { 207 fromPoints(a, b) {
170 let left = dart.as(min(a.x, b.x), T); 208 let left = dart.as(min(a.x, b.x), T);
171 let width = dart.as(core.num['-'](max(a.x, b.x), left), T); 209 let width = dart.as(core.num['-'](max(a.x, b.x), left), T);
172 let top = dart.as(min(a.y, b.y), T); 210 let top = dart.as(min(a.y, b.y), T);
173 let height = dart.as(core.num['-'](max(a.y, b.y), top), T); 211 let height = dart.as(core.num['-'](max(a.y, b.y), top), T);
174 return new (MutableRectangle$(T))(left, top, width, height); 212 return new (MutableRectangle$(T))(left, top, width, height);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 exports.sin = sin; 487 exports.sin = sin;
450 exports.cos = cos; 488 exports.cos = cos;
451 exports.tan = tan; 489 exports.tan = tan;
452 exports.acos = acos; 490 exports.acos = acos;
453 exports.asin = asin; 491 exports.asin = asin;
454 exports.atan = atan; 492 exports.atan = atan;
455 exports.sqrt = sqrt; 493 exports.sqrt = sqrt;
456 exports.exp = exp; 494 exports.exp = exp;
457 exports.log = log; 495 exports.log = log;
458 })(math || (math = {})); 496 })(math || (math = {}));
OLDNEW
« 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