idlize
51 строка · 1.3 Кб
1/*
2* Copyright (c) 2022-2023 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*/
15
16import { Context } from "./context.test"
17import { checkDump } from "./util.test"
18import { assert } from "chai"
19
20const someId = "xxx"
21
22suite("Variable declaration", () => {
23
24test("Variable declaration list @memo", () => {
25/** @memo */
26function f() {
27return
28}
29
30/** @memo */
31function ui() {
32/** @memo */
33let x1 = f, y1 = f
34
35x1()
36y1()
37
38const
39/** @memo */
40x2 = f,
41y2 = f
42
43x2()
44y2()
45}
46})
47
48for (let name of ["ui"]) {
49checkDump(name, "variable_declaration")
50}
51})
52