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

Unified Diff: sdk/lib/_internal/lib/js_helper.dart

Issue 152633002: Add Capability implementation to dart2js libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove toString, runtimeType. Created 6 years, 10 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/lib/isolate_patch.dart ('k') | tests/isolate/capability_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_helper.dart
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index 54fb1b8fa53e9706981267ed8d75f216bf6b4ac1..fa0fe094db6b318fe3c6071bdc35e7e53c906cb1 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -3038,3 +3038,15 @@ class UnimplementedNoSuchMethodError extends Error
String toString() => "Unsupported operation: $_message";
}
+
+/**
+ * Creates a random number with 64 bits of randomness.
+ *
+ * This will be truncated to the 53 bits available in a double.
+ */
+int random64() {
+ // TODO(lrn): Use a secure random source.
+ int int32a = JS("int", "(Math.random() * 0x100000000) >>> 0");
+ int int32b = JS("int", "(Math.random() * 0x100000000) >>> 0");
+ return int32a + int32b * 0x100000000;
+}
« no previous file with comments | « sdk/lib/_internal/lib/isolate_patch.dart ('k') | tests/isolate/capability_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698