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

Side by Side Diff: src/isolate.cc

Issue 861623002: Add a pretty printer to improve the error message non-function calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/compiler.h ('k') | src/messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 StackTraceFrameIterator it(this); 1056 StackTraceFrameIterator it(this);
1057 if (!it.done()) { 1057 if (!it.done()) {
1058 JavaScriptFrame* frame = it.frame(); 1058 JavaScriptFrame* frame = it.frame();
1059 JSFunction* fun = frame->function(); 1059 JSFunction* fun = frame->function();
1060 Object* script = fun->shared()->script(); 1060 Object* script = fun->shared()->script();
1061 if (script->IsScript() && 1061 if (script->IsScript() &&
1062 !(Script::cast(script)->source()->IsUndefined())) { 1062 !(Script::cast(script)->source()->IsUndefined())) {
1063 int pos = frame->LookupCode()->SourcePosition(frame->pc()); 1063 int pos = frame->LookupCode()->SourcePosition(frame->pc());
1064 // Compute the location from the function and the reloc info. 1064 // Compute the location from the function and the reloc info.
1065 Handle<Script> casted_script(Script::cast(script)); 1065 Handle<Script> casted_script(Script::cast(script));
1066 *target = MessageLocation(casted_script, pos, pos + 1); 1066 *target = MessageLocation(casted_script, pos, pos + 1, handle(fun));
1067 } 1067 }
1068 } 1068 }
1069 } 1069 }
1070 1070
1071 1071
1072 bool Isolate::ComputeLocationFromStackTrace(MessageLocation* target, 1072 bool Isolate::ComputeLocationFromStackTrace(MessageLocation* target,
1073 Handle<Object> exception) { 1073 Handle<Object> exception) {
1074 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1); 1074 *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1);
1075 1075
1076 if (!exception->IsJSObject()) return false; 1076 if (!exception->IsJSObject()) return false;
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 if (prev_ && prev_->Intercept(flag)) return true; 2569 if (prev_ && prev_->Intercept(flag)) return true;
2570 // Then check whether this scope intercepts. 2570 // Then check whether this scope intercepts.
2571 if ((flag & intercept_mask_)) { 2571 if ((flag & intercept_mask_)) {
2572 intercepted_flags_ |= flag; 2572 intercepted_flags_ |= flag;
2573 return true; 2573 return true;
2574 } 2574 }
2575 return false; 2575 return false;
2576 } 2576 }
2577 2577
2578 } } // namespace v8::internal 2578 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698