diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-07-05 22:16:19 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-07-05 22:16:19 -0600 |
commit | c0222628264423a67bf98775be83dcf2f85211ab (patch) | |
tree | bd789c3ab25d19c918e7a5a6181719a39625e1b1 /components/script/dom/bindings/error.rs | |
parent | cc73aad447f0455606a5a6005d31aa55334668a8 (diff) | |
parent | 92874a89d260bf4f17849ed93bddfe5a70cd312a (diff) | |
download | servo-c0222628264423a67bf98775be83dcf2f85211ab.tar.gz servo-c0222628264423a67bf98775be83dcf2f85211ab.zip |
Auto merge of #6505 - ttaubert:issue/4666-crypto-getRandomValues, r=Ms2ger
Implement crypto.getRandomValues()
Didn't touch mozjs or rust-mozjs because implementing that in the code generator didn't seem too easy. I'm using the same workaround that the TextDecoder does.
Using the OsRng should be the right choice here? As the OS keeps state for us we wouldn't need to have a global rng instance to keep around.
Fixes #4666.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6505)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r-- | components/script/dom/bindings/error.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index 9c0567067db..373c6c7cbe0 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -62,6 +62,10 @@ pub enum Error { DataClone, /// NoModificationAllowedError DOMException NoModificationAllowed, + /// QuotaExceededError DOMException + QuotaExceeded, + /// TypeMismatchError DOMException + TypeMismatch, /// TypeError JavaScript Error Type(DOMString), @@ -101,6 +105,8 @@ pub fn throw_dom_exception(cx: *mut JSContext, global: GlobalRef, Error::InvalidNodeType => DOMErrorName::InvalidNodeTypeError, Error::DataClone => DOMErrorName::DataCloneError, Error::NoModificationAllowed => DOMErrorName::NoModificationAllowedError, + Error::QuotaExceeded => DOMErrorName::QuotaExceededError, + Error::TypeMismatch => DOMErrorName::TypeMismatchError, Error::Type(message) => { assert!(unsafe { JS_IsExceptionPending(cx) } == 0); throw_type_error(cx, &message); |