Bug 797806 - Helper method to handle stringified JSON in C++, part2, r=khuey

This commit is contained in:
Olli Pettay 2012-10-16 18:37:44 +03:00
parent 4a3f200675
commit c3acd4988e
2 changed files with 3 additions and 3 deletions

View File

@ -751,6 +751,9 @@ MainThreadDictionaryBase::ParseJSON(const nsAString& aJSON,
JSObject* global = JS_GetGlobalObject(cx);
aAr.construct(cx);
aAc.construct(cx, global);
if (aJSON.IsEmpty()) {
return cx;
}
if (!JS_ParseJSON(cx,
static_cast<const jschar*>(PromiseFlatString(aJSON).get()),
aJSON.Length(), &aVal)) {

View File

@ -5405,9 +5405,6 @@ class CGDictionary(CGThing):
" \n" +
(" bool Init(const nsAString& aJSON)\n"
" {\n"
" if (aJSON.IsEmpty()) {\n"
" return true;\n"
" }\n"
" mozilla::Maybe<JSAutoRequest> ar;\n"
" mozilla::Maybe<JSAutoCompartment> ac;\n"
" jsval json = JSVAL_VOID;\n"