Better folly::dynamic ==> JSValue conversion

Reviewed By: lexs

Differential Revision: D3347854

fbshipit-source-id: 95b81152d1b0d5fe41e01991c44f5d1110be7ddb
This commit is contained in:
Dan Caspi
2016-07-20 04:25:53 -07:00
committed by Facebook Github Bot 0
parent e1b3bbdb04
commit 654e4bed2e
4 changed files with 82 additions and 6 deletions

View File

@@ -596,7 +596,7 @@ JSValueRef JSCExecutor::nativeRequireModuleConfig(
std::string moduleName = Value(m_context, arguments[0]).toString().str();
folly::dynamic config = m_delegate->getModuleConfig(moduleName);
return JSValueMakeString(m_context, String(folly::toJson(config).c_str()));
return Value::fromDynamic(m_context, config);
}
JSValueRef JSCExecutor::nativeFlushQueueImmediate(
@@ -681,7 +681,7 @@ JSValueRef JSCExecutor::nativeCallSyncHook(
if (result.isUndefined) {
return JSValueMakeUndefined(m_context);
}
return Value::fromJSON(m_context, String(folly::toJson(result.result).c_str()));
return Value::fromDynamic(m_context, result.result);
}
static JSValueRef nativeInjectHMRUpdate(