Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
optimaze some type conversion
  • Loading branch information
aitbenmouh
aitbenmouh committed Mar 31, 2017
commit 84464c92d574fd4edf076c17fa8296f50076d58a
10 changes: 5 additions & 5 deletions src/async-wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void AsyncWrap::DestroyIdsCb(uv_idle_t* handle) {
// Want each callback to be cleaned up after itself, instead of cleaning
// them all up after the while() loop completes.
HandleScope scope(env->isolate());
Local<Value> argv = Number::New(env->isolate(), current_id);
Local<Value> argv = Number::New(env->isolate(), static_cast<double>(current_id));
MaybeLocal<Value> ret = fn->Call(
env->context(), Undefined(env->isolate()), 1, &argv);

Expand Down Expand Up @@ -260,7 +260,7 @@ AsyncWrap::AsyncWrap(Environment* env,
CHECK_GE(object->InternalFieldCount(), 1);

// Shift provider value over to prevent id collision.
persistent().SetWrapperClassId(NODE_ASYNC_ID_OFFSET + provider);
persistent().SetWrapperClassId(static_cast<uint16_t>(NODE_ASYNC_ID_OFFSET + provider));

Local<Function> init_fn = env->async_hooks_init_function();

Expand All @@ -277,14 +277,14 @@ AsyncWrap::AsyncWrap(Environment* env,
HandleScope scope(env->isolate());

Local<Value> argv[] = {
Number::New(env->isolate(), get_uid()),
Number::New(env->isolate(), static_cast<double>(get_uid())),
Int32::New(env->isolate(), provider),
Null(env->isolate()),
Null(env->isolate())
};

if (parent != nullptr) {
argv[2] = Number::New(env->isolate(), parent->get_uid());
argv[2] = Number::New(env->isolate(), static_cast<double>(parent->get_uid()));
argv[3] = parent->object();
}

Expand Down Expand Up @@ -320,7 +320,7 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,

Local<Function> pre_fn = env()->async_hooks_pre_function();
Local<Function> post_fn = env()->async_hooks_post_function();
Local<Value> uid = Number::New(env()->isolate(), get_uid());
Local<Value> uid = Number::New(env()->isolate(), static_cast<double>(get_uid()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend against changing these things here, there would be quite a few conflicts with #11883

Local<Object> context = object();
Local<Object> domain;
bool has_domain = false;
Expand Down