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

Unified Diff: pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart

Issue 2386493003: Fix type errors in math.min() and math.max(). (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/lib/math/math.dart ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart
index fc54f6332d1638b942f2056d8b63d9a2e76c7b5f..73a6723374f22404b79880f8fb09faf0282ba15a 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart
@@ -8,6 +8,14 @@ import 'dart:_js_helper' show patch, checkNum;
import 'dart:typed_data' show ByteData;
@patch
+num/*=T*/ min/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b)
+ => JS('num', r'Math.min(#, #)', checkNum(a), checkNum(b)) as num/*=T*/;
vsm 2016/09/30 19:36:33 Do we actually need the checkNum? Would a null ch
Bob Nystrom 2016/09/30 19:43:14 Good question. I was just following the nearby cod
+
+@patch
+num/*=T*/ max/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b)
+ => JS('num', r'Math.max(#, #)', checkNum(a), checkNum(b)) as num/*=T*/;
+
+@patch
double sqrt(num x)
=> JS('num', r'Math.sqrt(#)', checkNum(x));
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/lib/math/math.dart ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698