ZonedDateTimeFormatterGregorian.mjs (23822B)
1 // generated by diplomat-tool 2 import { DataProvider } from "./DataProvider.mjs" 3 import { DateTimeFormatterGregorian } from "./DateTimeFormatterGregorian.mjs" 4 import { DateTimeFormatterLoadError } from "./DateTimeFormatterLoadError.mjs" 5 import { DateTimeWriteError } from "./DateTimeWriteError.mjs" 6 import { IsoDate } from "./IsoDate.mjs" 7 import { Locale } from "./Locale.mjs" 8 import { Time } from "./Time.mjs" 9 import { TimeZoneInfo } from "./TimeZoneInfo.mjs" 10 import wasm from "./diplomat-wasm.mjs"; 11 import * as diplomatRuntime from "./diplomat-runtime.mjs"; 12 13 14 /** 15 * See the [Rust documentation for `FixedCalendarDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.FixedCalendarDateTimeFormatter.html) for more information. 16 */ 17 const ZonedDateTimeFormatterGregorian_box_destroy_registry = new FinalizationRegistry((ptr) => { 18 wasm.icu4x_ZonedDateTimeFormatterGregorian_destroy_mv1(ptr); 19 }); 20 21 export class ZonedDateTimeFormatterGregorian { 22 // Internal ptr reference: 23 #ptr = null; 24 25 // Lifetimes are only to keep dependencies alive. 26 // Since JS won't garbage collect until there are no incoming edges. 27 #selfEdge = []; 28 29 #internalConstructor(symbol, ptr, selfEdge) { 30 if (symbol !== diplomatRuntime.internalConstructor) { 31 console.error("ZonedDateTimeFormatterGregorian is an Opaque type. You cannot call its constructor."); 32 return; 33 } 34 this.#ptr = ptr; 35 this.#selfEdge = selfEdge; 36 37 // Are we being borrowed? If not, we can register. 38 if (this.#selfEdge.length === 0) { 39 ZonedDateTimeFormatterGregorian_box_destroy_registry.register(this, this.#ptr); 40 } 41 42 return this; 43 } 44 get ffiValue() { 45 return this.#ptr; 46 } 47 48 49 /** 50 * Creates a zoned formatter based on a non-zoned formatter. 51 * 52 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 53 * or else unexpected behavior may occur! 54 * 55 * See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information. 56 */ 57 static createSpecificLong(locale, formatter) { 58 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 59 60 61 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 62 63 try { 64 if (!diplomatReceive.resultFlag) { 65 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 66 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 67 } 68 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 69 } 70 71 finally { 72 diplomatReceive.free(); 73 } 74 } 75 76 /** 77 * Creates a zoned formatter based on a non-zoned formatter. 78 * 79 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 80 * or else unexpected behavior may occur! 81 * 82 * See the [Rust documentation for `SpecificLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificLong.html) for more information. 83 */ 84 static createSpecificLongWithProvider(provider, locale, formatter) { 85 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 86 87 88 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_specific_long_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 89 90 try { 91 if (!diplomatReceive.resultFlag) { 92 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 93 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 94 } 95 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 96 } 97 98 finally { 99 diplomatReceive.free(); 100 } 101 } 102 103 /** 104 * Creates a zoned formatter based on a non-zoned formatter. 105 * 106 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 107 * or else unexpected behavior may occur! 108 * 109 * See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information. 110 */ 111 static createSpecificShort(locale, formatter) { 112 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 113 114 115 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 116 117 try { 118 if (!diplomatReceive.resultFlag) { 119 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 120 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 121 } 122 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 123 } 124 125 finally { 126 diplomatReceive.free(); 127 } 128 } 129 130 /** 131 * Creates a zoned formatter based on a non-zoned formatter. 132 * 133 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 134 * or else unexpected behavior may occur! 135 * 136 * See the [Rust documentation for `SpecificShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.SpecificShort.html) for more information. 137 */ 138 static createSpecificShortWithProvider(provider, locale, formatter) { 139 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 140 141 142 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_specific_short_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 143 144 try { 145 if (!diplomatReceive.resultFlag) { 146 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 147 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 148 } 149 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 150 } 151 152 finally { 153 diplomatReceive.free(); 154 } 155 } 156 157 /** 158 * Creates a zoned formatter based on a non-zoned formatter. 159 * 160 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 161 * or else unexpected behavior may occur! 162 * 163 * See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information. 164 */ 165 static createLocalizedOffsetLong(locale, formatter) { 166 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 167 168 169 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 170 171 try { 172 if (!diplomatReceive.resultFlag) { 173 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 174 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 175 } 176 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 177 } 178 179 finally { 180 diplomatReceive.free(); 181 } 182 } 183 184 /** 185 * Creates a zoned formatter based on a non-zoned formatter. 186 * 187 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 188 * or else unexpected behavior may occur! 189 * 190 * See the [Rust documentation for `LocalizedOffsetLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetLong.html) for more information. 191 */ 192 static createLocalizedOffsetLongWithProvider(provider, locale, formatter) { 193 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 194 195 196 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_long_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 197 198 try { 199 if (!diplomatReceive.resultFlag) { 200 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 201 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 202 } 203 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 204 } 205 206 finally { 207 diplomatReceive.free(); 208 } 209 } 210 211 /** 212 * Creates a zoned formatter based on a non-zoned formatter. 213 * 214 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 215 * or else unexpected behavior may occur! 216 * 217 * See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information. 218 */ 219 static createLocalizedOffsetShort(locale, formatter) { 220 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 221 222 223 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 224 225 try { 226 if (!diplomatReceive.resultFlag) { 227 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 228 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 229 } 230 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 231 } 232 233 finally { 234 diplomatReceive.free(); 235 } 236 } 237 238 /** 239 * Creates a zoned formatter based on a non-zoned formatter. 240 * 241 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 242 * or else unexpected behavior may occur! 243 * 244 * See the [Rust documentation for `LocalizedOffsetShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.LocalizedOffsetShort.html) for more information. 245 */ 246 static createLocalizedOffsetShortWithProvider(provider, locale, formatter) { 247 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 248 249 250 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_localized_offset_short_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 251 252 try { 253 if (!diplomatReceive.resultFlag) { 254 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 255 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 256 } 257 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 258 } 259 260 finally { 261 diplomatReceive.free(); 262 } 263 } 264 265 /** 266 * Creates a zoned formatter based on a non-zoned formatter. 267 * 268 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 269 * or else unexpected behavior may occur! 270 * 271 * See the [Rust documentation for `GenericLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information. 272 */ 273 static createGenericLong(locale, formatter) { 274 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 275 276 277 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 278 279 try { 280 if (!diplomatReceive.resultFlag) { 281 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 282 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 283 } 284 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 285 } 286 287 finally { 288 diplomatReceive.free(); 289 } 290 } 291 292 /** 293 * Creates a zoned formatter based on a non-zoned formatter. 294 * 295 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 296 * or else unexpected behavior may occur! 297 * 298 * See the [Rust documentation for `GenericLong`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericLong.html) for more information. 299 */ 300 static createGenericLongWithProvider(provider, locale, formatter) { 301 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 302 303 304 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_generic_long_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 305 306 try { 307 if (!diplomatReceive.resultFlag) { 308 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 309 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 310 } 311 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 312 } 313 314 finally { 315 diplomatReceive.free(); 316 } 317 } 318 319 /** 320 * Creates a zoned formatter based on a non-zoned formatter. 321 * 322 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 323 * or else unexpected behavior may occur! 324 * 325 * See the [Rust documentation for `GenericShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information. 326 */ 327 static createGenericShort(locale, formatter) { 328 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 329 330 331 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 332 333 try { 334 if (!diplomatReceive.resultFlag) { 335 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 336 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 337 } 338 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 339 } 340 341 finally { 342 diplomatReceive.free(); 343 } 344 } 345 346 /** 347 * Creates a zoned formatter based on a non-zoned formatter. 348 * 349 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 350 * or else unexpected behavior may occur! 351 * 352 * See the [Rust documentation for `GenericShort`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.GenericShort.html) for more information. 353 */ 354 static createGenericShortWithProvider(provider, locale, formatter) { 355 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 356 357 358 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_generic_short_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 359 360 try { 361 if (!diplomatReceive.resultFlag) { 362 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 363 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 364 } 365 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 366 } 367 368 finally { 369 diplomatReceive.free(); 370 } 371 } 372 373 /** 374 * Creates a zoned formatter based on a non-zoned formatter. 375 * 376 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 377 * or else unexpected behavior may occur! 378 * 379 * See the [Rust documentation for `Location`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.Location.html) for more information. 380 */ 381 static createLocation(locale, formatter) { 382 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 383 384 385 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_location_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 386 387 try { 388 if (!diplomatReceive.resultFlag) { 389 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 390 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 391 } 392 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 393 } 394 395 finally { 396 diplomatReceive.free(); 397 } 398 } 399 400 /** 401 * Creates a zoned formatter based on a non-zoned formatter. 402 * 403 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 404 * or else unexpected behavior may occur! 405 * 406 * See the [Rust documentation for `Location`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.Location.html) for more information. 407 */ 408 static createLocationWithProvider(provider, locale, formatter) { 409 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 410 411 412 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_location_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 413 414 try { 415 if (!diplomatReceive.resultFlag) { 416 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 417 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 418 } 419 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 420 } 421 422 finally { 423 diplomatReceive.free(); 424 } 425 } 426 427 /** 428 * Creates a zoned formatter based on a non-zoned formatter. 429 * 430 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 431 * or else unexpected behavior may occur! 432 * 433 * See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information. 434 */ 435 static createExemplarCity(locale, formatter) { 436 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 437 438 439 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_mv1(diplomatReceive.buffer, locale.ffiValue, formatter.ffiValue); 440 441 try { 442 if (!diplomatReceive.resultFlag) { 443 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 444 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 445 } 446 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 447 } 448 449 finally { 450 diplomatReceive.free(); 451 } 452 } 453 454 /** 455 * Creates a zoned formatter based on a non-zoned formatter. 456 * 457 * Caution: The locale provided here must match the locale used to construct the non-zoned formatter, 458 * or else unexpected behavior may occur! 459 * 460 * See the [Rust documentation for `ExemplarCity`](https://docs.rs/icu/latest/icu/datetime/fieldsets/zone/struct.ExemplarCity.html) for more information. 461 */ 462 static createExemplarCityWithProvider(provider, locale, formatter) { 463 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 464 465 466 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_create_exemplar_city_with_provider_mv1(diplomatReceive.buffer, provider.ffiValue, locale.ffiValue, formatter.ffiValue); 467 468 try { 469 if (!diplomatReceive.resultFlag) { 470 const cause = new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 471 throw new globalThis.Error('DateTimeFormatterLoadError: ' + cause.value, { cause }); 472 } 473 return new ZonedDateTimeFormatterGregorian(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); 474 } 475 476 finally { 477 diplomatReceive.free(); 478 } 479 } 480 481 /** 482 * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.FixedCalendarDateTimeFormatter.html#method.format) for more information. 483 */ 484 formatIso(date, time, zone) { 485 const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); 486 487 const write = new diplomatRuntime.DiplomatWriteBuf(wasm); 488 489 490 const result = wasm.icu4x_ZonedDateTimeFormatterGregorian_format_iso_mv1(diplomatReceive.buffer, this.ffiValue, date.ffiValue, time.ffiValue, zone.ffiValue, write.buffer); 491 492 try { 493 if (!diplomatReceive.resultFlag) { 494 const cause = new DateTimeWriteError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); 495 throw new globalThis.Error('DateTimeWriteError: ' + cause.value, { cause }); 496 } 497 return write.readString8(); 498 } 499 500 finally { 501 diplomatReceive.free(); 502 write.free(); 503 } 504 } 505 506 constructor(symbol, ptr, selfEdge) { 507 return this.#internalConstructor(...arguments) 508 } 509 }