Avoid explicitly using built-in new operator where possible to appease Windows build.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 18 Nov 2011 11:08:46 +0000 (11:08 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 18 Nov 2011 11:08:46 +0000 (11:08 +0000)
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
src/extensions/gc-extension.cc
src/hashmap.cc
src/scopes.cc

index 4376df62c6460b3efa4509f71b63db7d3d538391..ef55d54abd73f8b65e357461af6022b27b953f1d 100644 (file)
@@ -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
   };
index 238e305f3db712cbbb748dcec385077253b5516f..54c8cdc0c80bf0ac57fb78c19868f7c90c7fa45b 100644 (file)
@@ -46,7 +46,8 @@ v8::Handle<v8::Value> 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);
 }
 
index 0b404a97e18667830198c2527ce86a792d751a82..20118a74f488cc15b925a095fa0dba232bb45165 100644 (file)
@@ -36,7 +36,7 @@
 namespace v8 {
 namespace internal {
 
-Allocator* HashMap::DefaultAllocator = ::new Allocator();
+Allocator* HashMap::DefaultAllocator = new Allocator();
 
 
 HashMap::HashMap(MatchFun match,
index 60ea20f16d5ed94f8e8a6ab8f6e58db7aab1b4c6..224c1aed9d5ebb736b7fd6f7017d5df2607d31cc 100644 (file)
@@ -55,7 +55,7 @@ class ZoneAllocator: public Allocator {
 };
 
 
-static ZoneAllocator* LocalsMapAllocator = ::new ZoneAllocator();
+static ZoneAllocator* LocalsMapAllocator = new ZoneAllocator();
 
 
 // ----------------------------------------------------------------------------