/* void setExposureCompensation (const JS::Value& aCompensation, JSContext* cx); */ NS_IMETHODIMP nsCameraControl::SetExposureCompensation(const JS::Value& aCompensation, JSContext* cx) { if (aCompensation.isNullOrUndefined()) { // use NaN to switch the camera back into auto mode return SetHelper(CAMERA_PARAM_EXPOSURECOMPENSATION, NAN); } double compensation; if (!JS_ValueToNumber(cx, aCompensation, &compensation)) { return NS_ERROR_INVALID_ARG; } return SetHelper(CAMERA_PARAM_EXPOSURECOMPENSATION, compensation); }