зеркало из https://github.com/microsoft/CCF.git
Remove unused JS global IDs (#6192)
This commit is contained in:
Родитель
57a1e0095f
Коммит
8ced795443
|
@ -34,14 +34,7 @@ namespace ccf::js::core
|
|||
std::vector<std::pair<JSClassID, JSClassDef*>> classes{
|
||||
{kv_class_id, &kv_class_def},
|
||||
{kv_historical_class_id, &kv_historical_class_def},
|
||||
{kv_map_handle_class_id, &kv_map_handle_class_def},
|
||||
{node_class_id, &node_class_def},
|
||||
{network_class_id, &network_class_def},
|
||||
{rpc_class_id, &rpc_class_def},
|
||||
{host_class_id, &host_class_def},
|
||||
{consensus_class_id, &consensus_class_def},
|
||||
{historical_class_id, &historical_class_def},
|
||||
{historical_state_class_id, &historical_state_class_def}};
|
||||
{kv_map_handle_class_id, &kv_map_handle_class_def}};
|
||||
for (auto [class_id, class_def] : classes)
|
||||
{
|
||||
auto ret = JS_NewClass(rt, class_id, class_def);
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "ccf/base_endpoint_registry.h"
|
||||
#include "js/checks.h"
|
||||
#include "js/core/context.h"
|
||||
#include "js/global_class_ids.h"
|
||||
|
||||
#include <quickjs/quickjs.h>
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include "ccf/version.h"
|
||||
#include "js/core/context.h"
|
||||
#include "js/global_class_ids.h"
|
||||
#include "js/modules.h"
|
||||
#include "node/rpc/jwt_management.h"
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "js/checks.h"
|
||||
#include "js/core/context.h"
|
||||
#include "js/extensions/ccf/kv_helpers.h"
|
||||
#include "js/global_class_ids.h"
|
||||
#include "kv/untyped_map.h"
|
||||
|
||||
namespace ccf::js::extensions
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "js/extensions/ccf/host.h"
|
||||
|
||||
#include "js/core/context.h"
|
||||
#include "js/global_class_ids.h"
|
||||
|
||||
#include <quickjs/quickjs.h>
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "js/extensions/ccf/network.h"
|
||||
|
||||
#include "js/core/context.h"
|
||||
#include "js/global_class_ids.h"
|
||||
#include "node/network_state.h"
|
||||
|
||||
#include <quickjs/quickjs.h>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "js/extensions/ccf/node.h"
|
||||
|
||||
#include "js/core/context.h"
|
||||
#include "js/global_class_ids.h"
|
||||
#include "node/rpc/gov_logging.h"
|
||||
|
||||
#include <quickjs/quickjs.h>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "ccf/rpc_context.h"
|
||||
#include "js/core/context.h"
|
||||
#include "js/global_class_ids.h"
|
||||
|
||||
#include <quickjs/quickjs.h>
|
||||
|
||||
|
|
|
@ -10,23 +10,9 @@ namespace ccf::js
|
|||
JSClassID kv_class_id = 0;
|
||||
JSClassID kv_historical_class_id = 0;
|
||||
JSClassID kv_map_handle_class_id = 0;
|
||||
JSClassID node_class_id = 0;
|
||||
JSClassID network_class_id = 0;
|
||||
JSClassID rpc_class_id = 0;
|
||||
JSClassID host_class_id = 0;
|
||||
JSClassID consensus_class_id = 0;
|
||||
JSClassID historical_class_id = 0;
|
||||
JSClassID historical_state_class_id = 0;
|
||||
|
||||
JSClassDef kv_map_handle_class_def = {};
|
||||
JSClassDef kv_historical_map_handle_class_def = {};
|
||||
JSClassDef node_class_def = {};
|
||||
JSClassDef network_class_def = {};
|
||||
JSClassDef rpc_class_def = {};
|
||||
JSClassDef host_class_def = {};
|
||||
JSClassDef consensus_class_def = {};
|
||||
JSClassDef historical_class_def = {};
|
||||
JSClassDef historical_state_class_def = {};
|
||||
|
||||
void register_class_ids()
|
||||
{
|
||||
|
@ -36,26 +22,5 @@ namespace ccf::js
|
|||
|
||||
JS_NewClassID(&kv_map_handle_class_id);
|
||||
kv_map_handle_class_def.class_name = "KV Map Handle";
|
||||
|
||||
JS_NewClassID(&node_class_id);
|
||||
node_class_def.class_name = "Node";
|
||||
|
||||
JS_NewClassID(&network_class_id);
|
||||
network_class_def.class_name = "Network";
|
||||
|
||||
JS_NewClassID(&rpc_class_id);
|
||||
rpc_class_def.class_name = "RPC";
|
||||
|
||||
JS_NewClassID(&host_class_id);
|
||||
host_class_def.class_name = "Host";
|
||||
|
||||
JS_NewClassID(&consensus_class_id);
|
||||
consensus_class_def.class_name = "Consensus";
|
||||
|
||||
JS_NewClassID(&historical_class_id);
|
||||
historical_class_def.class_name = "Historical";
|
||||
|
||||
JS_NewClassID(&historical_state_class_id);
|
||||
historical_state_class_def.class_name = "HistoricalState";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,24 +9,11 @@ namespace ccf::js
|
|||
extern JSClassID kv_class_id;
|
||||
extern JSClassID kv_historical_class_id;
|
||||
extern JSClassID kv_map_handle_class_id;
|
||||
extern JSClassID node_class_id;
|
||||
extern JSClassID network_class_id;
|
||||
extern JSClassID rpc_class_id;
|
||||
extern JSClassID host_class_id;
|
||||
extern JSClassID consensus_class_id;
|
||||
extern JSClassID historical_class_id;
|
||||
extern JSClassID historical_state_class_id;
|
||||
|
||||
extern JSClassDef kv_class_def;
|
||||
extern JSClassDef kv_historical_class_def;
|
||||
extern JSClassDef kv_map_handle_class_def;
|
||||
extern JSClassDef kv_historical_map_handle_class_def;
|
||||
extern JSClassDef node_class_def;
|
||||
extern JSClassDef network_class_def;
|
||||
extern JSClassDef rpc_class_def;
|
||||
extern JSClassDef host_class_def;
|
||||
extern JSClassDef consensus_class_def;
|
||||
extern JSClassDef historical_class_def;
|
||||
extern JSClassDef historical_state_class_def;
|
||||
|
||||
// Not thread-safe, must happen exactly once
|
||||
|
|
Загрузка…
Ссылка в новой задаче