Bug 1255795 - use UniqueTwoByteChars in AtomizeUTF8Chars (r=jandem)
MozReview-Commit-ID: IjHFnhgyCPH
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -432,17 +432,17 @@ js::AtomizeUTF8Chars(JSContext* cx, cons
{
// This could be optimized to hand the char16_t's directly to the JSAtom
// instead of making a copy. UTF8CharsToNewTwoByteCharsZ should be
// refactored to take an ExclusiveContext so that this function could also.
UTF8Chars utf8(utf8Chars, utf8ByteLength);
size_t length;
- UniquePtr<char16_t> chars(JS::UTF8CharsToNewTwoByteCharsZ(cx, utf8, &length).get());
+ UniqueTwoByteChars chars(JS::UTF8CharsToNewTwoByteCharsZ(cx, utf8, &length).get());
if (!chars)
return nullptr;
return AtomizeChars(cx, chars.get(), length);
}
bool
js::IndexToIdSlow(ExclusiveContext* cx, uint32_t index, MutableHandleId idp)