Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 18599bfe51b4fe7bc917b2220181544307048244..2371efcbd5305f6c67ed152831d46593f7c5aa53 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -3008,19 +3008,7 @@ 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 js_obj->map()->instance_type() == i::JS_ERROR_TYPE; |
jochen (gone - plz use gerrit)
2016/06/23 14:42:15
why not just
auto self = Utils::OpenHandle(this)
|
} |