Skip to content

Commit 9acb99f

Browse files
committed
fixup
1 parent 5633ec3 commit 9acb99f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/api/readable.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const assert = require('assert')
66
const { Readable } = require('stream')
77
const { RequestAbortedError, NotSupportedError } = require('../core/errors')
88
const util = require('../core/util')
9-
const { ReadableStreamFrom } = require('../fetch/util')
9+
const { ReadableStreamFrom, toUSVString } = require('../fetch/util')
1010

1111
let Blob
1212

@@ -98,27 +98,27 @@ module.exports = class BodyReadable extends Readable {
9898
}
9999

100100
// 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'))
103103
}
104104

105105
// https://fetch.spec.whatwg.org/#dom-body-json
106-
json () {
106+
async json () {
107107
return consume(this, 'json')
108108
}
109109

110110
// https://fetch.spec.whatwg.org/#dom-body-blob
111-
blob () {
111+
async blob () {
112112
return consume(this, 'blob')
113113
}
114114

115115
// https://fetch.spec.whatwg.org/#dom-body-arraybuffer
116-
arrayBuffer () {
116+
async arrayBuffer () {
117117
return consume(this, 'arrayBuffer')
118118
}
119119

120120
// https://fetch.spec.whatwg.org/#dom-body-formdata
121-
formData () {
121+
async formData () {
122122
// TODO: Implement.
123123
throw new NotSupportedError()
124124
}

0 commit comments

Comments
 (0)