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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/math_patch.dart

Issue 16538002: Move lib from sdk/lib/_internal/compiler/implementation to _internal root. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/implementation/lib/math_patch.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/lib/math_patch.dart (revision 23664)
+++ sdk/lib/_internal/compiler/implementation/lib/math_patch.dart (working copy)
@@ -1,68 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Patch file for dart:math library.
-import 'dart:_foreign_helper' show JS;
-
-patch double sqrt(num x)
- => JS('double', r'Math.sqrt(#)', checkNum(x));
-
-patch double sin(num x)
- => JS('double', r'Math.sin(#)', checkNum(x));
-
-patch double cos(num x)
- => JS('double', r'Math.cos(#)', checkNum(x));
-
-patch double tan(num x)
- => JS('double', r'Math.tan(#)', checkNum(x));
-
-patch double acos(num x)
- => JS('double', r'Math.acos(#)', checkNum(x));
-
-patch double asin(num x)
- => JS('double', r'Math.asin(#)', checkNum(x));
-
-patch double atan(num x)
- => JS('double', r'Math.atan(#)', checkNum(x));
-
-patch double atan2(num a, num b)
- => JS('double', r'Math.atan2(#, #)', checkNum(a), checkNum(b));
-
-patch double exp(num x)
- => JS('double', r'Math.exp(#)', checkNum(x));
-
-patch double log(num x)
- => JS('double', r'Math.log(#)', checkNum(x));
-
-patch num pow(num x, num exponent) {
- checkNum(x);
- checkNum(exponent);
- return JS('num', r'Math.pow(#, #)', x, exponent);
-}
-
-patch class Random {
- patch factory Random([int seed]) => const _Random();
-}
-
-class _Random implements Random {
- // The Dart2JS implementation of Random doesn't use a seed.
- const _Random();
-
- int nextInt(int max) {
- if (max < 0) throw new ArgumentError("negative max: $max");
- if (max > 0xFFFFFFFF) max = 0xFFFFFFFF;
- return JS("int", "(Math.random() * #) >>> 0", max);
- }
-
- /**
- * Generates a positive random floating point value uniformly distributed on
- * the range from 0.0, inclusive, to 1.0, exclusive.
- */
- double nextDouble() => JS("double", "Math.random()");
-
- /**
- * Generates a random boolean value.
- */
- bool nextBool() => JS("bool", "Math.random() < 0.5");
-}

Powered by Google App Engine
This is Rietveld 408576698