Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: src/messages.cc

Issue 1309673003: Small MessageLocation related refactoring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: keep old default values Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 908ee08e4bc7793cd4d5ed5fd91fcfb08f9f3e39..fd10d45d4a02c59f9c43dc5b1a9c7f4c446bf289 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -33,17 +33,20 @@ void MessageHandler::DefaultMessageReport(Isolate* isolate,
Handle<JSMessageObject> MessageHandler::MakeMessageObject(
- Isolate* isolate, MessageTemplate::Template message, MessageLocation* loc,
- Handle<Object> argument, Handle<JSArray> stack_frames) {
+ Isolate* isolate, MessageTemplate::Template message,
+ MessageLocation* location, Handle<Object> argument,
+ Handle<JSArray> stack_frames) {
Factory* factory = isolate->factory();
- int start = 0;
- int end = 0;
+ int start = -1;
+ int end = -1;
Handle<Object> script_handle = factory->undefined_value();
- if (loc) {
- start = loc->start_pos();
- end = loc->end_pos();
- script_handle = Script::GetWrapper(loc->script());
+ if (location != NULL) {
+ start = location->start_pos();
+ end = location->end_pos();
+ script_handle = Script::GetWrapper(location->script());
+ } else {
+ script_handle = Script::GetWrapper(isolate->factory()->empty_script());
}
Handle<Object> stack_frames_handle = stack_frames.is_null()
« no previous file with comments | « src/messages.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698