@@ -533,13 +533,20 @@ void MetadataNode::SetInstanceMembersFromStaticMetadata(Isolate *isolate, Local<
533
533
534
534
auto funcData = External::New (isolate, callbackData);
535
535
auto funcTemplate = FunctionTemplate::New (isolate, MethodCallback, funcData);
536
- auto func = funcTemplate->GetFunction ();
537
- auto funcName = ArgConverter::ConvertToV8String (isolate, entry.name );
536
+ auto funcName = ArgConverter::ConvertToV8String (isolate, entry.name );
538
537
539
- Local<Function> wrappedFunc = Wrap (isolate, func, entry.name , origin, false /* isCtorFunc */ );
540
- // prototypeTemplate->Set(funcName, Wrap(isolate, func, entry.name, origin, false /* isCtorFunc */));
538
+ if (s_profilerEnabled)
539
+ {
540
+ auto func = funcTemplate->GetFunction ();
541
+ Local<Function> wrappedFunc = Wrap (isolate, func, entry.name , origin, false /* isCtorFunc */ );
542
+ prototypeTemplate->SetAccessor (funcName, WrappedFunctionGetterCallback, 0 , wrappedFunc);
543
+ }
544
+ else
545
+ {
546
+ prototypeTemplate->Set (funcName, funcTemplate);
547
+ }
541
548
542
- prototypeTemplate->SetAccessor (funcName, WrappedFunctionGetterCallback, 0 , wrappedFunc );
549
+ // prototypeTemplate->Set (funcName, Wrap(isolate, func, entry.name, origin, false /* isCtorFunc */) );
543
550
544
551
lastMethodName = entry.name ;
545
552
}
@@ -1825,17 +1832,10 @@ Local<Function> MetadataNode::Wrap(Isolate* isolate, const Local<Function>& func
1825
1832
if (!result.IsEmpty ())
1826
1833
{
1827
1834
ret = result.As <Function>();
1828
- <<<<<<< d0f2ea1b050ce07b3bb9af9956d8400bc13383ea
1829
- ret->Set (ArgConverter::ConvertToV8String (isolate, " __func" ), f);
1835
+ ret->Set (ArgConverter::ConvertToV8String (isolate, " __func" ), function);
1830
1836
1831
1837
auto prototypePropName = V8StringConstants::GetPrototype (isolate);
1832
- ret->Set (prototypePropName, f->Get (prototypePropName));
1833
- =======
1834
- ret->Set (ConvertToV8String (" __func" ), function);
1835
-
1836
- auto prototypePropName = ConvertToV8String (" prototype" );
1837
1838
ret->Set (prototypePropName, function->Get (prototypePropName));
1838
- >>>>>>> return the wrapped function when property func name is get accessed
1839
1839
}
1840
1840
else
1841
1841
{
0 commit comments