Bug 903772: Followup to address missed review comment.

This commit is contained in:
Kyle Huey 2013-08-23 10:29:57 -07:00
parent bc0a143d85
commit 808fa9d830
2 changed files with 2 additions and 10 deletions

View File

@ -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;

View File

@ -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;