/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import assert from 'assert';
let g = 1;
let h = { g: g };
{
    const { g: p = 2 } = h;
    p;
    assert(p === 1);
}
assert(h.g === 1);
(function () {
    var o;
    for ({ q: o = 5 } of [{ q: 1 }]) {
        assert(o === 1);
    }
})();
(function () {
    var n;
    for ({ t: n = 5 } of [{ t: n }]) {
        assert(n === 5);
    }
})();
(function () {
    let m;
    ({ y: m = 5 } = { y: 1 });
    assert(m === 1);
})();
(function () {
    let j: string, k: {
        x: number;
    };
    let l: any = { y2: "1", u: { x: 2 } };
    ({ y2: j = '5', u: k = { x: 1 } } = l);
    assert(j === '1');
    assert(k.x === 2);
})();
(function () {
    let i;
    ({ z: i = { x: 5 } } = { z: { x: 1 } });
    assert(i.x === 1);
})();
