Skip to content

Commit 89312b3

Browse files
committed
Avoid forcing evaluation of crypto
Having `val crypto` in the package object means that when it's undefined an exception is thrown immediately, which makes it impossible to use the WebCrypto facade in such a case. An example situation where this is preventative is using the WebCrypto API from Node where its available as a library and not globally available.
1 parent 5a502ad commit 89312b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/org/scalajs/dom/crypto/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import scala.scalajs.js.|
77
import scala.language.implicitConversions
88

99
package object crypto {
10-
val crypto = GlobalCrypto.crypto
10+
@inline def crypto = GlobalCrypto.crypto
1111

1212
type BigInteger = Uint8Array
1313

0 commit comments

Comments
 (0)