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

Unified Diff: src/objects.cc

Issue 2090333002: Use instance type in Object::IsErrorObject(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@RefactorToString
Patch Set: Rebase Created 4 years, 6 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 | « no previous file | no next file » | 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 e52c8c05b0af947ffd5e7bca25e3445f4d6babf8..a91ea0499c94dd352a88d800ff991200e21c14c9 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1291,12 +1291,8 @@ 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();
+ Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(object);
Toon Verwaest 2016/06/23 12:04:39 since you know it's a JSObject, you might as well
Franzi 2016/06/23 14:10:19 Done.
+ return receiver->map()->instance_type() == JS_ERROR_TYPE;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698