mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add JSContextRef param to String constructor
Reviewed By: bnham Differential Revision: D4197300 fbshipit-source-id: 306ffc85e3ced24047b68499f7cdf5e2d31fc052
This commit is contained in:
committed by
Facebook Github Bot
parent
b1c91606ff
commit
20514e3482
@@ -29,13 +29,12 @@ static JSValueRef nativeProfilerStart(
|
||||
return Value::makeUndefined(ctx);
|
||||
}
|
||||
|
||||
JSStringRef title = JSValueToStringCopy(ctx, arguments[0], exception);
|
||||
auto title = String::adopt(ctx, JSValueToStringCopy(ctx, arguments[0], exception));
|
||||
#if WITH_REACT_INTERNAL_SETTINGS
|
||||
JSStartProfiling(ctx, title, false);
|
||||
#else
|
||||
JSStartProfiling(ctx, title);
|
||||
#endif
|
||||
JSStringRelease(title);
|
||||
return Value::makeUndefined(ctx);
|
||||
}
|
||||
|
||||
@@ -57,15 +56,15 @@ static JSValueRef nativeProfilerEnd(
|
||||
|
||||
std::string writeLocation("/sdcard/");
|
||||
if (argumentCount > 1) {
|
||||
JSStringRef fileName = JSValueToStringCopy(ctx, arguments[1], exception);
|
||||
writeLocation += facebook::react::String::ref(fileName).str();
|
||||
JSStringRelease(fileName);
|
||||
auto fileName = String::adopt(
|
||||
ctx, JSValueToStringCopy(ctx, arguments[1], exception));
|
||||
writeLocation += fileName.str();
|
||||
} else {
|
||||
writeLocation += "profile.json";
|
||||
}
|
||||
JSStringRef title = JSValueToStringCopy(ctx, arguments[0], exception);
|
||||
auto title = String::adopt(
|
||||
ctx, JSValueToStringCopy(ctx, arguments[0], exception));
|
||||
JSEndProfilingAndRender(ctx, title, writeLocation.c_str());
|
||||
JSStringRelease(title);
|
||||
return Value::makeUndefined(ctx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user