• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 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
16exports.etsAnnotationsEnable = true;
17exports.emitIntermediateTS = true;
18
19exports.source = `
20@interface Anno {
21    d  = !"abc"
22    q: string = "a" + "b"
23    r: string = "a" && "b"
24    s: string = "c" || "d"
25    t = "abc" < "abd"
26    u = "abc" <= "abc"
27    v = "b" > "a"
28    w = "b" >= "b"
29    x = "abc" === "abc"
30    y = "qwe" !== "qwe"
31    z = "" == ""
32}
33`
34
35exports.expectResult = `let __generate__Id: number = 0;
36function generateId(): string {
37    return "annotationDeclarationFieldInitializer2_" + ++__generate__Id;
38}
39@interface Anno {
40    d: boolean = false;
41    q: string = "ab";
42    r: string = "b";
43    s: string = "c";
44    t: boolean = true;
45    u: boolean = true;
46    v: boolean = true;
47    w: boolean = true;
48    x: boolean = true;
49    y: boolean = false;
50    z: boolean = true;
51}
52`