Debian Codegraph @

intl/icu_capi/bindings/js/ICU4XLocaleFallbackIterator.mjs

raw
1 import wasm from "./diplomat-wasm.mjs"
2 import * as diplomatRuntime from "./diplomat-runtime.mjs"
3 import { ICU4XLocale } from "./ICU4XLocale.mjs"
4
5 const ICU4XLocaleFallbackIterator_box_destroy_registry = new FinalizationRegistry(underlying => {
6 wasm.ICU4XLocaleFallbackIterator_destroy(underlying);
7 });
8
9 export class ICU4XLocaleFallbackIterator {
10 #lifetimeEdges = [];
11 constructor(underlying, owned, edges) {
12 this.underlying = underlying;
13 this.#lifetimeEdges.push(...edges);
14 if (owned) {
15 ICU4XLocaleFallbackIterator_box_destroy_registry.register(this, underlying);
16 }
17 }
18
19 get() {
20 return new ICU4XLocale(wasm.ICU4XLocaleFallbackIterator_get(this.underlying), true, []);
21 }
22
23 step() {
24 wasm.ICU4XLocaleFallbackIterator_step(this.underlying);
25 }
26 }