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

Side by Side Diff: test/codegen/expect/math/math.js

Issue 959003003: Typecheck constructor initializers properly (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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; 1 var math;
2 (function(math) { 2 (function(math) {
3 'use strict'; 3 'use strict';
4 let E = 2.718281828459045; 4 let E = 2.718281828459045;
5 let LN10 = 2.302585092994046; 5 let LN10 = 2.302585092994046;
6 let LN2 = 0.6931471805599453; 6 let LN2 = 0.6931471805599453;
7 let LOG2E = 1.4426950408889634; 7 let LOG2E = 1.4426950408889634;
8 let LOG10E = 0.4342944819032518; 8 let LOG10E = 0.4342944819032518;
9 let PI = 3.141592653589793; 9 let PI = 3.141592653589793;
10 let SQRT1_2 = 0.7071067811865476; 10 let SQRT1_2 = 0.7071067811865476;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 } 351 }
352 return _RectangleBase; 352 return _RectangleBase;
353 }); 353 });
354 let _RectangleBase = _RectangleBase$(dynamic); 354 let _RectangleBase = _RectangleBase$(dynamic);
355 let Rectangle$ = dart.generic(function(T) { 355 let Rectangle$ = dart.generic(function(T) {
356 class Rectangle extends _RectangleBase$(T) { 356 class Rectangle extends _RectangleBase$(T) {
357 Rectangle(left, top, width, height) { 357 Rectangle(left, top, width, height) {
358 this.left = left; 358 this.left = left;
359 this.top = top; 359 this.top = top;
360 this.width = width['<'](0) ? dart.notNull(dart.throw_("Unimplemented Pre fixExpression: -width")) * 0 : width; 360 this.width = dart.as(width['<'](0) ? dart.notNull(dart.throw_("Unimpleme nted PrefixExpression: -width")) * 0 : width, T);
361 this.height = height['<'](0) ? dart.notNull(dart.throw_("Unimplemented P refixExpression: -height")) * 0 : height; 361 this.height = dart.as(height['<'](0) ? dart.notNull(dart.throw_("Unimple mented PrefixExpression: -height")) * 0 : height, T);
362 super._RectangleBase(); 362 super._RectangleBase();
363 } 363 }
364 Rectangle$fromPoints(a, b) { 364 Rectangle$fromPoints(a, b) {
365 let left = dart.as(min(a.x, b.x), T); 365 let left = dart.as(min(a.x, b.x), T);
366 let width = dart.as(core.num['-'](max(a.x, b.x), left), T); 366 let width = dart.as(core.num['-'](max(a.x, b.x), left), T);
367 let top = dart.as(min(a.y, b.y), T); 367 let top = dart.as(min(a.y, b.y), T);
368 let height = dart.as(core.num['-'](max(a.y, b.y), top), T); 368 let height = dart.as(core.num['-'](max(a.y, b.y), top), T);
369 return new Rectangle(left, top, width, height); 369 return new Rectangle(left, top, width, height);
370 } 370 }
371 } 371 }
372 dart.defineNamedConstructor(Rectangle, 'fromPoints'); 372 dart.defineNamedConstructor(Rectangle, 'fromPoints');
373 return Rectangle; 373 return Rectangle;
374 }); 374 });
375 let Rectangle = Rectangle$(dynamic); 375 let Rectangle = Rectangle$(dynamic);
376 let MutableRectangle$ = dart.generic(function(T) { 376 let MutableRectangle$ = dart.generic(function(T) {
377 class MutableRectangle extends _RectangleBase$(T) { 377 class MutableRectangle extends _RectangleBase$(T) {
378 MutableRectangle(left, top, width, height) { 378 MutableRectangle(left, top, width, height) {
379 this.left = left; 379 this.left = left;
380 this.top = top; 380 this.top = top;
381 this._width = width['<'](0) ? _clampToZero(width) : width; 381 this._width = dart.as(width['<'](0) ? _clampToZero(width) : width, T);
382 this._height = height['<'](0) ? _clampToZero(height) : height; 382 this._height = dart.as(height['<'](0) ? _clampToZero(height) : height, T );
383 super._RectangleBase(); 383 super._RectangleBase();
384 } 384 }
385 MutableRectangle$fromPoints(a, b) { 385 MutableRectangle$fromPoints(a, b) {
386 let left = dart.as(min(a.x, b.x), T); 386 let left = dart.as(min(a.x, b.x), T);
387 let width = dart.as(core.num['-'](max(a.x, b.x), left), T); 387 let width = dart.as(core.num['-'](max(a.x, b.x), left), T);
388 let top = dart.as(min(a.y, b.y), T); 388 let top = dart.as(min(a.y, b.y), T);
389 let height = dart.as(core.num['-'](max(a.y, b.y), top), T); 389 let height = dart.as(core.num['-'](max(a.y, b.y), top), T);
390 return new MutableRectangle(left, top, width, height); 390 return new MutableRectangle(left, top, width, height);
391 } 391 }
392 get width() { 392 get width() {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 math.exp = exp; 438 math.exp = exp;
439 math.log = log; 439 math.log = log;
440 math.Point = Point; 440 math.Point = Point;
441 math.Point$ = Point$; 441 math.Point$ = Point$;
442 math.Random = Random; 442 math.Random = Random;
443 math.Rectangle = Rectangle; 443 math.Rectangle = Rectangle;
444 math.Rectangle$ = Rectangle$; 444 math.Rectangle$ = Rectangle$;
445 math.MutableRectangle = MutableRectangle; 445 math.MutableRectangle = MutableRectangle;
446 math.MutableRectangle$ = MutableRectangle$; 446 math.MutableRectangle$ = MutableRectangle$;
447 })(math || (math = {})); 447 })(math || (math = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698