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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_number.dart

Issue 1079253002: Use native behavior for dead code elimination (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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: sdk/lib/_internal/compiler/js_lib/js_number.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_number.dart b/sdk/lib/_internal/compiler/js_lib/js_number.dart
index c1357e02f73026ea9207f32b86a29d26cc44d01b..8ea8a0326c694c326f07ceb8922073e3331b887b 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_number.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_number.dart
@@ -57,7 +57,8 @@ class JSNumber extends Interceptor implements num {
return JS('num', r'# % #', this, b);
}
- num abs() => JS('num', r'Math.abs(#)', this);
+ num abs() => JS('returns:num;effects:none;depends:none;throws:never',
+ r'Math.abs(#)', this);
num get sign => this > 0 ? 1 : this < 0 ? -1 : this;

Powered by Google App Engine
This is Rietveld 408576698