diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index bd49055c527f..2fac0dc650b1 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -451,6 +451,8 @@ CloneNonReflectors(JSContext *cx, MutableHandleValue val) Maybe ac; if (val.isObject()) { ac.construct(cx, &val.toObject()); + } else if (val.isString() && !JS_WrapValue(cx, val)) { + return false; } if (!buffer.write(cx, val,