1 /*
2 * Copyright (c) 2025 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 #include <common.h>
17 #include "public/es2panda_lib.h"
18
19 // NOLINTBEGIN
20
21 // CC-OFFNXT(G.FUN.01-CPP) solid logic
impl_CreateMemberExpression(KNativePointer context,KNativePointer objectArg,KNativePointer property,KInt kind,KBoolean computed,KBoolean optionalArg)22 KNativePointer impl_CreateMemberExpression(KNativePointer context, KNativePointer objectArg, KNativePointer property,
23 KInt kind, KBoolean computed, KBoolean optionalArg)
24 {
25 const auto ctx = reinterpret_cast<es2panda_Context *>(context);
26 const auto objArg = reinterpret_cast<es2panda_AstNode *>(objectArg);
27 const auto prop = reinterpret_cast<es2panda_AstNode *>(property);
28 const auto expressionKind = static_cast<Es2pandaMemberExpressionKind>(kind);
29 const auto isComputed = static_cast<KBoolean>(computed);
30 const auto optArg = static_cast<KBoolean>(optionalArg);
31 const auto result = GetPublicImpl()->CreateMemberExpression(ctx, objArg, prop, expressionKind, isComputed, optArg);
32 return result;
33 }
34 // CC-OFFNXT(G.FUN.01-CPP) solid logic
TS_INTEROP_6(CreateMemberExpression,KNativePointer,KNativePointer,KNativePointer,KNativePointer,KInt,KBoolean,KBoolean)35 TS_INTEROP_6(CreateMemberExpression, KNativePointer, KNativePointer, KNativePointer, KNativePointer, KInt, KBoolean,
36 KBoolean)
37
38 // CC-OFFNXT(G.FUN.01-CPP) solid logic
39 KNativePointer impl_UpdateMemberExpression(KNativePointer context, KNativePointer original, KNativePointer object_arg,
40 KNativePointer property, KInt kind, KBoolean computed, KBoolean optional_arg)
41 {
42 const auto _context = reinterpret_cast<es2panda_Context *>(context);
43 const auto _original = reinterpret_cast<es2panda_AstNode *>(original);
44 const auto _object_arg = reinterpret_cast<es2panda_AstNode *>(object_arg);
45 const auto _property = reinterpret_cast<es2panda_AstNode *>(property);
46 const auto _kind = static_cast<Es2pandaMemberExpressionKind>(kind);
47 const auto _computed = static_cast<KBoolean>(computed);
48 const auto _optional_arg = static_cast<KBoolean>(optional_arg);
49 const auto result = GetPublicImpl()->UpdateMemberExpression(_context, _original, _object_arg, _property, _kind,
50 _computed, _optional_arg);
51 return result;
52 }
53 // CC-OFFNXT(G.FUN.01-CPP) solid logic
TS_INTEROP_7(UpdateMemberExpression,KNativePointer,KNativePointer,KNativePointer,KNativePointer,KNativePointer,KInt,KBoolean,KBoolean)54 TS_INTEROP_7(UpdateMemberExpression, KNativePointer, KNativePointer, KNativePointer, KNativePointer, KNativePointer,
55 KInt, KBoolean, KBoolean)
56
57 KNativePointer impl_MemberExpressionObject(KNativePointer context, KNativePointer receiver)
58 {
59 const auto _context = reinterpret_cast<es2panda_Context *>(context);
60 const auto _receiver = reinterpret_cast<es2panda_AstNode *>(receiver);
61 const auto result = GetPublicImpl()->MemberExpressionObject(_context, _receiver);
62 return result;
63 }
TS_INTEROP_2(MemberExpressionObject,KNativePointer,KNativePointer,KNativePointer)64 TS_INTEROP_2(MemberExpressionObject, KNativePointer, KNativePointer, KNativePointer)
65
66 KNativePointer impl_MemberExpressionProperty(KNativePointer context, KNativePointer receiver)
67 {
68 const auto _context = reinterpret_cast<es2panda_Context *>(context);
69 const auto _receiver = reinterpret_cast<es2panda_AstNode *>(receiver);
70 const auto result = GetPublicImpl()->MemberExpressionProperty(_context, _receiver);
71 return result;
72 }
TS_INTEROP_2(MemberExpressionProperty,KNativePointer,KNativePointer,KNativePointer)73 TS_INTEROP_2(MemberExpressionProperty, KNativePointer, KNativePointer, KNativePointer)
74
75 KInt impl_MemberExpressionKindConst(KNativePointer context, KNativePointer receiver)
76 {
77 const auto _context = reinterpret_cast<es2panda_Context *>(context);
78 const auto _receiver = reinterpret_cast<es2panda_AstNode *>(receiver);
79 const auto result = GetPublicImpl()->MemberExpressionKindConst(_context, _receiver);
80 return result;
81 }
82 TS_INTEROP_2(MemberExpressionKindConst, KInt, KNativePointer, KNativePointer)
83
84 // NOLINTEND
85