mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Ignore anonymous variables in the snapshot (#55845)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55845 Changelog: [Internal] Updates C++ API snapshot generator not to include anonymous variables in the snapshot. This covers an edge case where doxygen will generate an anonymout member of type "union" when an anonymous union is present in a class. Reviewed By: cipolleschi Differential Revision: D94901506 fbshipit-source-id: cb02b3b80389fcf5a0ac20012e0897afc355cb57
This commit is contained in:
1 parent
25ac11b03d
commit
44bb931446
3 files changed
+31
No files matched your search
@@ -479,6 +479,10 @@ def build_snapshot(xml_dir: str) -> Snapshot:
|
||||
member_def.get_type()
|
||||
)
|
||||
|
||||
# Skip anonymous variables
|
||||
if "@" in var_type:
|
||||
continue
|
||||
|
||||
if var_type == "friend":
|
||||
class_scope.add_member(
|
||||
FriendMember(
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
struct test::BundleHeader {
|
||||
public uint32_t magic32;
|
||||
public uint32_t version;
|
||||
public uint64_t magic64;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace test {
|
||||
|
||||
struct BundleHeader {
|
||||
union {
|
||||
uint32_t magic32;
|
||||
uint64_t magic64;
|
||||
};
|
||||
uint32_t version;
|
||||
};
|
||||
|
||||
} // namespace test
|
||||
Reference in new issue
Block a user