This repository was archived by the owner on Nov 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -654,3 +654,22 @@ impl ToJSValConvertible for Heap<*mut JSObject> {
654
654
maybe_wrap_object_or_null_value ( cx, rval) ;
655
655
}
656
656
}
657
+
658
+ // https://heycam.github.io/webidl/#es-object
659
+ impl FromJSValConvertible for * mut JSObject {
660
+ type Config = ( ) ;
661
+ #[ inline]
662
+ unsafe fn from_jsval ( cx : * mut JSContext ,
663
+ value : HandleValue ,
664
+ _option : ( ) )
665
+ -> Result < ConversionResult < * mut JSObject > , ( ) > {
666
+ if !value. is_object ( ) {
667
+ throw_type_error ( cx, "value is not an object" ) ;
668
+ return Err ( ( ) ) ;
669
+ }
670
+
671
+ AssertSameCompartment ( cx, value. to_object ( ) ) ;
672
+
673
+ Ok ( ConversionResult :: Success ( value. to_object ( ) ) )
674
+ }
675
+ }
Original file line number Diff line number Diff line change @@ -593,7 +593,7 @@ impl<T: CustomTrace> CustomAutoRooter<T> {
593
593
/// The underlying data can be accessed through this guard via its Deref and
594
594
/// DerefMut implementations.
595
595
/// This structure is created by `root` method on `CustomAutoRooter` or
596
- /// by an appropriate macro (e.g. `rooted_vec !` for `SequenceRooter` alias) .
596
+ /// by the `auto_root !` macro .
597
597
pub struct CustomAutoRooterGuard < ' a , T : ' a + CustomTrace > {
598
598
rooter : & ' a mut CustomAutoRooter < T >
599
599
}
You can’t perform that action at this time.
0 commit comments