diff options
Diffstat (limited to 'deps/v8/src/objects/js-relative-time-format.h')
-rw-r--r-- | deps/v8/src/objects/js-relative-time-format.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/deps/v8/src/objects/js-relative-time-format.h b/deps/v8/src/objects/js-relative-time-format.h index 397c6fe287..eaaeb0e05f 100644 --- a/deps/v8/src/objects/js-relative-time-format.h +++ b/deps/v8/src/objects/js-relative-time-format.h @@ -12,6 +12,7 @@ #include "src/heap/factory.h" #include "src/isolate.h" #include "src/objects.h" +#include "src/objects/managed.h" #include "unicode/uversion.h" // Has to be the last include (doesn't have include guards): @@ -28,26 +29,30 @@ class JSRelativeTimeFormat : public JSObject { public: // Initializes relative time format object with properties derived from input // locales and options. - static MaybeHandle<JSRelativeTimeFormat> InitializeRelativeTimeFormat( + V8_WARN_UNUSED_RESULT static MaybeHandle<JSRelativeTimeFormat> Initialize( Isolate* isolate, Handle<JSRelativeTimeFormat> relative_time_format_holder, Handle<Object> locales, Handle<Object> options); - static Handle<JSObject> ResolvedOptions( + V8_WARN_UNUSED_RESULT static Handle<JSObject> ResolvedOptions( Isolate* isolate, Handle<JSRelativeTimeFormat> format_holder); - // Unpacks formatter object from corresponding JavaScript object. - static icu::RelativeDateTimeFormatter* UnpackFormatter( - Handle<JSRelativeTimeFormat> relative_time_format_holder); Handle<String> StyleAsString() const; Handle<String> NumericAsString() const; + // ecma402/#sec-Intl.RelativeTimeFormat.prototype.format + // ecma402/#sec-Intl.RelativeTimeFormat.prototype.formatToParts + V8_WARN_UNUSED_RESULT static MaybeHandle<Object> Format( + Isolate* isolate, Handle<Object> value_obj, Handle<Object> unit_obj, + Handle<JSRelativeTimeFormat> format_holder, const char* func_name, + bool to_parts); + DECL_CAST(JSRelativeTimeFormat) // RelativeTimeFormat accessors. DECL_ACCESSORS(locale, String) - DECL_ACCESSORS(formatter, Foreign) + DECL_ACCESSORS(icu_formatter, Managed<icu::RelativeDateTimeFormatter>) // Style: identifying the relative time format style used. // @@ -98,8 +103,8 @@ class JSRelativeTimeFormat : public JSObject { // Layout description. static const int kJSRelativeTimeFormatOffset = JSObject::kHeaderSize; static const int kLocaleOffset = kJSRelativeTimeFormatOffset + kPointerSize; - static const int kFormatterOffset = kLocaleOffset + kPointerSize; - static const int kFlagsOffset = kFormatterOffset + kPointerSize; + static const int kICUFormatterOffset = kLocaleOffset + kPointerSize; + static const int kFlagsOffset = kICUFormatterOffset + kPointerSize; static const int kSize = kFlagsOffset + kPointerSize; private: |