use optimized path for fromCharCode

This commit is contained in:
2008-07-31 12:22:48 -07:00
parent 233c8f1aa7
commit 7385e4e777

View File

@@ -209,8 +209,8 @@ builtin_String_fromCharCode(JSContext* cx, jsint i)
{
jschar c = (jschar)i;
/* XXX check for string freelist space */
/* XXX refactor js_GetUnitString so we can call it with a jschar */
/* (also in js_str_fromCharCode!) */
if (c < UNIT_STRING_LIMIT)
return js_GetUnitStringForChar(cx, c);
return js_NewStringCopyN(cx, &c, 1);
}