mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-07 23:27:05 +08:00
Remove Native Extensions
Reviewed By: michalgr Differential Revision: D8057885 fbshipit-source-id: 6af7f7729201d26a704adaadb15813979cd035f8
This commit is contained in:
committed by
Facebook Github Bot
parent
782971f60e
commit
7c5845a5a2
@@ -120,19 +120,17 @@ std::unique_ptr<JSExecutor> JSCExecutorFactory::createJSExecutor(
|
||||
std::shared_ptr<ExecutorDelegate> delegate,
|
||||
std::shared_ptr<MessageQueueThread> jsQueue) {
|
||||
return folly::make_unique<JSCExecutor>(
|
||||
delegate, jsQueue, m_jscConfig, m_nativeExtensionsProvider);
|
||||
delegate, jsQueue, m_jscConfig);
|
||||
}
|
||||
|
||||
JSCExecutor::JSCExecutor(
|
||||
std::shared_ptr<ExecutorDelegate> delegate,
|
||||
std::shared_ptr<MessageQueueThread> messageQueueThread,
|
||||
const folly::dynamic& jscConfig,
|
||||
NativeExtensionsProvider nativeExtensionsProvider) throw(JSException)
|
||||
const folly::dynamic& jscConfig) throw(JSException)
|
||||
: m_delegate(delegate),
|
||||
m_messageQueueThread(messageQueueThread),
|
||||
m_nativeModules(delegate ? delegate->getModuleRegistry() : nullptr),
|
||||
m_jscConfig(jscConfig),
|
||||
m_nativeExtensionsProvider(nativeExtensionsProvider) {
|
||||
m_jscConfig(jscConfig) {
|
||||
initOnJSVMThread();
|
||||
|
||||
{
|
||||
@@ -142,12 +140,6 @@ JSCExecutor::JSCExecutor(
|
||||
"nativeModuleProxy",
|
||||
exceptionWrapMethod<&JSCExecutor::getNativeModule>());
|
||||
}
|
||||
if (nativeExtensionsProvider) {
|
||||
installGlobalProxy(
|
||||
m_context,
|
||||
"nativeExtensions",
|
||||
exceptionWrapMethod<&JSCExecutor::getNativeExtension>());
|
||||
}
|
||||
}
|
||||
|
||||
JSCExecutor::~JSCExecutor() {
|
||||
@@ -732,17 +724,6 @@ JSValueRef JSCExecutor::getNativeModule(
|
||||
return m_nativeModules.getModule(m_context, propertyName);
|
||||
}
|
||||
|
||||
JSValueRef JSCExecutor::getNativeExtension(
|
||||
JSObjectRef object,
|
||||
JSStringRef propertyName) {
|
||||
if (m_nativeExtensionsProvider) {
|
||||
folly::dynamic value =
|
||||
m_nativeExtensionsProvider(String::ref(m_context, propertyName).str());
|
||||
return Value::fromDynamic(m_context, std::move(value));
|
||||
}
|
||||
return JSC_JSValueMakeUndefined(m_context);
|
||||
}
|
||||
|
||||
JSValueRef JSCExecutor::nativeRequire(
|
||||
size_t count,
|
||||
const JSValueRef arguments[]) {
|
||||
|
||||
Reference in New Issue
Block a user