From 4f3a8bd137bd5f2a0c6ce3f89de0b2361916e4c1 Mon Sep 17 00:00:00 2001 From: "mikhail.naganov@gmail.com" Date: Tue, 30 Aug 2011 18:45:48 +0000 Subject: [PATCH] Return v8::True or v8::False instead of using Boolean::New. BUG=None TEST=None R=mnaganov@chromium.org Signed-off-by: Thiago Farina Review URL: http://codereview.chromium.org/7785001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9073 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/d8.cc | 4 ++-- test/cctest/test-api.cc | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/d8.cc b/src/d8.cc index 120496ecc..025c77291 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -678,9 +678,9 @@ Handle Shell::CreateGlobalTemplate() { FunctionTemplate::New(PixelArray)); #ifdef LIVE_OBJECT_LIST - global_template->Set(String::New("lol_is_enabled"), Boolean::New(true)); + global_template->Set(String::New("lol_is_enabled"), True()); #else - global_template->Set(String::New("lol_is_enabled"), Boolean::New(false)); + global_template->Set(String::New("lol_is_enabled"), False()); #endif #ifndef V8_SHARED diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index f2af81eb7..c0b8a4e01 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -823,7 +823,7 @@ static void* expected_ptr; static v8::Handle callback(const v8::Arguments& args) { void* ptr = v8::External::Unwrap(args.Data()); CHECK_EQ(expected_ptr, ptr); - return v8::Boolean::New(true); + return v8::True(); } @@ -2609,7 +2609,7 @@ v8::Handle ThrowFromC(const v8::Arguments& args) { v8::Handle CCatcher(const v8::Arguments& args) { - if (args.Length() < 1) return v8::Boolean::New(false); + if (args.Length() < 1) return v8::False(); v8::HandleScope scope; v8::TryCatch try_catch; Local result = v8::Script::Compile(args[0]->ToString())->Run(); @@ -7296,7 +7296,7 @@ THREADED_TEST(ConstructorForObject) { CHECK(value->IsBoolean()); CHECK_EQ(true, value->BooleanValue()); - Handle args3[] = { v8::Boolean::New(true) }; + Handle args3[] = { v8::True() }; Local value_obj3 = instance->CallAsConstructor(1, args3); CHECK(value_obj3->IsObject()); Local object3 = Local::Cast(value_obj3); @@ -9567,10 +9567,7 @@ THREADED_TEST(Overriding) { static v8::Handle IsConstructHandler(const v8::Arguments& args) { ApiTestFuzzer::Fuzz(); - if (args.IsConstructCall()) { - return v8::Boolean::New(true); - } - return v8::Boolean::New(false); + return v8::Boolean::New(args.IsConstructCall()); } -- 2.34.1