@@ -711,6 +711,30 @@ class Request {
711
711
return this [ kSignal ]
712
712
}
713
713
714
+ get body ( ) {
715
+ if ( ! this || ! this [ kState ] ) {
716
+ throw new TypeError ( 'Illegal invocation' )
717
+ }
718
+
719
+ return this [ kState ] . body ? this [ kState ] . body . stream : null
720
+ }
721
+
722
+ get bodyUsed ( ) {
723
+ if ( ! this || ! this [ kState ] ) {
724
+ throw new TypeError ( 'Illegal invocation' )
725
+ }
726
+
727
+ return ! ! this [ kState ] . body && util . isDisturbed ( this [ kState ] . body . stream )
728
+ }
729
+
730
+ get duplex ( ) {
731
+ if ( ! ( this instanceof Request ) ) {
732
+ throw new TypeError ( 'Illegal invocation' )
733
+ }
734
+
735
+ return 'half'
736
+ }
737
+
714
738
// Returns a clone of request.
715
739
clone ( ) {
716
740
if ( ! ( this instanceof Request ) ) {
@@ -828,16 +852,20 @@ Object.defineProperties(Request.prototype, {
828
852
redirect : kEnumerableProperty ,
829
853
clone : kEnumerableProperty ,
830
854
signal : kEnumerableProperty ,
831
- duplex : {
832
- ...kEnumerableProperty ,
833
- get ( ) {
834
- // The duplex getter steps are to return "half".
835
- return 'half'
836
- } ,
837
- set ( ) {
838
-
839
- }
840
- }
855
+ duplex : kEnumerableProperty ,
856
+ destination : kEnumerableProperty ,
857
+ body : kEnumerableProperty ,
858
+ bodyUsed : kEnumerableProperty ,
859
+ isHistoryNavigation : kEnumerableProperty ,
860
+ isReloadNavigation : kEnumerableProperty ,
861
+ keepalive : kEnumerableProperty ,
862
+ integrity : kEnumerableProperty ,
863
+ cache : kEnumerableProperty ,
864
+ credentials : kEnumerableProperty ,
865
+ attribute : kEnumerableProperty ,
866
+ referrerPolicy : kEnumerableProperty ,
867
+ referrer : kEnumerableProperty ,
868
+ mode : kEnumerableProperty
841
869
} )
842
870
843
871
webidl . converters . Request = webidl . interfaceConverter (
0 commit comments