Bug 1234177 - check to see if mFunctions.append returned error. r=bholley

DONTBUILD because this is a backout/reland to fix author info.
This commit is contained in:
Bogdan Postelnicu 2015-12-24 14:14:43 -05:00
parent 2665fa7036
commit da7b175556

View File

@ -205,7 +205,8 @@ public:
if (JS::IsCallable(aObj)) {
if (mOptions->cloneFunctions) {
mFunctions.append(aObj);
if (!mFunctions.append(aObj))
return false;
return JS_WriteUint32Pair(aWriter, SCTAG_FUNCTION, mFunctions.length() - 1);
} else {
JS_ReportError(aCx, "Permission denied to pass a Function via structured clone");