Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: create test objects in the stack instead of the heap #371

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
test: create test objects in the stack instead of the heap
  • Loading branch information
nadongguri committed Oct 16, 2018
commit 619d0c182f43e2a4a7bae6932c9316e9625ac688
4 changes: 2 additions & 2 deletions test/basic_types/boolean.cc
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ Value CreateEmptyBoolean(const CallbackInfo& info) {
}

Value CreateBooleanFromExistingValue(const CallbackInfo& info) {
Boolean* boolean = new Boolean(info.Env(), info[0].As<Boolean>());
return Boolean::New(info.Env(), boolean->Value());
Boolean boolean(info.Env(), info[0].As<Boolean>());
return Boolean::New(info.Env(), boolean.Value());
}

Value CreateBooleanFromPrimitive(const CallbackInfo& info) {
4 changes: 2 additions & 2 deletions test/basic_types/number.cc
Original file line number Diff line number Diff line change
@@ -67,8 +67,8 @@ Value OperatorDouble(const CallbackInfo& info) {
}

Value CreateEmptyNumber(const CallbackInfo& info) {
Number* number = new Number();
return Boolean::New(info.Env(), number->IsEmpty());
Number number;
return Boolean::New(info.Env(), number.IsEmpty());
}

Value CreateNumberFromExistingValue(const CallbackInfo& info) {