Reviewed By: lexs

Differential Revision: D3944918

fbshipit-source-id: 702907a12e3916f9d6edde7362416188df909d70
This commit is contained in:
Pieter De Baets 2016-09-30 12:19:00 -07:00 коммит произвёл Facebook Github Bot
Родитель 6ee319d8eb
Коммит 5b52dab781
6 изменённых файлов: 4 добавлений и 31 удалений

Просмотреть файл

@ -16,7 +16,6 @@
#include <dlfcn.h>
#include <cxxreact/JsArgumentHelpers.h>
#include <cxxreact/FollySupport.h>
#include "ReadableNativeArray.h"
@ -207,7 +206,7 @@ std::string CxxModuleWrapper::getConstantsJson() {
constsobject.insert(std::move(c.first), std::move(c.second));
}
return facebook::react::detail::toStdString(folly::toJson(constsobject));
return folly::toJson(constsobject);
}
jobject CxxModuleWrapper::getMethods() {

Просмотреть файл

@ -10,7 +10,6 @@
#include <folly/Memory.h>
#include <cxxreact/SystraceSection.h>
#include <cxxreact/FollySupport.h>
namespace facebook {
namespace react {
@ -57,7 +56,7 @@ ProxyExecutor::ProxyExecutor(jni::global_ref<jobject>&& executorInstance,
SystraceSection t("setGlobalVariable");
setGlobalVariable(
"__fbBatchedBridgeConfig",
folly::make_unique<JSBigStdString>(detail::toStdString(folly::toJson(config))));
folly::make_unique<JSBigStdString>(folly::toJson(config)));
}
ProxyExecutor::~ProxyExecutor() {

Просмотреть файл

@ -71,7 +71,6 @@ cxx_library(
compiler_flags = CXX_LIBRARY_COMPILER_FLAGS,
exported_headers = [
'CxxModule.h',
'FollySupport.h',
'JsArgumentHelpers.h',
'JsArgumentHelpers-inl.h',
],

Просмотреть файл

@ -1,21 +0,0 @@
// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <folly/FBString.h>
#include <string>
namespace facebook {
namespace react {
namespace detail {
// TODO(cjhopman): Once folly is updated, remove these.
inline std::string toStdString(std::string&& str) {
return std::move(str);
}
inline std::string toStdString(folly::fbstring&& str) {
return str.toStdString();
}
}}}

Просмотреть файл

@ -16,7 +16,6 @@
#include <fcntl.h>
#include <sys/time.h>
#include "FollySupport.h"
#include "JSCHelpers.h"
#include "Platform.h"
#include "SystraceSection.h"
@ -130,7 +129,7 @@ JSCExecutor::JSCExecutor(std::shared_ptr<ExecutorDelegate> delegate,
SystraceSection t("setGlobalVariable");
setGlobalVariable(
"__fbBatchedBridgeConfig",
folly::make_unique<JSBigStdString>(detail::toStdString(folly::toJson(config))));
folly::make_unique<JSBigStdString>(folly::toJson(config)));
}
JSCExecutor::JSCExecutor(

Просмотреть файл

@ -5,8 +5,6 @@
#include <folly/Conv.h>
#include <folly/dynamic.h>
#include "FollySupport.h"
#include <exception>
#include <string>
@ -100,7 +98,7 @@ inline double jsArgAsDouble(const folly::dynamic& args, size_t n) {
// Extract the n'th arg from the given dynamic, as a string. Throws a
// JsArgumentException if this fails for some reason.
inline std::string jsArgAsString(const folly::dynamic& args, size_t n) {
return facebook::react::detail::toStdString(jsArgN(args, n, &folly::dynamic::asString));
return jsArgN(args, n, &folly::dynamic::asString);
}
}}