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

Unified Diff: src/isolate.cc

Issue 1507273002: Make Error.prototype.toString spec compliant; and fix various side-effect-free error printing metho… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/isolate.h ('k') | src/js/messages.js » ('j') | src/messages.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index a3456c4600212a99cd1ec0eb3b9320f3e303b2ae..ed44793e0714d31056049310e7e47a334ab95fbe 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1348,22 +1348,11 @@ bool Isolate::ComputeLocationFromStackTrace(MessageLocation* target,
}
-// Use stack_trace_symbol as proxy for [[ErrorData]].
-bool Isolate::IsErrorObject(Handle<Object> object) {
- Handle<Name> symbol = factory()->stack_trace_symbol();
- if (!object->IsJSObject()) return false;
- Maybe<bool> has_stack_trace =
- JSReceiver::HasOwnProperty(Handle<JSReceiver>::cast(object), symbol);
- DCHECK(!has_stack_trace.IsNothing());
- return has_stack_trace.FromJust();
-}
-
-
Handle<JSMessageObject> Isolate::CreateMessage(Handle<Object> exception,
MessageLocation* location) {
Handle<JSArray> stack_trace_object;
if (capture_stack_trace_for_uncaught_exceptions_) {
- if (IsErrorObject(exception)) {
+ if (Object::IsErrorObject(this, exception)) {
// We fetch the stack trace that corresponds to this error object.
// If the lookup fails, the exception is probably not a valid Error
// object. In that case, we fall through and capture the stack trace
« no previous file with comments | « src/isolate.h ('k') | src/js/messages.js » ('j') | src/messages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698