Use std::function
Repalce old C style function pointer declaration Bug: v8:12083 Change-Id: I0e7b0c808a7c195989cc75da5d6617d7295918f9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3088357 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#76285}
This commit is contained in:
parent
4d0730084d
commit
c4e4868e03
@ -2209,8 +2209,8 @@ template <typename T>
|
||||
MaybeHandle<T> FormatRangeCommon(
|
||||
Isolate* isolate, Handle<JSDateTimeFormat> date_time_format, double x,
|
||||
double y,
|
||||
MaybeHandle<T> (*formatToResult)(Isolate*, const icu::FormattedValue&,
|
||||
bool*),
|
||||
const std::function<MaybeHandle<T>(Isolate*, const icu::FormattedValue&,
|
||||
bool*)>& formatToResult,
|
||||
bool* outputRange) {
|
||||
// Track newer feature formateRange and formatRangeToParts
|
||||
isolate->CountUsage(v8::Isolate::UseCounterFeature::kDateTimeFormatRange);
|
||||
|
@ -220,7 +220,8 @@ Maybe<std::vector<icu::UnicodeString>> ToUnicodeStringArray(
|
||||
template <typename T>
|
||||
MaybeHandle<T> FormatListCommon(
|
||||
Isolate* isolate, Handle<JSListFormat> format, Handle<JSArray> list,
|
||||
MaybeHandle<T> (*formatToResult)(Isolate*, const icu::FormattedValue&)) {
|
||||
const std::function<MaybeHandle<T>(Isolate*, const icu::FormattedValue&)>&
|
||||
formatToResult) {
|
||||
DCHECK(!list->IsUndefined());
|
||||
Maybe<std::vector<icu::UnicodeString>> maybe_array =
|
||||
ToUnicodeStringArray(isolate, list);
|
||||
|
@ -342,9 +342,9 @@ template <typename T>
|
||||
MaybeHandle<T> FormatCommon(
|
||||
Isolate* isolate, Handle<JSRelativeTimeFormat> format,
|
||||
Handle<Object> value_obj, Handle<Object> unit_obj, const char* func_name,
|
||||
MaybeHandle<T> (*formatToResult)(Isolate*,
|
||||
const icu::FormattedRelativeDateTime&,
|
||||
Handle<Object>, Handle<String>)) {
|
||||
const std::function<
|
||||
MaybeHandle<T>(Isolate*, const icu::FormattedRelativeDateTime&,
|
||||
Handle<Object>, Handle<String>)>& formatToResult) {
|
||||
// 3. Let value be ? ToNumber(value).
|
||||
Handle<Object> value;
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, value,
|
||||
|
Loading…
Reference in New Issue
Block a user