Commit acd67bf4 by Marcin Cieslak

Nan::ReturnValue.Set() needs no Nan::New on primitive types

For bool, double, [u]int32_t there is no need to wrap
a returned value in Nan::New()

https://github.com/nodejs/nan/blob/master/doc/methods.md#api_nan_return_value
parent d96ad377
...@@ -262,7 +262,7 @@ NAN_METHOD(render_sync) { ...@@ -262,7 +262,7 @@ NAN_METHOD(render_sync) {
sass_free_context_wrapper(ctx_w); sass_free_context_wrapper(ctx_w);
info.GetReturnValue().Set(Nan::New<v8::Boolean>(result == 0)); info.GetReturnValue().Set(result == 0);
} }
NAN_METHOD(render_file) { NAN_METHOD(render_file) {
...@@ -297,7 +297,7 @@ NAN_METHOD(render_file_sync) { ...@@ -297,7 +297,7 @@ NAN_METHOD(render_file_sync) {
free(input_path); free(input_path);
sass_free_context_wrapper(ctx_w); sass_free_context_wrapper(ctx_w);
info.GetReturnValue().Set(Nan::New<v8::Boolean>(result == 0)); info.GetReturnValue().Set(result == 0);
} }
NAN_METHOD(libsass_version) { NAN_METHOD(libsass_version) {
......
...@@ -62,19 +62,19 @@ namespace SassTypes ...@@ -62,19 +62,19 @@ namespace SassTypes
} }
NAN_METHOD(Color::GetR) { NAN_METHOD(Color::GetR) {
info.GetReturnValue().Set(Nan::New(sass_color_get_r(unwrap(info.This())->value))); info.GetReturnValue().Set(sass_color_get_r(unwrap(info.This())->value));
} }
NAN_METHOD(Color::GetG) { NAN_METHOD(Color::GetG) {
info.GetReturnValue().Set(Nan::New(sass_color_get_g(unwrap(info.This())->value))); info.GetReturnValue().Set(sass_color_get_g(unwrap(info.This())->value));
} }
NAN_METHOD(Color::GetB) { NAN_METHOD(Color::GetB) {
info.GetReturnValue().Set(Nan::New(sass_color_get_b(unwrap(info.This())->value))); info.GetReturnValue().Set(sass_color_get_b(unwrap(info.This())->value));
} }
NAN_METHOD(Color::GetA) { NAN_METHOD(Color::GetA) {
info.GetReturnValue().Set(Nan::New(sass_color_get_a(unwrap(info.This())->value))); info.GetReturnValue().Set(sass_color_get_a(unwrap(info.This())->value));
} }
NAN_METHOD(Color::SetR) { NAN_METHOD(Color::SetR) {
......
...@@ -76,7 +76,7 @@ namespace SassTypes ...@@ -76,7 +76,7 @@ namespace SassTypes
} }
NAN_METHOD(List::GetSeparator) { NAN_METHOD(List::GetSeparator) {
info.GetReturnValue().Set(Nan::New(sass_list_get_separator(unwrap(info.This())->value) == SASS_COMMA)); info.GetReturnValue().Set(sass_list_get_separator(unwrap(info.This())->value) == SASS_COMMA);
} }
NAN_METHOD(List::SetSeparator) { NAN_METHOD(List::SetSeparator) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment