bool move_body_handle(JSContext *cx, HandleObject from, HandleObject to) {
  MOZ_ASSERT(is_instance(from));
  MOZ_ASSERT(is_instance(to));
  MOZ_ASSERT(!body_used(from));

  // Replace the receiving object's body handle with the body stream source's
  // underlying handle.
  // TODO: Let the host know we'll not use the old handle anymore, once C@E has
  // a hostcall for that.
  BodyHandle body = body_handle(from);
  JS::SetReservedSlot(to, Slots::Body, JS::Int32Value(body.handle));

  // Mark the source's body as used, and the stream as locked to prevent any
  // future attempts to use the underlying handle we just removed.
  return mark_body_used(cx, from);
}
bool move_body_handle(JSContext *cx, HandleObject from, HandleObject to) {
  MOZ_ASSERT(is_instance(from));
  MOZ_ASSERT(is_instance(to));
  MOZ_ASSERT(!body_used(from));

   
   
   
   
  BodyHandle body = body_handle(from);
  JS::SetReservedSlot(to, Slots::Body, JS::Int32Value(body.handle));

   
   
  return mark_body_used(cx, from);
}