- From: PhistucK <notifications@github.com>
- Date: Sun, 20 Dec 2015 11:39:05 -0800
- To: whatwg/encoding <encoding@noreply.github.com>
- Message-ID: <whatwg/encoding/issues/24@github.com>
https://encoding.spec.whatwg.org/#textdecoder - ``` USVString decode(optional BufferSource input, optional TextDecodeOptions options); ``` The BufferSource type is not specified anywhere. ClosureCompiler insists it is Uint8Array - http://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D%253DClosureCompiler%253D%253D%250A%252F%252F%2520%2540output_file_name%2520default.js%250A%252F%252F%2520%2540compilation_level%2520ADVANCED_OPTIMIZATIONS%250A%252F%252F%2520%2540language%2520ECMASCRIPT6_STRICT%250A%252F%252F%2520%2540language_out%2520ECMASCRIPT5_STRICT%250A%252F%252F%2520%2540formatting%2520pretty_print%250A%252F%252F%2520%253D%253D%252FClosureCompiler%253D%253D%250A%2522use%2520strict%2522%253B%250Aclass%2520Foo%250A%257B%250A%2520constructor()%2520%257B%2520fetch(%2522url%2522).then(response%2520%253D%253E%2520response.arrayBuffer()).then(this.bar)%253B%2520%257D%250A%2520%252F**%2520%2540this%2520undefined%2520%2540param%2520%257BArrayBuffer%257D%2520arrayBuffer%2520*%252F%250A%2520bar(arrayBuffer)%2520%257B%2520console.log(new%2520TextDecoder(%2522utf-8%2522).decode(arrayBuffer))%2520%257D%250A%257D%250A%250Anew%2520Foo()%253B MDN says it is an ArrayBufferView - https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/decode#Parameters This should be specified. Perhaps http://heycam.github.io/webidl/#common-BufferSource (see https://github.com/whatwg/fetch/issues/108). --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/encoding/issues/24
Received on Sunday, 20 December 2015 19:39:34 UTC