@@ -280,6 +280,7 @@ Handle<Object> MetadataNode::CreateClassProxy(Isolate *isolate)
280
280
bool success = classProxyFunction->SetPrototype (instance); // this is needed for static functions like so: var MyButton = Button.extends(); MyButton.StaticMethod();
281
281
ASSERT_MESSAGE (success, " CreateClassProxy: SetPrototype failed" );
282
282
V8SetHiddenValue (classProxyFunction, METADATA_NODE_KEY_NAME, external);
283
+ V8SetHiddenValue (classProxyFunction, CLASS_PROXY, Boolean::New (isolate, true ));
283
284
284
285
success = classProxyFunction->SetHiddenValue (V8StringConstants::GetTSuper (), Boolean::New (isolate, true ));
285
286
ASSERT_MESSAGE (success, " CreateClassProxy: mark classProxyFunction as super object failed" );
@@ -625,6 +626,12 @@ void MetadataNode::GetterCallback(Local<String> property, const PropertyCallback
625
626
uint8_t nodeType = s_metadataReader.GetNodeType (node->m_treeNode );
626
627
627
628
auto superValue = thiz->GetHiddenValue (V8StringConstants::GetTSuper ());
629
+ if (propName == V8StringConstants::TO_STRING)
630
+ {
631
+ auto classProxy = V8GetHiddenValue (thiz, CLASS_PROXY);
632
+ if (!classProxy.IsEmpty ())
633
+ return ;
634
+ }
628
635
bool shouldCallJSOverrideWithoutGoingToJava = !thiz.IsEmpty () && propName != V8StringConstants::TO_STRING && !isMarkedAsSuper;
629
636
if (shouldCallJSOverrideWithoutGoingToJava)
630
637
{
@@ -1482,6 +1489,7 @@ CallJavaMethodCallback MetadataNode::s_callJavaMethod = nullptr;
1482
1489
RegisterInstanceCallback MetadataNode::s_registerInstance = nullptr ;
1483
1490
GetTypeMetadataCallback MetadataNode::s_getTypeMetadata = nullptr ;
1484
1491
string MetadataNode::METADATA_NODE_KEY_NAME = " t::MetadataNode" ;
1492
+ string MetadataNode::CLASS_PROXY = " t::ClassProxy" ;
1485
1493
string MetadataNode::TNS_PREFIX = " com/tns/" ;
1486
1494
string MetadataNode::TNS_TESTS_PREFIX = " com/tns/tests/" ;
1487
1495
MetadataReader MetadataNode::s_metadataReader;
0 commit comments