Bug 906371 - Use off thread JS parsing when loading async scripts, r=bz,billm.

This commit is contained in:
Brian Hackett
2013-09-11 17:42:09 -06:00
parent f3865caf1f
commit 4609048935
16 changed files with 251 additions and 61 deletions

View File

@@ -38,11 +38,10 @@ using mozilla::RangedPtr;
const char *
js::AtomToPrintableString(ExclusiveContext *cx, JSAtom *atom, JSAutoByteString *bytes)
{
// The only uses for this method when running off the main thread are for
// parse errors/warnings, which will not actually be reported in such cases.
if (!cx->isJSContext())
return "";
return js_ValueToPrintable(cx->asJSContext(), StringValue(atom), bytes);
JSString *str = js_QuoteString(cx, atom, 0);
if (!str)
return NULL;
return bytes->encodeLatin1(cx, str);
}
const char * const js::TypeStrings[] = {