Bug 1021312 - Wrap strings in CloneNonReflectors. r=mccr8, a=sledru
☠☠ backed out by 95deb57e283b ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Thu, 05 Jun 2014 22:32:36 -0700
changeset 199427 9bcea7802320f5f4b4a73c2cc371b39732f2899f
parent 199426 d15a9c42baf3a7058ebe3f22e2c39163cb34c111
child 199428 2b3f51c3c5a7285b66e6a3a2009c7e2a338505a4
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8, sledru
bugs1021312
milestone31.0a2
Bug 1021312 - Wrap strings in CloneNonReflectors. r=mccr8, a=sledru
js/xpconnect/src/Sandbox.cpp
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -453,16 +453,18 @@ CloneNonReflectors(JSContext *cx, Mutabl
     JSAutoStructuredCloneBuffer buffer;
     AutoObjectVector rootedReflectors(cx);
     {
         // For parsing val we have to enter its compartment.
         // (unless it's a primitive)
         Maybe<JSAutoCompartment> ac;
         if (val.isObject()) {
             ac.construct(cx, &val.toObject());
+        } else if (val.isString() && !JS_WrapValue(cx, val)) {
+            return false;
         }
 
         if (!buffer.write(cx, val,
             &gForwarderStructuredCloneCallbacks,
             &rootedReflectors))
         {
             return false;
         }