mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
Cleanup and document Value wrapper (retry)
Reviewed By: mhorowitz Differential Revision: D5120975 fbshipit-source-id: 6e9c80a57fdcf7f3dad21d5521fb928b52c924c7
This commit is contained in:
committed by
Facebook Github Bot
parent
11424a8bc6
commit
03e1f40c1e
@@ -14,6 +14,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <React/RCTBridge+Private.h>
|
||||
#import <React/RCTCxxUtils.h>
|
||||
#import <React/RCTLog.h>
|
||||
#import <cxxreact/Platform.h>
|
||||
#import <jschelpers/Value.h>
|
||||
@@ -30,8 +31,9 @@ JSValueRef nativeLoggingHook(
|
||||
level = MAX(level, (RCTLogLevel)Value(ctx, arguments[1]).asNumber());
|
||||
}
|
||||
if (argumentCount > 0) {
|
||||
String message = Value(ctx, arguments[0]).toString();
|
||||
_RCTLogJavaScriptInternal(level, @(message.str().c_str()));
|
||||
JSContext *contextObj = contextForGlobalContextRef(JSC_JSContextGetGlobalContext(ctx));
|
||||
JSValue *msg = [JSC_JSValue(ctx) valueWithJSValueRef:arguments[0] inContext:contextObj];
|
||||
_RCTLogJavaScriptInternal(level, [msg toString]);
|
||||
}
|
||||
return Value::makeUndefined(ctx);
|
||||
}
|
||||
@@ -45,7 +47,7 @@ JSValueRef nativePerformanceNow(
|
||||
}
|
||||
|
||||
void RCTPrepareJSCExecutor() {
|
||||
ReactMarker::logTaggedMarker = [](const ReactMarker::ReactMarkerId, const char* tag) {};
|
||||
ReactMarker::logTaggedMarker = [](const ReactMarker::ReactMarkerId, const char *tag) {};
|
||||
PerfLogging::installNativeHooks = RCTFBQuickPerformanceLoggerConfigureHooks;
|
||||
JSNativeHooks::loggingHook = nativeLoggingHook;
|
||||
JSNativeHooks::nowHook = nativePerformanceNow;
|
||||
|
||||
Reference in New Issue
Block a user