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

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

Issue 1398453004: Add a 'secure' constructor to Random in dart:math returning a cryptographically (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix comments Created 5 years, 2 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/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 34476f24d8a78c21d3e4f119810c6c1226925a96..2ca6d07125f726114dfd2cc84b5aae7ed205920c 100644
--- a/sdk/lib/_internal/js_runtime/lib/math_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/math_patch.dart
@@ -60,6 +60,11 @@ class Random {
@patch
factory Random([int seed]) =>
(seed == null) ? const _JSRandom() : new _Random(seed);
+
+ @patch
+ factory Random.secure() {
+ throw new UnsupportedError("Unsupported secure random generator");
Lasse Reichstein Nielsen 2015/10/14 11:08:45 No need to write "unsupported" in the message too,
regis 2015/10/14 20:22:35 Done. I used the message you suggested for the VM:
+ }
}
class _JSRandom implements Random {

Powered by Google App Engine
This is Rietveld 408576698