Bug 1134955. Be more careful with how we stringify property ids for error message reporting. r=jorendorff

This commit is contained in:
Boris Zbarsky
2015-02-20 14:16:26 -05:00
parent f08b19f35b
commit c61ae2f226
7 changed files with 39 additions and 6 deletions

View File

@@ -411,7 +411,8 @@ js::Throw(JSContext *cx, jsid id, unsigned errorNumber)
{
MOZ_ASSERT(js_ErrorFormatString[errorNumber].argCount == 1);
JSString *idstr = IdToString(cx, id);
RootedValue idVal(cx, IdToValue(id));
JSString *idstr = ValueToSource(cx, idVal);
if (!idstr)
return false;
JSAutoByteString bytes(cx, idstr);