summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/temporal/TimeZone.h
blob: f1d0bf3f1fabcb5dd7ba5ff137c47630ea576d1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: set ts=8 sts=2 et sw=2 tw=80:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef builtin_temporal_TimeZone_h
#define builtin_temporal_TimeZone_h

#include "mozilla/Assertions.h"
#include "mozilla/EnumSet.h"

#include <stddef.h>
#include <stdint.h>

#include "builtin/temporal/Wrapped.h"
#include "js/GCVector.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "js/Value.h"
#include "vm/JSObject.h"
#include "vm/NativeObject.h"

class JSLinearString;
class JS_PUBLIC_API JSTracer;
struct JSClassOps;

namespace js {
struct ClassSpec;
}

namespace mozilla::intl {
class TimeZone;
}

namespace js::temporal {

class TimeZoneObjectMaybeBuiltin : public NativeObject {
 public:
  static constexpr uint32_t IDENTIFIER_SLOT = 0;
  static constexpr uint32_t OFFSET_MINUTES_SLOT = 1;
  static constexpr uint32_t INTL_TIMEZONE_SLOT = 2;
  static constexpr uint32_t SLOT_COUNT = 3;

  // Estimated memory use for intl::TimeZone (see IcuMemoryUsage).
  static constexpr size_t EstimatedMemoryUse = 6840;

  JSString* identifier() const {
    return getFixedSlot(IDENTIFIER_SLOT).toString();
  }

  const auto& offsetMinutes() const {
    return getFixedSlot(OFFSET_MINUTES_SLOT);
  }

  mozilla::intl::TimeZone* getTimeZone() const {
    const auto& slot = getFixedSlot(INTL_TIMEZONE_SLOT);
    if (slot.isUndefined()) {
      return nullptr;
    }
    return static_cast<mozilla::intl::TimeZone*>(slot.toPrivate());
  }

  void setTimeZone(mozilla::intl::TimeZone* timeZone) {
    setFixedSlot(INTL_TIMEZONE_SLOT, JS::PrivateValue(timeZone));
  }

 protected:
  static void finalize(JS::GCContext* gcx, JSObject* obj);
};

class TimeZoneObject : public TimeZoneObjectMaybeBuiltin {
 public:
  static const JSClass class_;
  static const JSClass& protoClass_;

 private:
  static const JSClassOps classOps_;
  static const ClassSpec classSpec_;
};

class BuiltinTimeZoneObject : public TimeZoneObjectMaybeBuiltin {
 public:
  static const JSClass class_;

 private:
  static const JSClassOps classOps_;
};

} /* namespace js::temporal */

template <>
inline bool JSObject::is<js::temporal::TimeZoneObjectMaybeBuiltin>() const {
  return is<js::temporal::TimeZoneObject>() ||
         is<js::temporal::BuiltinTimeZoneObject>();
}

namespace js::temporal {

/**
 * Temporal time zones can be either objects or strings. Objects are either
 * instances of `Temporal.TimeZone` or user-defined time zones. Strings are
 * either canonical time zone identifiers or time zone offset strings.
 *
 * Examples of valid Temporal time zones:
 * - Any object
 * - "UTC"
 * - "America/New_York"
 * - "+00:00"
 *
 * Examples of invalid Temporal time zones:
 * - Number values
 * - "utc" (wrong case)
 * - "Etc/UTC" (canonical name is "UTC")
 * - "+00" (missing minutes part)
 * - "+00:00:00" (sub-minute precision)
 * - "+00:00:01" (sub-minute precision)
 * - "-00:00" (wrong sign for zero offset)
 *
 * String-valued Temporal time zones are an optimization to avoid allocating
 * `Temporal.TimeZone` objects when creating `Temporal.ZonedDateTime` objects.
 * For example `Temporal.ZonedDateTime.from("1970-01-01[UTC]")` doesn't require
 * to allocate a fresh `Temporal.TimeZone` object for the "UTC" time zone.
 *
 * The specification creates new `Temporal.TimeZone` objects whenever any
 * operation is performed on a string-valued Temporal time zone. This newly
 * created object can't be accessed by the user and implementations are expected
 * to optimize away the allocation.
 *
 * The following two implementation approaches are possible:
 *
 * 1. Represent string-valued time zones as JSStrings. Additionally keep a
 *    mapping from JSString to `mozilla::intl::TimeZone` to avoid repeatedly
 *    creating new `mozilla::intl::TimeZone` for time zone operations. Offset
 *    string time zones have to be special cased, because they don't use
 *    `mozilla::intl::TimeZone`. Either detect offset strings by checking the
 *    time zone identifier or store offset strings as the offset in minutes
 *    value to avoid reparsing the offset string again and again.
 * 2. Represent string-valued time zones as `Temporal.TimeZone`-like objects.
 *    These internal `Temporal.TimeZone`-like objects must not be exposed to
 *    user-code.
 *
 * Option 2 is a bit easier to implement, so we use this approach for now.
 */
class TimeZoneValue final {
  JSObject* object_ = nullptr;

 public:
  /**
   * Default initialize this TimeZoneValue.
   */
  TimeZoneValue() = default;

  /**
   * Initialize this TimeZoneValue with a "string" time zone object.
   */
  explicit TimeZoneValue(BuiltinTimeZoneObject* timeZone) : object_(timeZone) {
    MOZ_ASSERT(isString());
  }

  /**
   * Initialize this TimeZoneValue with an "object" time zone object.
   */
  explicit TimeZoneValue(JSObject* timeZone) : object_(timeZone) {
    MOZ_ASSERT(isObject());
  }

  /**
   * Initialize this TimeZoneValue from a slot Value, which must be either a
   * "string" or "object" time zone object.
   */
  explicit TimeZoneValue(const JS::Value& value) : object_(&value.toObject()) {}

  /**
   * Return true if this TimeZoneValue is not null.
   */
  explicit operator bool() const { return !!object_; }

  /**
   * Return true if this TimeZoneValue is a "string" time zone.
   */
  bool isString() const {
    return object_ && object_->is<BuiltinTimeZoneObject>();
  }

  /**
   * Return true if this TimeZoneValue is an "object" time zone.
   */
  bool isObject() const { return object_ && !isString(); }

  /**
   * Return true if this TimeZoneValue holds a TimeZoneObjectMaybeBuiltin.
   */
  bool isTimeZoneObjectMaybeBuiltin() const {
    return object_ && object_->is<TimeZoneObjectMaybeBuiltin>();
  }

  /**
   * Return this "string" time zone.
   */
  auto* toString() const {
    MOZ_ASSERT(isString());
    return &object_->as<BuiltinTimeZoneObject>();
  }

  /**
   * Return this "object" time zone.
   */
  JSObject* toObject() const {
    MOZ_ASSERT(isObject());
    return object_;
  }

  /**
   * Return the underlying object as a TimeZoneObjectMaybeBuiltin.
   */
  auto* toTimeZoneObjectMaybeBuiltin() const {
    MOZ_ASSERT(isTimeZoneObjectMaybeBuiltin());
    return &object_->as<TimeZoneObjectMaybeBuiltin>();
  }

  /**
   * Return the Value representation of this TimeZoneValue.
   */
  JS::Value toValue() const {
    if (isString()) {
      return JS::StringValue(toString()->identifier());
    }

    MOZ_ASSERT(object_);
    return JS::ObjectValue(*object_);
  }

  /**
   * Return the slot Value representation of this TimeZoneValue.
   */
  JS::Value toSlotValue() const {
    MOZ_ASSERT(object_);
    return JS::ObjectValue(*object_);
  }

  // Helper methods for (Mutable)WrappedPtrOperations.
  auto address() { return &object_; }
  auto address() const { return &object_; }

  // Trace implementation.
  void trace(JSTracer* trc);
};

enum class TimeZoneMethod {
  GetOffsetNanosecondsFor,
  GetPossibleInstantsFor,
};

class TimeZoneRecord {
  TimeZoneValue receiver_;

  // Null unless non-builtin time zone methods are used.
  JSObject* getOffsetNanosecondsFor_ = nullptr;
  JSObject* getPossibleInstantsFor_ = nullptr;

#ifdef DEBUG
  mozilla::EnumSet<TimeZoneMethod> lookedUp_{};
#endif

 public:
  /**
   * Default initialize this TimeZoneRecord.
   */
  TimeZoneRecord() = default;

  explicit TimeZoneRecord(const TimeZoneValue& receiver)
      : receiver_(receiver) {}

  const auto& receiver() const { return receiver_; }
  auto* getOffsetNanosecondsFor() const { return getOffsetNanosecondsFor_; }
  auto* getPossibleInstantsFor() const { return getPossibleInstantsFor_; }

#ifdef DEBUG
  auto& lookedUp() const { return lookedUp_; }
  auto& lookedUp() { return lookedUp_; }
#endif

  // Helper methods for (Mutable)WrappedPtrOperations.
  auto* receiverDoNotUse() const { return &receiver_; }
  auto* getOffsetNanosecondsForDoNotUse() const {
    return &getOffsetNanosecondsFor_;
  }
  auto* getOffsetNanosecondsForDoNotUse() { return &getOffsetNanosecondsFor_; }
  auto* getPossibleInstantsForDoNotUse() const {
    return &getPossibleInstantsFor_;
  }
  auto* getPossibleInstantsForDoNotUse() { return &getPossibleInstantsFor_; }

  // Trace implementation.
  void trace(JSTracer* trc);
};

struct Instant;
struct ParsedTimeZone;
struct PlainDateTime;
class CalendarValue;
class InstantObject;
class PlainDateTimeObject;
class PlainDateTimeWithCalendar;
enum class TemporalDisambiguation;

/**
 * IsValidTimeZoneName ( timeZone )
 * IsAvailableTimeZoneName ( timeZone )
 */
bool IsValidTimeZoneName(JSContext* cx, JS::Handle<JSString*> timeZone,
                         JS::MutableHandle<JSAtom*> validatedTimeZone);

/**
 * CanonicalizeTimeZoneName ( timeZone )
 */
JSString* CanonicalizeTimeZoneName(JSContext* cx,
                                   JS::Handle<JSLinearString*> timeZone);

/**
 * IsValidTimeZoneName ( timeZone )
 * IsAvailableTimeZoneName ( timeZone )
 * CanonicalizeTimeZoneName ( timeZone )
 */
JSString* ValidateAndCanonicalizeTimeZoneName(JSContext* cx,
                                              JS::Handle<JSString*> timeZone);

/**
 * CreateTemporalTimeZone ( identifier [ , newTarget ] )
 */
BuiltinTimeZoneObject* CreateTemporalTimeZone(JSContext* cx,
                                              JS::Handle<JSString*> identifier);

/**
 * ToTemporalTimeZoneSlotValue ( temporalTimeZoneLike )
 */
bool ToTemporalTimeZone(JSContext* cx,
                        JS::Handle<JS::Value> temporalTimeZoneLike,
                        JS::MutableHandle<TimeZoneValue> result);

/**
 * ToTemporalTimeZoneSlotValue ( temporalTimeZoneLike )
 */
bool ToTemporalTimeZone(JSContext* cx, JS::Handle<ParsedTimeZone> string,
                        JS::MutableHandle<TimeZoneValue> result);

/**
 * ToTemporalTimeZoneObject ( timeZoneSlotValue )
 */
JSObject* ToTemporalTimeZoneObject(JSContext* cx,
                                   JS::Handle<TimeZoneValue> timeZone);

/**
 * ToTemporalTimeZoneIdentifier ( timeZoneSlotValue )
 */
JSString* ToTemporalTimeZoneIdentifier(JSContext* cx,
                                       JS::Handle<TimeZoneValue> timeZone);

/**
 * TimeZoneEquals ( one, two )
 */
bool TimeZoneEquals(JSContext* cx, JS::Handle<JSString*> one,
                    JS::Handle<JSString*> two, bool* equals);

/**
 * TimeZoneEquals ( one, two )
 */
bool TimeZoneEquals(JSContext* cx, JS::Handle<TimeZoneValue> one,
                    JS::Handle<TimeZoneValue> two, bool* equals);

/**
 * GetPlainDateTimeFor ( timeZoneRec, instant, calendar [ ,
 * precalculatedOffsetNanoseconds ] )
 */
PlainDateTimeObject* GetPlainDateTimeFor(JSContext* cx,
                                         JS::Handle<TimeZoneValue> timeZone,
                                         const Instant& instant,
                                         JS::Handle<CalendarValue> calendar);

/**
 * GetPlainDateTimeFor ( timeZoneRec, instant, calendar [ ,
 * precalculatedOffsetNanoseconds ] )
 */
PlainDateTimeObject* GetPlainDateTimeFor(JSContext* cx, const Instant& instant,
                                         JS::Handle<CalendarValue> calendar,
                                         int64_t offsetNanoseconds);

/**
 * GetPlainDateTimeFor ( timeZoneRec, instant, calendar [ ,
 * precalculatedOffsetNanoseconds ] )
 */
PlainDateTime GetPlainDateTimeFor(const Instant& instant,
                                  int64_t offsetNanoseconds);

/**
 * GetPlainDateTimeFor ( timeZoneRec, instant, calendar [ ,
 * precalculatedOffsetNanoseconds ] )
 */
bool GetPlainDateTimeFor(JSContext* cx, JS::Handle<TimeZoneRecord> timeZone,
                         const Instant& instant, PlainDateTime* result);

/**
 * GetPlainDateTimeFor ( timeZoneRec, instant, calendar [ ,
 * precalculatedOffsetNanoseconds ] )
 */
bool GetPlainDateTimeFor(JSContext* cx, JS::Handle<TimeZoneValue> timeZone,
                         const Instant& instant, PlainDateTime* result);

/**
 * GetInstantFor ( timeZoneRec, dateTime, disambiguation )
 */
bool GetInstantFor(JSContext* cx, JS::Handle<TimeZoneValue> timeZone,
                   JS::Handle<PlainDateTimeObject*> dateTime,
                   TemporalDisambiguation disambiguation, Instant* result);

/**
 * GetInstantFor ( timeZoneRec, dateTime, disambiguation )
 */
bool GetInstantFor(JSContext* cx, JS::Handle<TimeZoneRecord> timeZone,
                   JS::Handle<PlainDateTimeWithCalendar> dateTime,
                   TemporalDisambiguation disambiguation, Instant* result);

/**
 * GetInstantFor ( timeZoneRec, dateTime, disambiguation )
 */
bool GetInstantFor(JSContext* cx, JS::Handle<TimeZoneValue> timeZone,
                   JS::Handle<PlainDateTimeWithCalendar> dateTime,
                   TemporalDisambiguation disambiguation, Instant* result);

/**
 * FormatUTCOffsetNanoseconds ( offsetNanoseconds )
 */
JSString* FormatUTCOffsetNanoseconds(JSContext* cx, int64_t offsetNanoseconds);

/**
 * GetOffsetStringFor ( timeZoneRec, instant )
 */
JSString* GetOffsetStringFor(JSContext* cx, JS::Handle<TimeZoneValue> timeZone,
                             const Instant& instant);

/**
 * GetOffsetStringFor ( timeZoneRec, instant )
 */
JSString* GetOffsetStringFor(JSContext* cx, JS::Handle<TimeZoneRecord> timeZone,
                             JS::Handle<Wrapped<InstantObject*>> instant);

/**
 * GetOffsetNanosecondsFor ( timeZoneRec, instant )
 */
bool GetOffsetNanosecondsFor(JSContext* cx, JS::Handle<TimeZoneRecord> timeZone,
                             JS::Handle<Wrapped<InstantObject*>> instant,
                             int64_t* offsetNanoseconds);

/**
 * GetOffsetNanosecondsFor ( timeZoneRec, instant )
 */
bool GetOffsetNanosecondsFor(JSContext* cx, JS::Handle<TimeZoneValue> timeZone,
                             JS::Handle<Wrapped<InstantObject*>> instant,
                             int64_t* offsetNanoseconds);

/**
 * GetOffsetNanosecondsFor ( timeZoneRec, instant )
 */
bool GetOffsetNanosecondsFor(JSContext* cx, JS::Handle<TimeZoneRecord> timeZone,
                             const Instant& instant,
                             int64_t* offsetNanoseconds);

/**
 * GetOffsetNanosecondsFor ( timeZoneRec, instant )
 */
bool GetOffsetNanosecondsFor(JSContext* cx, JS::Handle<TimeZoneValue> timeZone,
                             const Instant& instant,
                             int64_t* offsetNanoseconds);

using InstantVector = JS::StackGCVector<Wrapped<InstantObject*>>;

/**
 * GetPossibleInstantsFor ( timeZoneRec, dateTime )
 */
bool GetPossibleInstantsFor(JSContext* cx, JS::Handle<TimeZoneRecord> timeZone,
                            JS::Handle<PlainDateTimeWithCalendar> dateTime,
                            JS::MutableHandle<InstantVector> list);

/**
 * DisambiguatePossibleInstants ( possibleInstants, timeZoneRec, dateTime,
 * disambiguation )
 */
bool DisambiguatePossibleInstants(
    JSContext* cx, JS::Handle<InstantVector> possibleInstants,
    JS::Handle<TimeZoneRecord> timeZone, const PlainDateTime& dateTime,
    TemporalDisambiguation disambiguation,
    JS::MutableHandle<Wrapped<InstantObject*>> result);

/**
 * CreateTimeZoneMethodsRecord ( timeZone, methods )
 */
bool CreateTimeZoneMethodsRecord(JSContext* cx,
                                 JS::Handle<TimeZoneValue> timeZone,
                                 mozilla::EnumSet<TimeZoneMethod> methods,
                                 JS::MutableHandle<TimeZoneRecord> result);

#ifdef DEBUG
/**
 * TimeZoneMethodsRecordHasLookedUp ( timeZoneRec, methodName )
 */
inline bool TimeZoneMethodsRecordHasLookedUp(const TimeZoneRecord& timeZone,
                                             TimeZoneMethod methodName) {
  // Steps 1-4.
  return timeZone.lookedUp().contains(methodName);
}
#endif

/**
 * TimeZoneMethodsRecordIsBuiltin ( timeZoneRec )
 */
inline bool TimeZoneMethodsRecordIsBuiltin(const TimeZoneRecord& timeZone) {
  // Steps 1-2.
  return timeZone.receiver().isString();
}

// Helper for MutableWrappedPtrOperations.
bool WrapTimeZoneValueObject(JSContext* cx,
                             JS::MutableHandle<JSObject*> timeZone);

} /* namespace js::temporal */

namespace js {

template <typename Wrapper>
class WrappedPtrOperations<temporal::TimeZoneValue, Wrapper> {
  const auto& container() const {
    return static_cast<const Wrapper*>(this)->get();
  }

 public:
  explicit operator bool() const { return !!container(); }

  bool isString() const { return container().isString(); }

  bool isObject() const { return container().isObject(); }

  JS::Handle<temporal::BuiltinTimeZoneObject*> toString() const {
    MOZ_ASSERT(container().isString());
    auto h = JS::Handle<JSObject*>::fromMarkedLocation(container().address());
    return h.template as<temporal::BuiltinTimeZoneObject>();
  }

  JS::Handle<JSObject*> toObject() const {
    MOZ_ASSERT(container().isObject());
    return JS::Handle<JSObject*>::fromMarkedLocation(container().address());
  }

  JS::Handle<temporal::TimeZoneObjectMaybeBuiltin*>
  toTimeZoneObjectMaybeBuiltin() const {
    MOZ_ASSERT(container().isTimeZoneObjectMaybeBuiltin());
    auto h = JS::Handle<JSObject*>::fromMarkedLocation(container().address());
    return h.template as<temporal::TimeZoneObjectMaybeBuiltin>();
  }

  JS::Value toValue() const { return container().toValue(); }

  JS::Value toSlotValue() const { return container().toSlotValue(); }
};

template <typename Wrapper>
class MutableWrappedPtrOperations<temporal::TimeZoneValue, Wrapper>
    : public WrappedPtrOperations<temporal::TimeZoneValue, Wrapper> {
  auto& container() { return static_cast<Wrapper*>(this)->get(); }

 public:
  /**
   * Wrap the time zone value into the current compartment.
   */
  bool wrap(JSContext* cx) {
    MOZ_ASSERT(container().isString() || container().isObject());
    auto mh =
        JS::MutableHandle<JSObject*>::fromMarkedLocation(container().address());
    return temporal::WrapTimeZoneValueObject(cx, mh);
  }
};

template <typename Wrapper>
class WrappedPtrOperations<temporal::TimeZoneRecord, Wrapper> {
  const auto& container() const {
    return static_cast<const Wrapper*>(this)->get();
  }

 public:
  JS::Handle<temporal::TimeZoneValue> receiver() const {
    return JS::Handle<temporal::TimeZoneValue>::fromMarkedLocation(
        container().receiverDoNotUse());
  }

  JS::Handle<JSObject*> getOffsetNanosecondsFor() const {
    return JS::Handle<JSObject*>::fromMarkedLocation(
        container().getOffsetNanosecondsForDoNotUse());
  }

  JS::Handle<JSObject*> getPossibleInstantsFor() const {
    return JS::Handle<JSObject*>::fromMarkedLocation(
        container().getPossibleInstantsForDoNotUse());
  }
};

template <typename Wrapper>
class MutableWrappedPtrOperations<temporal::TimeZoneRecord, Wrapper>
    : public WrappedPtrOperations<temporal::TimeZoneRecord, Wrapper> {
  auto& container() { return static_cast<Wrapper*>(this)->get(); }

 public:
  JS::MutableHandle<JSObject*> getOffsetNanosecondsFor() {
    return JS::MutableHandle<JSObject*>::fromMarkedLocation(
        container().getOffsetNanosecondsForDoNotUse());
  }

  JS::MutableHandle<JSObject*> getPossibleInstantsFor() {
    return JS::MutableHandle<JSObject*>::fromMarkedLocation(
        container().getPossibleInstantsForDoNotUse());
  }
};

} /* namespace js */

#endif /* builtin_temporal_TimeZone_h */