Bug 805080 - Remove unused CESU8 support from SpiderMonkey; r=luke

We have many CESU8 paths in SpiderMonkey which are completely unused and
untested. We have many more "UTF-8" paths which are really mislabled CESU8 paths
and visa-versa. This patch attempts to disentable all of the various encoding
options in SpiderMonkey.
This commit is contained in:
Terrence Cole
2012-10-29 13:55:17 -07:00
parent f8c815d5b0
commit c11996d4c0
20 changed files with 242 additions and 606 deletions

View File

@@ -319,7 +319,7 @@ js::AtomizeString(JSContext *cx, JSString *str, InternBehavior ib)
}
JSAtom *
js::Atomize(JSContext *cx, const char *bytes, size_t length, InternBehavior ib, FlationCoding fc)
js::Atomize(JSContext *cx, const char *bytes, size_t length, InternBehavior ib)
{
CHECK_REQUEST(cx);
@@ -340,15 +340,12 @@ js::Atomize(JSContext *cx, const char *bytes, size_t length, InternBehavior ib,
const jschar *chars;
OwnCharsBehavior ocb = CopyChars;
if (length < ATOMIZE_BUF_MAX) {
if (fc == CESU8Encoding)
InflateUTF8StringToBuffer(cx, bytes, length, inflated, &inflatedLength, fc);
else
InflateStringToBuffer(cx, bytes, length, inflated, &inflatedLength);
InflateStringToBuffer(cx, bytes, length, inflated, &inflatedLength);
inflated[inflatedLength] = 0;
chars = inflated;
} else {
inflatedLength = length;
chars = InflateString(cx, bytes, &inflatedLength, fc);
chars = InflateString(cx, bytes, &inflatedLength);
if (!chars)
return NULL;
ocb = TakeCharOwnership;