Bug 1028866 part 5 - Make NewString deflate to Latin1 if Latin1 strings are enabled and add NewStringDontDeflate. r=luke
This commit is contained in:
@@ -480,6 +480,11 @@ js::Atomize(ExclusiveContext *cx, const char *bytes, size_t length, InternBehavi
|
||||
if (!JSString::validateLength(cx, length))
|
||||
return nullptr;
|
||||
|
||||
if (EnableLatin1Strings) {
|
||||
const Latin1Char *chars = reinterpret_cast<const Latin1Char*>(bytes);
|
||||
return AtomizeAndCopyChars(cx, chars, length, ib);
|
||||
}
|
||||
|
||||
static const unsigned ATOMIZE_BUF_MAX = 32;
|
||||
if (length < ATOMIZE_BUF_MAX) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user