summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XGraphemeClusterBreakIteratorUtf16.js
diff options
context:
space:
mode:
Diffstat (limited to 'intl/icu_capi/js/package/lib/ICU4XGraphemeClusterBreakIteratorUtf16.js')
-rw-r--r--intl/icu_capi/js/package/lib/ICU4XGraphemeClusterBreakIteratorUtf16.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/intl/icu_capi/js/package/lib/ICU4XGraphemeClusterBreakIteratorUtf16.js b/intl/icu_capi/js/package/lib/ICU4XGraphemeClusterBreakIteratorUtf16.js
new file mode 100644
index 0000000000..cc997daa05
--- /dev/null
+++ b/intl/icu_capi/js/package/lib/ICU4XGraphemeClusterBreakIteratorUtf16.js
@@ -0,0 +1,21 @@
+import wasm from "./diplomat-wasm.mjs"
+import * as diplomatRuntime from "./diplomat-runtime.js"
+
+const ICU4XGraphemeClusterBreakIteratorUtf16_box_destroy_registry = new FinalizationRegistry(underlying => {
+ wasm.ICU4XGraphemeClusterBreakIteratorUtf16_destroy(underlying);
+});
+
+export class ICU4XGraphemeClusterBreakIteratorUtf16 {
+ #lifetimeEdges = [];
+ constructor(underlying, owned, edges) {
+ this.underlying = underlying;
+ this.#lifetimeEdges.push(...edges);
+ if (owned) {
+ ICU4XGraphemeClusterBreakIteratorUtf16_box_destroy_registry.register(this, underlying);
+ }
+ }
+
+ next() {
+ return wasm.ICU4XGraphemeClusterBreakIteratorUtf16_next(this.underlying);
+ }
+}