Bug 1255795 - use UniqueTwoByteChars in AtomizeUTF8Chars (r=jandem)
authorLuke Wagner <luke@mozilla.com>
Fri, 11 Mar 2016 08:57:51 -0600
changeset 339548 844d73172246061eab0a612454b4be5aefbcb0df
parent 339547 64c69e804a9196fdabab130735ab45c124abbac4
child 339549 2f5f092a64add23c4bb911179a21352046848406
push id12762
push userbmo:rail@mozilla.com
push dateFri, 11 Mar 2016 19:47:45 +0000
reviewersjandem
bugs1255795
milestone48.0a1
Bug 1255795 - use UniqueTwoByteChars in AtomizeUTF8Chars (r=jandem) MozReview-Commit-ID: IjHFnhgyCPH
js/src/jsatom.cpp
--- 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)