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

Unified Diff: pkg/dev_compiler/lib/js/amd/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 2386493003: Fix type errors in math.min() and math.max(). (Closed)
Patch Set: Created 4 years, 2 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:
Download patch
Index: pkg/dev_compiler/lib/js/amd/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/amd/dart_sdk.js b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
index e4a67c26bd3d64297c153af27d08769e1f7d61b5..8ddad9c8eeb24fa4d0378328e7b23ee690dc78ed 100644
--- a/pkg/dev_compiler/lib/js/amd/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
@@ -36958,40 +36958,13 @@ define([], function() {
math.SQRT2 = 1.4142135623730951;
math.min = function(T) {
return (a, b) => {
- if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
- if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
- if (dart.notNull(a) > dart.notNull(b)) return b;
- if (dart.notNull(a) < dart.notNull(b)) return a;
- if (typeof b == 'number') {
- if (typeof a == 'number') {
- if (a == 0.0) {
- return (dart.notNull(a) + dart.notNull(b)) * dart.notNull(a) * dart.notNull(b);
- }
- }
- if (a == 0 && dart.test(b[dartx.isNegative]) || dart.test(b[dartx.isNaN])) return b;
- return a;
- }
- return a;
+ return Math.min(_js_helper.checkNum(a), _js_helper.checkNum(b));
};
};
dart.fn(math.min, TAndTToT());
math.max = function(T) {
return (a, b) => {
- if (!(typeof a == 'number')) dart.throw(new core.ArgumentError(a));
- if (!(typeof b == 'number')) dart.throw(new core.ArgumentError(b));
- if (dart.notNull(a) > dart.notNull(b)) return a;
- if (dart.notNull(a) < dart.notNull(b)) return b;
- if (typeof b == 'number') {
- if (typeof a == 'number') {
- if (a == 0.0) {
- return dart.notNull(a) + dart.notNull(b);
- }
- }
- if (dart.test(b[dartx.isNaN])) return b;
- return a;
- }
- if (b == 0 && dart.test(a[dartx.isNegative])) return b;
- return a;
+ return Math.max(_js_helper.checkNum(a), _js_helper.checkNum(b));
};
};
dart.fn(math.max, TAndTToT$());
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/js/common/dart_sdk.js » ('j') | pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698