1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import o2 from 'assert'; 16function n2() { 17 return { Propx1: 1, Propy1: 2 }; 18} 19const { Propx1: p2, Propy1: q2 } = n2(); 20o2(p2 === 1, 'success'); 21o2(q2 === 2, 'success'); 22// let Propx2 =3; 23// let Propy3 =4; 24// let Propy4 =5; 25const { Propx2: r2, Obj: { Propy3: s2, Propy4: t2 } } = { Propx2: 2, Obj: { Propy3: 3, Propy4: 4 } }; 26o2(r2 === 2, 'success'); 27o2(s2 === 3, 'success'); 28o2(t2 === 4, 'success'); 29const { ...u2 } = { prop1: 1, prop2: 2 }; 30o2(u2.prop1 === 1, 'success'); 31o2(u2.prop2 === 2, 'success'); 32const { prop3: v2, ...w2 } = { prop3: 3, prop4: 4 }; 33o2(v2 === 3, 'success'); 34o2(w2.prop4 === 4, 'success'); 35let x2 = 'hello'; 36let y2 = { name11: x2 }; 37