Reviewers: loislo, Yang,

Description:
Rename v8::Exception::GetMessage to CreateMessage.

This is to avoid renaming to GetMessageW/GetMessageA on Windows.

API=v8::Exception::CreateMessage
[email protected], loislo
LOG=Y

Please review this at https://codereview.chromium.org/711353002/

Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+7, -9 lines):
  M include/v8.h
  M src/api.cc
  M test/cctest/test-api.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index ddae1ed229314b7623bc110be862f140aed8ed06..29884f3c0f32dbe55cb494cc49d74aa253aeaf0c 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4188,9 +4188,7 @@ class V8_EXPORT Exception {
   static Local<Value> TypeError(Handle<String> message);
   static Local<Value> Error(Handle<String> message);

-  static Local<Message> GetMessage(Handle<Value> exception);
-
-  // DEPRECATED. Use GetMessage()->GetStackTrace()
+  static Local<Message> CreateMessage(Handle<Value> exception);
   static Local<StackTrace> GetStackTrace(Handle<Value> exception);
 };

@@ -4252,7 +4250,7 @@ class PromiseRejectMessage {
   V8_INLINE PromiseRejectEvent GetEvent() const { return event_; }
   V8_INLINE Handle<Value> GetValue() const { return value_; }

-  // DEPRECATED. Use v8::Exception::GetMessage(GetValue())->GetStackTrace()
+ // DEPRECATED. Use v8::Exception::CreateMessage(GetValue())->GetStackTrace() V8_INLINE Handle<StackTrace> GetStackTrace() const { return stack_trace_; }

  private:
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 7380cc447e46f8a8aa6654458b11603fdcfdcb1f..157d9139de76130377b28f71ed564dfe4519d08c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6986,7 +6986,7 @@ DEFINE_ERROR(Error)
 #undef DEFINE_ERROR


-Local<Message> Exception::GetMessage(Handle<Value> exception) {
+Local<Message> Exception::CreateMessage(Handle<Value> exception) {
   i::Handle<i::Object> obj = Utils::OpenHandle(*exception);
   if (!obj->IsHeapObject()) return Local<Message>();
   i::Isolate* isolate = i::HeapObject::cast(*obj)->GetIsolate();
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index d4fbb046bff4397fd75db55754cdecc9dd99075a..50dfa3ae8a20b87bf576f388200e1d4d4d8ac3f2 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -8635,7 +8635,7 @@ static void ThrowV8Exception(const v8::FunctionCallbackInfo<v8::Value>& info) {
 }


-THREADED_TEST(ExceptionGetMessage) {
+THREADED_TEST(ExceptionCreateMessage) {
   LocalContext context;
   v8::HandleScope scope(context->GetIsolate());
   v8::Handle<String> foo_str = v8_str("foo");
@@ -8660,7 +8660,7 @@ THREADED_TEST(ExceptionGetMessage) {
   CHECK(error->IsObject());
   CHECK(error.As<v8::Object>()->Get(message_str)->Equals(foo_str));

-  v8::Handle<v8::Message> message = v8::Exception::GetMessage(error);
+  v8::Handle<v8::Message> message = v8::Exception::CreateMessage(error);
   CHECK(!message.IsEmpty());
   CHECK_EQ(2, message->GetLineNumber());
   CHECK_EQ(2, message->GetStartColumn());
@@ -8686,7 +8686,7 @@ THREADED_TEST(ExceptionGetMessage) {
   CHECK(error->IsObject());
   CHECK(error.As<v8::Object>()->Get(message_str)->Equals(foo_str));

-  message = v8::Exception::GetMessage(error);
+  message = v8::Exception::CreateMessage(error);
   CHECK(!message.IsEmpty());
   CHECK_EQ(2, message->GetLineNumber());
   CHECK_EQ(9, message->GetStartColumn());
@@ -18022,7 +18022,7 @@ void PromiseRejectCallback(v8::PromiseRejectMessage message) {
     CcTest::global()->Set(v8_str("rejected"), message.GetPromise());
     CcTest::global()->Set(v8_str("value"), message.GetValue());
     v8::Handle<v8::StackTrace> stack_trace =
-        v8::Exception::GetMessage(message.GetValue())->GetStackTrace();
+        v8::Exception::CreateMessage(message.GetValue())->GetStackTrace();
     if (!stack_trace.IsEmpty()) {
       promise_reject_frame_count = stack_trace->GetFrameCount();
       if (promise_reject_frame_count > 0) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to