• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"use strict";
2/*
3 * Copyright (c) 2025 Huawei Device Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16Object.defineProperty(exports, "__esModule", { value: true });
17exports.finalizerUnregister = exports.finalizerRegisterWithCleaner = exports.finalizerRegister = void 0;
18const compat_1 = require("#koalaui/compat");
19function finalizerRegister(target, thunk) {
20    (0, compat_1.finalizerRegister)(target, thunk);
21}
22exports.finalizerRegister = finalizerRegister;
23function finalizerRegisterWithCleaner(target, cleaner) {
24    (0, compat_1.finalizerRegister)(target, new CleanerThunk(cleaner));
25}
26exports.finalizerRegisterWithCleaner = finalizerRegisterWithCleaner;
27function finalizerUnregister(target) {
28    (0, compat_1.finalizerUnregister)(target);
29}
30exports.finalizerUnregister = finalizerUnregister;
31class CleanerThunk {
32    constructor(cleaner) {
33        this.cleaner = cleaner;
34    }
35    clean() {
36        this.cleaner();
37    }
38}
39//# sourceMappingURL=Finalization.js.map