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

Unified Diff: src/api.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 | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 18599bfe51b4fe7bc917b2220181544307048244..77ea4c3200104d5cb514af8ce50ca37d838cf076 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3005,22 +3005,7 @@ bool Value::IsUint32() const {
bool Value::IsNativeError() const {
- i::Handle<i::Object> obj = Utils::OpenHandle(this);
- if (!obj->IsJSObject()) return false;
- i::Handle<i::JSObject> js_obj = i::Handle<i::JSObject>::cast(obj);
- i::Isolate* isolate = js_obj->GetIsolate();
- i::Handle<i::Object> constructor(js_obj->map()->GetConstructor(), isolate);
- if (!constructor->IsJSFunction()) return false;
- i::Handle<i::JSFunction> function =
- i::Handle<i::JSFunction>::cast(constructor);
- if (!function->shared()->native()) return false;
- return function.is_identical_to(isolate->error_function()) ||
- function.is_identical_to(isolate->eval_error_function()) ||
- function.is_identical_to(isolate->range_error_function()) ||
- function.is_identical_to(isolate->reference_error_function()) ||
- function.is_identical_to(isolate->syntax_error_function()) ||
- function.is_identical_to(isolate->type_error_function()) ||
- function.is_identical_to(isolate->uri_error_function());
+ return Utils::OpenHandle(this)->IsJSError();
}
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698