diff --git a/interop/src/cpp/ani/convertors-ani.h b/interop/src/cpp/ani/convertors-ani.h index 17529180b9e9a4c66907f5528e218aaab5ec048c..9ed6866ea6fe2b1195a6a9d9c6ba8530a1cd44aa 100644 --- a/interop/src/cpp/ani/convertors-ani.h +++ b/interop/src/cpp/ani/convertors-ani.h @@ -377,7 +377,7 @@ struct InteropTypeConverter { CHECK_ANI_FATAL(env->Object_InstanceOf(valueObj, resource_class, &isInstanceOf)); if (isInstanceOf) { static ani_method resource_p = nullptr; - if (!resource_p) CHECK_ANI_FATAL(env->Class_FindMethod(resource_class, "id",":d", &resource_p)); + if (!resource_p) CHECK_ANI_FATAL(env->Class_FindMethod(resource_class, "%%get-id",":d", &resource_p)); ani_double result; CHECK_ANI_FATAL(env->Object_CallMethod_Double(valueObj, resource_p, &result)); return KLength{ 3, 0, 1, (KInt) result }; diff --git a/interop/src/cpp/ets/convertors-ets.h b/interop/src/cpp/ets/convertors-ets.h index 4d3ed151619f707b42c52a5ccca82b955361d034..bd9f86b3ccc96d43c2ac0d728eb5b4134e0e9bf1 100644 --- a/interop/src/cpp/ets/convertors-ets.h +++ b/interop/src/cpp/ets/convertors-ets.h @@ -1,4 +1,4 @@ -/* +/*convertors-ets.h * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -275,7 +275,7 @@ struct InteropTypeConverter { length.resource = 0; return length; } else if (env->IsInstanceOf(value, resource_class)) { - const static ets_method resource_p = env->Getp_method(resource_class, "id", ":D"); + const static ets_method resource_p = env->Getp_method(resource_class, "%%get-id", ":D"); return KLength{ 3, 0, 1, (KInt)env->CallDoubleMethod(value, resource_p) }; } else { return KLength( { 0, 0, 0, 0}); @@ -1840,4 +1840,4 @@ void getKoalaEtsNapiCallbackDispatcher(ets_class* clazz, ets_method* method); #endif // KOALA_ETS_NAPI -#endif // CONVERTORS_ETS_H \ No newline at end of file +#endif // CONVERTORS_ETS_H diff --git a/ui2abc/libarkts/src/utils.ts b/ui2abc/libarkts/src/utils.ts index 5a06fc899eedd4f4a8e775e71bce26cd09eabaa3..92328ce8c4644535648a53e0888ffa3b8a8a85bc 100644 --- a/ui2abc/libarkts/src/utils.ts +++ b/ui2abc/libarkts/src/utils.ts @@ -141,8 +141,8 @@ function addExports(code: string): string { function excludePartialInterfaces(code: string): string { return code - .replaceAll(/export interface (.*)\$partial<>([\s\S]*?)}/g, '') - .replaceAll(/interface (.*)\$partial<>([\s\S]*?)}/g, '') + .replaceAll(/export interface %%partial-(.*)\<>([\s\S]*?)}/g, '') + .replaceAll(/interface %%partial-(.*)<>([\s\S]*?)}/g, '') } function fixEnums(code: string) { @@ -221,4 +221,4 @@ export function filterSource(text: string): string { export function getEnumName(enumType: any, value: number): string | undefined { return enumType[value]; -} \ No newline at end of file +} diff --git a/ui2abc/ui-plugins/src/property-transformers.ts b/ui2abc/ui-plugins/src/property-transformers.ts index a47e27815805c9aadf62b7d58e9313f9a50e8b0f..df4bc40de1e7658f1088d483df8cd5d5cebf474d 100644 --- a/ui2abc/ui-plugins/src/property-transformers.ts +++ b/ui2abc/ui-plugins/src/property-transformers.ts @@ -623,7 +623,7 @@ export class BuilderParamTransformer implements PropertyTransformer { } applyReuseRecord(property: arkts.ClassProperty, result: arkts.Expression[]): void { // cause ClassCastError on panda while using default value - // LambdaObject$lambda$invoke$805 cannot be cast to std.core.Function0 + // %%lambda-lambda_invoke-805 cannot be cast to std.core.Function0 // addPropertyRecordTo(result, property) } applyBuild(property: arkts.ClassProperty, result: arkts.Statement[]): void {