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

Side by Side Diff: lib/runtime/dart/math.js

Issue 1144303003: Use signature inheritance when method types are unchanged (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 var math = dart.defineLibrary(math, {}); 1 var math = dart.defineLibrary(math, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var _js_helper = dart.lazyImport(_js_helper); 3 var _js_helper = dart.lazyImport(_js_helper);
4 (function(exports, core, _js_helper) { 4 (function(exports, core, _js_helper) {
5 'use strict'; 5 'use strict';
6 class _JenkinsSmiHash extends core.Object { 6 class _JenkinsSmiHash extends core.Object {
7 static combine(hash, value) { 7 static combine(hash, value) {
8 hash = 536870911 & dart.notNull(hash) + dart.notNull(value); 8 hash = 536870911 & dart.notNull(hash) + dart.notNull(value);
9 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) << 10); 9 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) << 10);
10 return dart.notNull(hash) ^ dart.notNull(hash) >> 6; 10 return dart.notNull(hash) ^ dart.notNull(hash) >> 6;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 squaredDistanceTo(other) { 70 squaredDistanceTo(other) {
71 dart.as(other, Point$(T)); 71 dart.as(other, Point$(T));
72 let dx = this.x['-'](other.x); 72 let dx = this.x['-'](other.x);
73 let dy = this.y['-'](other.y); 73 let dy = this.y['-'](other.y);
74 return dart.as(dart.notNull(dx) * dart.notNull(dx) + dart.notNull(dy) * dart.notNull(dy), T); 74 return dart.as(dart.notNull(dx) * dart.notNull(dx) + dart.notNull(dy) * dart.notNull(dy), T);
75 } 75 }
76 } 76 }
77 dart.setSignature(Point, { 77 dart.setSignature(Point, {
78 methods: () => ({ 78 methods: () => ({
79 toString: dart.functionType(core.String, []),
80 '==': dart.functionType(core.bool, [dart.dynamic]),
81 '+': dart.functionType(Point$(T), [Point$(T)]), 79 '+': dart.functionType(Point$(T), [Point$(T)]),
82 '-': dart.functionType(Point$(T), [Point$(T)]), 80 '-': dart.functionType(Point$(T), [Point$(T)]),
83 '*': dart.functionType(Point$(T), [core.num]), 81 '*': dart.functionType(Point$(T), [core.num]),
84 distanceTo: dart.functionType(core.double, [Point$(T)]), 82 distanceTo: dart.functionType(core.double, [Point$(T)]),
85 squaredDistanceTo: dart.functionType(T, [Point$(T)]) 83 squaredDistanceTo: dart.functionType(T, [Point$(T)])
86 }) 84 })
87 }); 85 });
88 return Point; 86 return Point;
89 }); 87 });
90 let Point = Point$(); 88 let Point = Point$();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 153 }
156 get bottomRight() { 154 get bottomRight() {
157 return new (Point$(T))(dart.as(this.left['+'](this.width), T), dart.as(t his.top['+'](this.height), T)); 155 return new (Point$(T))(dart.as(this.left['+'](this.width), T), dart.as(t his.top['+'](this.height), T));
158 } 156 }
159 get bottomLeft() { 157 get bottomLeft() {
160 return new (Point$(T))(this.left, dart.as(this.top['+'](this.height), T) ); 158 return new (Point$(T))(this.left, dart.as(this.top['+'](this.height), T) );
161 } 159 }
162 } 160 }
163 dart.setSignature(_RectangleBase, { 161 dart.setSignature(_RectangleBase, {
164 methods: () => ({ 162 methods: () => ({
165 toString: dart.functionType(core.String, []),
166 '==': dart.functionType(core.bool, [dart.dynamic]),
167 intersection: dart.functionType(Rectangle$(T), [Rectangle$(T)]), 163 intersection: dart.functionType(Rectangle$(T), [Rectangle$(T)]),
168 intersects: dart.functionType(core.bool, [Rectangle$(core.num)]), 164 intersects: dart.functionType(core.bool, [Rectangle$(core.num)]),
169 boundingBox: dart.functionType(Rectangle$(T), [Rectangle$(T)]), 165 boundingBox: dart.functionType(Rectangle$(T), [Rectangle$(T)]),
170 containsRectangle: dart.functionType(core.bool, [Rectangle$(core.num)]), 166 containsRectangle: dart.functionType(core.bool, [Rectangle$(core.num)]),
171 containsPoint: dart.functionType(core.bool, [Point$(core.num)]) 167 containsPoint: dart.functionType(core.bool, [Point$(core.num)])
172 }) 168 })
173 }); 169 });
174 return _RectangleBase; 170 return _RectangleBase;
175 }); 171 });
176 let _RectangleBase = _RectangleBase$(); 172 let _RectangleBase = _RectangleBase$();
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 exports.sin = sin; 501 exports.sin = sin;
506 exports.cos = cos; 502 exports.cos = cos;
507 exports.tan = tan; 503 exports.tan = tan;
508 exports.acos = acos; 504 exports.acos = acos;
509 exports.asin = asin; 505 exports.asin = asin;
510 exports.atan = atan; 506 exports.atan = atan;
511 exports.sqrt = sqrt; 507 exports.sqrt = sqrt;
512 exports.exp = exp; 508 exports.exp = exp;
513 exports.log = log; 509 exports.log = log;
514 })(math, core, _js_helper); 510 })(math, core, _js_helper);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698