Bug 792001 followup - Pass jschar to hasUnit/getUnit. r=pierron on IRC

This commit is contained in:
Jan de Mooij 2012-09-18 17:04:45 +02:00
parent fcd86f137d
commit 4f82ddcd0a

View File

@ -332,12 +332,11 @@ ArrayShiftDense(JSContext *cx, HandleObject obj, MutableHandleValue rval)
JSFixedString * JSFixedString *
StringFromCharCode(JSContext *cx, int32_t code) StringFromCharCode(JSContext *cx, int32_t code)
{ {
code = uint16_t(code);
if (StaticStrings::hasUnit(code))
return cx->runtime->staticStrings.getUnit(code);
jschar c = jschar(code); jschar c = jschar(code);
if (StaticStrings::hasUnit(c))
return cx->runtime->staticStrings.getUnit(c);
return js_NewStringCopyN(cx, &c, 1); return js_NewStringCopyN(cx, &c, 1);
} }