Debian Codegraph @

js/src/builtin/intl/DurationFormat.h

raw
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef builtin_intl_DurationFormat_h
8 #define builtin_intl_DurationFormat_h
9
10 #include <stdint.h>
11
12 #include "builtin/SelfHostingDefines.h"
13 #include "js/Class.h"
14 #include "vm/NativeObject.h"
15
16 namespace js {
17
18 class DurationFormatObject : public NativeObject {
19 public:
20 static const JSClass class_;
21 static const JSClass& protoClass_;
22
23 static constexpr uint32_t INTERNALS_SLOT = 0;
24 static constexpr uint32_t SLOT_COUNT = 1;
25
26 static_assert(INTERNALS_SLOT == INTL_INTERNALS_OBJECT_SLOT,
27 "INTERNALS_SLOT must match self-hosting define for internals "
28 "object slot");
29
30 private:
31 static const ClassSpec classSpec_;
32 };
33
34 /**
35 * Returns the time separator string for the given locale and numbering system.
36 *
37 * Usage: separator = intl_GetTimeSeparator(locale, numberingSystem)
38 */
39 [[nodiscard]] extern bool intl_GetTimeSeparator(JSContext* cx, unsigned argc,
40 Value* vp);
41
42 /**
43 * `toLocaleString` implementation for Temporal.Duration objects.
44 */
45 [[nodiscard]] extern bool TemporalDurationToLocaleString(
46 JSContext* cx, const JS::CallArgs& args);
47
48 } // namespace js
49
50 #endif /* builtin_intl_DurationFormat_h */