mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-11 19:37:57 +08:00
Cleanup ifdef's in JSCExecutor
Reviewed By: kathryngray Differential Revision: D5433407 fbshipit-source-id: 104e8e5589d9c5e09c6702992eac3db2e6b4ab1a
This commit is contained in:
committed by
Facebook Github Bot
parent
ca9e26cecd
commit
ec14db1abc
@@ -20,16 +20,15 @@ static JSValueRef nativeCaptureHeap(
|
||||
const JSValueRef arguments[],
|
||||
JSValueRef* exception) {
|
||||
if (argumentCount < 1) {
|
||||
if (exception) {
|
||||
*exception = Value::makeError(
|
||||
ctx,
|
||||
"nativeCaptureHeap requires the path to save the capture");
|
||||
}
|
||||
return Value::makeUndefined(ctx);
|
||||
if (exception) {
|
||||
*exception = Value::makeError(
|
||||
ctx,
|
||||
"nativeCaptureHeap requires the path to save the capture");
|
||||
}
|
||||
return Value::makeUndefined(ctx);
|
||||
}
|
||||
|
||||
auto outputFilename = String::adopt(
|
||||
ctx, JSValueToStringCopy(ctx, arguments[0], exception));
|
||||
auto outputFilename = Value(ctx, arguments[0]).toString();
|
||||
JSCaptureHeap(ctx, outputFilename.str().c_str(), exception);
|
||||
return Value::makeUndefined(ctx);
|
||||
}
|
||||
@@ -39,11 +38,10 @@ static JSValueRef nativeCaptureHeap(
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
void addNativeMemoryHooks(JSGlobalContextRef ctx) {
|
||||
void addJSCMemoryHooks(JSGlobalContextRef ctx) {
|
||||
#ifdef WITH_FB_MEMORY_PROFILING
|
||||
installGlobalFunction(ctx, "nativeCaptureHeap", nativeCaptureHeap);
|
||||
#endif // WITH_FB_MEMORY_PROFILING
|
||||
|
||||
}
|
||||
|
||||
} }
|
||||
|
||||
Reference in New Issue
Block a user