From 5c23e4e57a0f9f32c6650d9b42a7132b7665e11e Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Fri, 18 Nov 2011 11:08:46 +0000 Subject: [PATCH] Avoid explicitly using built-in new operator where possible to appease Windows build. Review URL: http://codereview.chromium.org/8561011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/elements.cc | 2 +- src/extensions/gc-extension.cc | 3 ++- src/hashmap.cc | 2 +- src/scopes.cc | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/elements.cc b/src/elements.cc index 4376df6..ef55d54 100644 --- a/src/elements.cc +++ b/src/elements.cc @@ -827,7 +827,7 @@ void ElementsAccessor::InitializeOncePerProcess() { ELEMENTS_LIST(ACCESSOR_STRUCT) #undef ACCESSOR_STRUCT } element_accessors = { -#define ACCESSOR_INIT(Class, Name) ::new Class(), +#define ACCESSOR_INIT(Class, Name) new Class(), ELEMENTS_LIST(ACCESSOR_INIT) #undef ACCESSOR_INIT }; diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc index 238e305..54c8cdc 100644 --- a/src/extensions/gc-extension.cc +++ b/src/extensions/gc-extension.cc @@ -46,7 +46,8 @@ v8::Handle GCExtension::GC(const v8::Arguments& args) { void GCExtension::Register() { - static GCExtension* gc_extension = ::new GCExtension(); + static GCExtension* gc_extension = NULL; + if (gc_extension == NULL) gc_extension = new GCExtension(); static v8::DeclareExtension gc_extension_declaration(gc_extension); } diff --git a/src/hashmap.cc b/src/hashmap.cc index 0b404a9..20118a7 100644 --- a/src/hashmap.cc +++ b/src/hashmap.cc @@ -36,7 +36,7 @@ namespace v8 { namespace internal { -Allocator* HashMap::DefaultAllocator = ::new Allocator(); +Allocator* HashMap::DefaultAllocator = new Allocator(); HashMap::HashMap(MatchFun match, diff --git a/src/scopes.cc b/src/scopes.cc index 60ea20f..224c1ae 100644 --- a/src/scopes.cc +++ b/src/scopes.cc @@ -55,7 +55,7 @@ class ZoneAllocator: public Allocator { }; -static ZoneAllocator* LocalsMapAllocator = ::new ZoneAllocator(); +static ZoneAllocator* LocalsMapAllocator = new ZoneAllocator(); // ---------------------------------------------------------------------------- -- 2.7.4