File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const assert = require('assert')
6
6
const { Readable } = require ( 'stream' )
7
7
const { RequestAbortedError, NotSupportedError } = require ( '../core/errors' )
8
8
const util = require ( '../core/util' )
9
- const { ReadableStreamFrom } = require ( '../fetch/util' )
9
+ const { ReadableStreamFrom, toUSVString } = require ( '../fetch/util' )
10
10
11
11
let Blob
12
12
@@ -98,27 +98,27 @@ module.exports = class BodyReadable extends Readable {
98
98
}
99
99
100
100
// https://fetch.spec.whatwg.org/#dom-body-text
101
- text ( ) {
102
- return consume ( this , 'text' )
101
+ async text ( ) {
102
+ return toUSVString ( await consume ( this , 'text' ) )
103
103
}
104
104
105
105
// https://fetch.spec.whatwg.org/#dom-body-json
106
- json ( ) {
106
+ async json ( ) {
107
107
return consume ( this , 'json' )
108
108
}
109
109
110
110
// https://fetch.spec.whatwg.org/#dom-body-blob
111
- blob ( ) {
111
+ async blob ( ) {
112
112
return consume ( this , 'blob' )
113
113
}
114
114
115
115
// https://fetch.spec.whatwg.org/#dom-body-arraybuffer
116
- arrayBuffer ( ) {
116
+ async arrayBuffer ( ) {
117
117
return consume ( this , 'arrayBuffer' )
118
118
}
119
119
120
120
// https://fetch.spec.whatwg.org/#dom-body-formdata
121
- formData ( ) {
121
+ async formData ( ) {
122
122
// TODO: Implement.
123
123
throw new NotSupportedError ( )
124
124
}
You can’t perform that action at this time.
0 commit comments