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

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

Issue 1633003002: Add --modules=node support (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: regen sdk and expectations Created 4 years, 11 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 dart_library.library('dart/math', null, /* Imports */[ 1 dart_library.library('dart/math', null, /* Imports */[
2 'dart/_runtime', 2 'dart/_runtime',
3 'dart/core' 3 'dart/core'
4 ], /* Lazy imports */[ 4 ], /* Lazy imports */[
5 'dart/_js_helper' 5 'dart/_js_helper'
6 ], function(exports, dart, core, _js_helper) { 6 ], function(exports, dart, core, _js_helper) {
7 'use strict'; 7 'use strict';
8 let dartx = dart.dartx; 8 let dartx = dart.dartx;
9 class _JenkinsSmiHash extends core.Object { 9 class _JenkinsSmiHash extends core.Object {
10 static combine(hash, value) { 10 static combine(hash, value) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 methods: () => ({ 81 methods: () => ({
82 '+': [Point$(T), [Point$(T)]], 82 '+': [Point$(T), [Point$(T)]],
83 '-': [Point$(T), [Point$(T)]], 83 '-': [Point$(T), [Point$(T)]],
84 '*': [Point$(T), [core.num]], 84 '*': [Point$(T), [core.num]],
85 distanceTo: [core.double, [Point$(T)]], 85 distanceTo: [core.double, [Point$(T)]],
86 squaredDistanceTo: [T, [Point$(T)]] 86 squaredDistanceTo: [T, [Point$(T)]]
87 }) 87 })
88 }); 88 });
89 return Point; 89 return Point;
90 }); 90 });
91 let Point = Point$(); 91 const Point = Point$();
92 class Random extends core.Object { 92 class Random extends core.Object {
93 static new(seed) { 93 static new(seed) {
94 if (seed === void 0) seed = null; 94 if (seed === void 0) seed = null;
95 return seed == null ? dart.const(new _JSRandom()) : new _Random(seed); 95 return seed == null ? dart.const(new _JSRandom()) : new _Random(seed);
96 } 96 }
97 } 97 }
98 dart.setSignature(Random, { 98 dart.setSignature(Random, {
99 constructors: () => ({new: [Random, [], [core.int]]}) 99 constructors: () => ({new: [Random, [], [core.int]]})
100 }); 100 });
101 const _RectangleBase$ = dart.generic(function(T) { 101 const _RectangleBase$ = dart.generic(function(T) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 methods: () => ({ 166 methods: () => ({
167 intersection: [Rectangle$(T), [Rectangle$(T)]], 167 intersection: [Rectangle$(T), [Rectangle$(T)]],
168 intersects: [core.bool, [Rectangle$(core.num)]], 168 intersects: [core.bool, [Rectangle$(core.num)]],
169 boundingBox: [Rectangle$(T), [Rectangle$(T)]], 169 boundingBox: [Rectangle$(T), [Rectangle$(T)]],
170 containsRectangle: [core.bool, [Rectangle$(core.num)]], 170 containsRectangle: [core.bool, [Rectangle$(core.num)]],
171 containsPoint: [core.bool, [Point$(core.num)]] 171 containsPoint: [core.bool, [Point$(core.num)]]
172 }) 172 })
173 }); 173 });
174 return _RectangleBase; 174 return _RectangleBase;
175 }); 175 });
176 let _RectangleBase = _RectangleBase$(); 176 const _RectangleBase = _RectangleBase$();
177 const Rectangle$ = dart.generic(function(T) { 177 const Rectangle$ = dart.generic(function(T) {
178 class Rectangle extends _RectangleBase$(T) { 178 class Rectangle extends _RectangleBase$(T) {
179 Rectangle(left, top, width, height) { 179 Rectangle(left, top, width, height) {
180 this.left = left; 180 this.left = left;
181 this.top = top; 181 this.top = top;
182 this.width = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width; 182 this.width = dart.notNull(width) < 0 ? -dart.notNull(width) * 0 : width;
183 this.height = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : hei ght; 183 this.height = dart.notNull(height) < 0 ? -dart.notNull(height) * 0 : hei ght;
184 super._RectangleBase(); 184 super._RectangleBase();
185 } 185 }
186 static fromPoints(a, b) { 186 static fromPoints(a, b) {
187 let left = min(a.x, b.x); 187 let left = min(a.x, b.x);
188 let width = dart.notNull(max(a.x, b.x)) - dart.notNull(left); 188 let width = dart.notNull(max(a.x, b.x)) - dart.notNull(left);
189 let top = min(a.y, b.y); 189 let top = min(a.y, b.y);
190 let height = dart.notNull(max(a.y, b.y)) - dart.notNull(top); 190 let height = dart.notNull(max(a.y, b.y)) - dart.notNull(top);
191 return new (Rectangle$(T))(left, top, width, height); 191 return new (Rectangle$(T))(left, top, width, height);
192 } 192 }
193 } 193 }
194 dart.setSignature(Rectangle, { 194 dart.setSignature(Rectangle, {
195 constructors: () => ({ 195 constructors: () => ({
196 Rectangle: [Rectangle$(T), [T, T, T, T]], 196 Rectangle: [Rectangle$(T), [T, T, T, T]],
197 fromPoints: [Rectangle$(T), [Point$(T), Point$(T)]] 197 fromPoints: [Rectangle$(T), [Point$(T), Point$(T)]]
198 }) 198 })
199 }); 199 });
200 return Rectangle; 200 return Rectangle;
201 }); 201 });
202 let Rectangle = Rectangle$(); 202 const Rectangle = Rectangle$();
203 const _width = Symbol('_width'); 203 const _width = Symbol('_width');
204 const _height = Symbol('_height'); 204 const _height = Symbol('_height');
205 const MutableRectangle$ = dart.generic(function(T) { 205 const MutableRectangle$ = dart.generic(function(T) {
206 class MutableRectangle extends _RectangleBase$(T) { 206 class MutableRectangle extends _RectangleBase$(T) {
207 MutableRectangle(left, top, width, height) { 207 MutableRectangle(left, top, width, height) {
208 this.left = left; 208 this.left = left;
209 this.top = top; 209 this.top = top;
210 this[_width] = dart.notNull(width) < 0 ? _clampToZero(width) : width; 210 this[_width] = dart.notNull(width) < 0 ? _clampToZero(width) : width;
211 this[_height] = dart.notNull(height) < 0 ? _clampToZero(height) : height ; 211 this[_height] = dart.notNull(height) < 0 ? _clampToZero(height) : height ;
212 super._RectangleBase(); 212 super._RectangleBase();
(...skipping 24 matching lines...) Expand all
237 } 237 }
238 MutableRectangle[dart.implements] = () => [Rectangle$(T)]; 238 MutableRectangle[dart.implements] = () => [Rectangle$(T)];
239 dart.setSignature(MutableRectangle, { 239 dart.setSignature(MutableRectangle, {
240 constructors: () => ({ 240 constructors: () => ({
241 MutableRectangle: [MutableRectangle$(T), [T, T, T, T]], 241 MutableRectangle: [MutableRectangle$(T), [T, T, T, T]],
242 fromPoints: [MutableRectangle$(T), [Point$(T), Point$(T)]] 242 fromPoints: [MutableRectangle$(T), [Point$(T), Point$(T)]]
243 }) 243 })
244 }); 244 });
245 return MutableRectangle; 245 return MutableRectangle;
246 }); 246 });
247 let MutableRectangle = MutableRectangle$(); 247 const MutableRectangle = MutableRectangle$();
248 function _clampToZero(value) { 248 function _clampToZero(value) {
249 dart.assert(dart.notNull(value) < 0); 249 dart.assert(dart.notNull(value) < 0);
250 return -dart.notNull(value) * 0; 250 return -dart.notNull(value) * 0;
251 } 251 }
252 dart.fn(_clampToZero, core.num, [core.num]); 252 dart.fn(_clampToZero, core.num, [core.num]);
253 const E = 2.718281828459045; 253 const E = 2.718281828459045;
254 const LN10 = 2.302585092994046; 254 const LN10 = 2.302585092994046;
255 const LN2 = 0.6931471805599453; 255 const LN2 = 0.6931471805599453;
256 const LOG2E = 1.4426950408889634; 256 const LOG2E = 1.4426950408889634;
257 const LOG10E = 0.4342944819032518; 257 const LOG10E = 0.4342944819032518;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 exports.sin = sin; 502 exports.sin = sin;
503 exports.cos = cos; 503 exports.cos = cos;
504 exports.tan = tan; 504 exports.tan = tan;
505 exports.acos = acos; 505 exports.acos = acos;
506 exports.asin = asin; 506 exports.asin = asin;
507 exports.atan = atan; 507 exports.atan = atan;
508 exports.sqrt = sqrt; 508 exports.sqrt = sqrt;
509 exports.exp = exp; 509 exports.exp = exp;
510 exports.log = log; 510 exports.log = log;
511 }); 511 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698