From 2d3497d143a9dedd25da107f0a2043e69fee57cf Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Thu, 5 Dec 2024 18:57:57 +0900 Subject: [PATCH] remove: Remove kIsWasm --- lib/src/crypto_subtle.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/src/crypto_subtle.dart b/lib/src/crypto_subtle.dart index 951fdb2f..9dc3df70 100644 --- a/lib/src/crypto_subtle.dart +++ b/lib/src/crypto_subtle.dart @@ -19,7 +19,6 @@ library common; import 'dart:js_interop'; import 'dart:typed_data'; -import 'package:flutter/foundation.dart' show kIsWasm; import 'package:meta/meta.dart'; import 'jsonwebkey.dart' show JsonWebKey, RsaOtherPrimesInfo; @@ -339,37 +338,37 @@ TypedData getRandomValues(TypedData array) { if (array is Uint8List) { final values = array.toJS; window.crypto.getRandomValues(values); - if (kIsWasm) { + if (array != values.toDart) { array.setAll(0, values.toDart); } } else if (array is Uint16List) { final values = array.toJS; window.crypto.getRandomValues(values); - if (kIsWasm) { + if (array != values.toDart) { array.setAll(0, values.toDart); } } else if (array is Uint32List) { final values = array.toJS; window.crypto.getRandomValues(values); - if (kIsWasm) { + if (array != values.toDart) { array.setAll(0, values.toDart); } } else if (array is Int8List) { final values = array.toJS; window.crypto.getRandomValues(values); - if (kIsWasm) { + if (array != values.toDart) { array.setAll(0, values.toDart); } } else if (array is Int16List) { final values = array.toJS; window.crypto.getRandomValues(values); - if (kIsWasm) { + if (array != values.toDart) { array.setAll(0, values.toDart); } } else if (array is Int32List) { final values = array.toJS; window.crypto.getRandomValues(values); - if (kIsWasm) { + if (array != values.toDart) { array.setAll(0, values.toDart); } } else {