Permalink
Browse files

util, feat: save sync function name to fiber stack.

  • Loading branch information...
xicilion committed Oct 15, 2017
1 parent c3092d0 commit 39145217bce9c939b8fe30a438ab044797a64e12
Showing with 7 additions and 3 deletions.
  1. +7 −3 fibjs/src/util/util_sync.cpp
@@ -34,13 +34,11 @@ static void sync_stub(const v8::FunctionCallbackInfo<v8::Value>& args)
{
Isolate* isolate = Isolate::current();
obj_ptr<Event_base> ev = new Event();
v8::Local<v8::Object> _data = v8::Object::New(isolate->m_isolate);
std::vector<v8::Local<v8::Value>> argv;
_data->Set(isolate->NewString("_ev"), ev->wrap());
std::vector<v8::Local<v8::Value>> argv;
int32_t len = args.Length();
int32_t i;
@@ -52,6 +50,12 @@ static void sync_stub(const v8::FunctionCallbackInfo<v8::Value>& args)
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(args.Data());
exlib::string str("util.sync(");
str += *v8::String::Utf8Value(func->GetName());
str += ")";
METHOD_NAME(str.c_str());
v8::Local<v8::Value> result = func->Call(args.This(), (int32_t)argv.size(), argv.data());
if (result.IsEmpty())
return;

0 comments on commit 3914521

Please sign in to comment.