29
29
#include < map>
30
30
31
31
namespace tns {
32
- class MetadataNode {
32
+ class MetadataNode {
33
33
public:
34
34
static void Init (v8::Isolate* isolate);
35
35
@@ -129,6 +129,10 @@ namespace tns {
129
129
static bool GetExtendLocation (std::string& extendLocation, bool isTypeScriptExtend);
130
130
static ExtendedClassCacheData GetCachedExtendedClassData (v8::Isolate* isolate, const std::string& proxyClassName);
131
131
132
+ static void RegisterSymbolHasInstanceCallback (v8::Isolate* isolate, MetadataEntry entry, v8::Local<v8::Value> interface);
133
+ static void SymbolHasInstanceCallback (const v8::FunctionCallbackInfo<v8::Value>& info);
134
+ static std::string GetJniClassName (MetadataEntry entry);
135
+
132
136
v8::Local<v8::Function> Wrap (v8::Isolate* isolate, const v8::Local<v8::Function>& function, const std::string& name, const std::string& origin, bool isCtorFunc);
133
137
134
138
bool CheckClassHierarchy (JEnv& env, jclass currentClass, MetadataTreeNode* curentTreeNode, MetadataTreeNode* baseTreeNode, std::vector<MetadataTreeNode*>& skippedBaseTypes);
@@ -150,13 +154,13 @@ namespace tns {
150
154
151
155
struct MethodCallbackData {
152
156
MethodCallbackData ()
153
- :
154
- node (nullptr ), parent(nullptr ), isSuper(false ) {
157
+ :
158
+ node (nullptr ), parent(nullptr ), isSuper(false ) {
155
159
}
156
160
157
161
MethodCallbackData (MetadataNode* _node)
158
- :
159
- node (_node), parent(nullptr ), isSuper(false ) {
162
+ :
163
+ node (_node), parent(nullptr ), isSuper(false ) {
160
164
}
161
165
162
166
std::vector<MetadataEntry> candidates;
@@ -167,8 +171,8 @@ namespace tns {
167
171
168
172
struct ExtendedClassCallbackData {
169
173
ExtendedClassCallbackData (MetadataNode* _node, const std::string& _extendedName, const v8::Local<v8::Object>& _implementationObject, std::string _fullClassName)
170
- :
171
- node (_node), extendedName(_extendedName), fullClassName(_fullClassName) {
174
+ :
175
+ node (_node), extendedName(_extendedName), fullClassName(_fullClassName) {
172
176
implementationObject = new v8::Persistent<v8::Object>(_implementationObject->GetIsolate (), _implementationObject);
173
177
}
174
178
@@ -181,17 +185,17 @@ namespace tns {
181
185
182
186
struct TypeMetadata {
183
187
TypeMetadata (const std::string& _name)
184
- :
185
- name (_name) {
188
+ :
189
+ name (_name) {
186
190
}
187
191
188
192
std::string name;
189
193
};
190
194
191
195
struct CtorCacheData {
192
196
CtorCacheData (v8::Persistent<v8::FunctionTemplate>* _ft, std::vector<MethodCallbackData*> _instanceMethodCallbacks)
193
- :
194
- ft (_ft), instanceMethodCallbacks(_instanceMethodCallbacks) {
197
+ :
198
+ ft (_ft), instanceMethodCallbacks(_instanceMethodCallbacks) {
195
199
}
196
200
197
201
v8::Persistent<v8::FunctionTemplate>* ft;
@@ -200,12 +204,12 @@ namespace tns {
200
204
201
205
struct ExtendedClassCacheData {
202
206
ExtendedClassCacheData ()
203
- :
204
- extendedCtorFunction (nullptr ), node(nullptr ) {
207
+ :
208
+ extendedCtorFunction (nullptr ), node(nullptr ) {
205
209
}
206
210
ExtendedClassCacheData (const v8::Local<v8::Function>& extCtorFunc, const std::string& _extendedName, MetadataNode* _node)
207
- :
208
- extendedName (_extendedName), node(_node) {
211
+ :
212
+ extendedName (_extendedName), node(_node) {
209
213
extendedCtorFunction = new v8::Persistent<v8::Function>(extCtorFunc->GetIsolate (), extCtorFunc);
210
214
}
211
215
v8::Persistent<v8::Function>* extendedCtorFunction;
@@ -220,5 +224,5 @@ namespace tns {
220
224
221
225
std::map<std::string, MetadataNode::ExtendedClassCacheData> ExtendedCtorFuncCache;
222
226
};
223
- };
227
+ };
224
228
}
0 commit comments