Index: src/messages.cc |
diff --git a/src/messages.cc b/src/messages.cc |
index 290f756770c7d4b287ee2f5ce6d5b2326b7fe521..cf061ee5f6b2c790a8149b23ee10a016e950b02d 100644 |
--- a/src/messages.cc |
+++ b/src/messages.cc |
@@ -34,10 +34,8 @@ void MessageHandler::DefaultMessageReport(Isolate* isolate, |
Handle<JSMessageObject> MessageHandler::MakeMessageObject( |
- Isolate* isolate, |
- const char* type, |
- MessageLocation* loc, |
- Vector< Handle<Object> > args, |
+ Isolate* isolate, const char* type, MessageLocation* loc, |
+ Vector<Handle<Object> > args, Handle<JSObject> promise, |
Handle<JSArray> stack_frames) { |
Factory* factory = isolate->factory(); |
Handle<String> type_handle = factory->InternalizeUtf8String(type); |
@@ -62,13 +60,13 @@ Handle<JSMessageObject> MessageHandler::MakeMessageObject( |
? Handle<Object>::cast(factory->undefined_value()) |
: Handle<Object>::cast(stack_frames); |
- Handle<JSMessageObject> message = |
- factory->NewJSMessageObject(type_handle, |
- arguments_handle, |
- start, |
- end, |
- script_handle, |
- stack_frames_handle); |
+ Handle<Object> promise_handle = |
+ promise.is_null() ? Handle<Object>::cast(factory->undefined_value()) |
+ : Handle<Object>::cast(promise); |
+ |
+ Handle<JSMessageObject> message = factory->NewJSMessageObject( |
+ type_handle, arguments_handle, promise_handle, start, end, script_handle, |
+ stack_frames_handle); |
return message; |
} |