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

Unified Diff: sdk/lib/_internal/js_runtime/lib/math_patch.dart

Issue 2857133008: dart2js: Improve code quality after min/max changes (Closed)
Patch Set: remove 'as T' to silence dart2js hint' Created 3 years, 7 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 | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/math_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/math_patch.dart b/sdk/lib/_internal/js_runtime/lib/math_patch.dart
index b37ba521b3e5b812409db9007d4274f04a33a1fa..c774c20a02b892825be9ec1613e1086fca65e60e 100644
--- a/sdk/lib/_internal/js_runtime/lib/math_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/math_patch.dart
@@ -8,12 +8,18 @@ import 'dart:_js_helper' show patch, checkNum;
import 'dart:typed_data' show ByteData;
@patch
-T min<T extends num>(T a, T b) =>
- JS('num', r'Math.min(#, #)', checkNum(a), checkNum(b)) as T;
+T min<T extends num>(T a, T b) => JS(
+ 'returns:num;depends:none;effects:none;gvn:true',
+ r'Math.min(#, #)',
+ checkNum(a),
+ checkNum(b));
@patch
-T max<T extends num>(T a, T b) =>
- JS('num', r'Math.max(#, #)', checkNum(a), checkNum(b)) as T;
+T max<T extends num>(T a, T b) => JS(
+ 'returns:num;depends:none;effects:none;gvn:true',
+ r'Math.max(#, #)',
+ checkNum(a),
+ checkNum(b));
@patch
double sqrt(num x) => JS('num', r'Math.sqrt(#)', checkNum(x));
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698