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

Unified Diff: lib/runtime/dart/math.js

Issue 1117793002: add checks needed for covariant generics, and List<E> (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 side-by-side diff with in-line comments
Download patch
Index: lib/runtime/dart/math.js
diff --git a/lib/runtime/dart/math.js b/lib/runtime/dart/math.js
index b167cdec406e5d50f9df2dddbcf09536f6d8b1c8..216bc5e3716a77a9aab1f501c299afdc9feadc7b 100644
--- a/lib/runtime/dart/math.js
+++ b/lib/runtime/dart/math.js
@@ -22,6 +22,8 @@ var math;
let Point$ = dart.generic(function(T) {
class Point extends core.Object {
Point(x, y) {
+ dart.as(x, T);
+ dart.as(y, T);
this.x = x;
this.y = y;
}
@@ -137,6 +139,10 @@ var math;
let Rectangle$ = dart.generic(function(T) {
class Rectangle extends _RectangleBase$(T) {
Rectangle(left, top, width, height) {
+ dart.as(left, T);
+ dart.as(top, T);
+ dart.as(width, T);
+ dart.as(height, T);
this.left = left;
this.top = top;
this.width = dart.as(width['<'](0) ? dart.notNull(width['unary-']()) * 0 : width, T);
@@ -160,6 +166,10 @@ var math;
let MutableRectangle$ = dart.generic(function(T) {
class MutableRectangle extends _RectangleBase$(T) {
MutableRectangle(left, top, width, height) {
+ dart.as(left, T);
+ dart.as(top, T);
+ dart.as(width, T);
+ dart.as(height, T);
this.left = left;
this.top = top;
this[_width] = dart.as(width['<'](0) ? _clampToZero(width) : width, T);
@@ -177,6 +187,7 @@ var math;
return this[_width];
}
set width(width) {
+ dart.as(width, T);
if (width['<'](0))
width = dart.as(_clampToZero(width), T);
this[_width] = width;
@@ -185,6 +196,7 @@ var math;
return this[_height];
}
set height(height) {
+ dart.as(height, T);
if (height['<'](0))
height = dart.as(_clampToZero(height), T);
this[_height] = height;

Powered by Google App Engine
This is Rietveld 408576698