Cleanup ifdef's in JSCExecutor

Reviewed By: kathryngray

Differential Revision: D5433407

fbshipit-source-id: 104e8e5589d9c5e09c6702992eac3db2e6b4ab1a
This commit is contained in:
Pieter De Baets
2017-07-25 04:45:08 -07:00
committed by Facebook Github Bot
parent ca9e26cecd
commit ec14db1abc
13 changed files with 116 additions and 204 deletions

View File

@@ -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
}
} }