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

Unified Diff: src/objects.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
« src/messages.cc ('K') | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 3e5bd4300e121fd9ffa35886a9ce4a60eb46c4b0..279ed1dbaaaa44297afcba33d4cb35e1d7707342 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1163,6 +1163,18 @@ Maybe<bool> Object::SetPropertyWithDefinedSetter(Handle<Object> receiver,
// static
+bool Object::IsErrorObject(Isolate* isolate, Handle<Object> object) {
+ if (!object->IsJSObject()) return false;
+ // Use stack_trace_symbol as proxy for [[ErrorData]].
+ Handle<Name> symbol = isolate->factory()->stack_trace_symbol();
+ Maybe<bool> has_stack_trace =
+ JSReceiver::HasOwnProperty(Handle<JSReceiver>::cast(object), symbol);
+ DCHECK(!has_stack_trace.IsNothing());
+ return has_stack_trace.FromJust();
+}
+
+
+// static
bool JSObject::AllCanRead(LookupIterator* it) {
// Skip current iteration, it's in state ACCESS_CHECK or INTERCEPTOR, both of
// which have already been checked.
« src/messages.cc ('K') | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698