mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 903772: Followup to address missed review comment.
This commit is contained in:
parent
1bfeae4e72
commit
2857dd13fa
@ -88,7 +88,8 @@ TextEncoder::Encode(JSContext* aCx,
|
||||
JSObject* outView = nullptr;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
buf[dstLen] = '\0';
|
||||
outView = CreateUint8Array(aCx, aObj, buf, dstLen);
|
||||
outView = Uint8Array::Create(aCx, aObj, dstLen,
|
||||
reinterpret_cast<uint8_t*>(buf.get()));
|
||||
if (!outView) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
|
@ -100,15 +100,6 @@ public:
|
||||
const bool aStream,
|
||||
ErrorResult& aRv);
|
||||
|
||||
protected:
|
||||
JSObject*
|
||||
CreateUint8Array(JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
char* aBuf, uint32_t aLen) const
|
||||
{
|
||||
return Uint8Array::Create(aCx, aObj, aLen,
|
||||
reinterpret_cast<uint8_t*>(aBuf));
|
||||
}
|
||||
|
||||
private:
|
||||
nsCString mEncoding;
|
||||
nsCOMPtr<nsIUnicodeEncoder> mEncoder;
|
||||
|
Loading…
Reference in New Issue
Block a user