• 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 arrow functions
25     ARROW_FUNCTION,
26     // BEGIN async functions
27     ASYNC_ARROW_FUNCTION,
28     // END arrow functions
29     ASYNC_FUNCTION,
30     // END async functions
31     // BEGIN constructable functions
32     BUILTIN_PROXY_CONSTRUCTOR,
33     BUILTIN_CONSTRUCTOR,
34     // BEGIN base constructors
35     BASE_CONSTRUCTOR,
36     // BEGIN default constructors
37     DEFAULT_BASE_CONSTRUCTOR,
38     // BEGIN class constructors
39     CLASS_CONSTRUCTOR,
40     // END base constructors
41     // END default constructors
42     DERIVED_CONSTRUCTOR,
43     // END class constructors
44     GENERATOR_FUNCTION,
45     // END generators
46     // END constructable functions.
47 
48     // BEGIN accessors
49     GETTER_FUNCTION,
50     SETTER_FUNCTION,
51     // END accessors
52 
53     LAST_FUNCTION_KIND,
54 };
55 
56 enum class FunctionMode : uint8_t {
57     LEXICAL,
58     STRICT,
59     GLOBAL,
60 };
61 }  // namespace panda::ecmascript
62 
63 #endif  // ECMASCRIPT_JS_FUNCTION_KIND_H
64