• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 
16 #ifndef ECMASCRIPT_JS_FUNCTION_KIND_H
17 #define ECMASCRIPT_JS_FUNCTION_KIND_H
18 
19 #include <cstdint>
20 
21 namespace panda::ecmascript {
22 enum class FunctionKind : uint8_t {
23     NORMAL_FUNCTION = 0,
24     // BEGIN accessors
25     GETTER_FUNCTION,
26     SETTER_FUNCTION,
27     // END accessors
28     // BEGIN arrow functions
29     ARROW_FUNCTION,
30     // BEGIN async functions
31     ASYNC_ARROW_FUNCTION,
32     // END arrow functions
33     // Concurrent function is async function with concurrent property
34     CONCURRENT_FUNCTION,
35     ASYNC_FUNCTION,
36     // END async functions
37     // BEGIN base constructors
38     BASE_CONSTRUCTOR,
39     // BEGIN class constructors
40     CLASS_CONSTRUCTOR,
41     // END base constructors
42     // BEGIN constructable functions
43     BUILTIN_PROXY_CONSTRUCTOR,
44     BUILTIN_CONSTRUCTOR,
45     DERIVED_CONSTRUCTOR,
46     // END class constructors
47     GENERATOR_FUNCTION,
48     // END generators
49     // END constructable functions.
50     NONE_FUNCTION,
51     ASYNC_GENERATOR_FUNCTION,
52     LAST_FUNCTION_KIND,
53 };
54 }  // namespace panda::ecmascript
55 
56 #endif  // ECMASCRIPT_JS_FUNCTION_KIND_H
57