diff options
-rw-r--r-- | src/3rdparty/v8/include/v8.h | 5 | ||||
-rw-r--r-- | src/3rdparty/v8/src/api.cc | 6 | ||||
-rw-r--r-- | src/3rdparty/v8/src/heap.h | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/3rdparty/v8/include/v8.h b/src/3rdparty/v8/include/v8.h index 229ddbd..d995e54 100644 --- a/src/3rdparty/v8/include/v8.h +++ b/src/3rdparty/v8/include/v8.h @@ -967,6 +967,11 @@ class Value : public Data { */ V8EXPORT bool IsRegExp() const; + /** + * Returns true if this value is an Error. + */ + V8EXPORT bool IsError() const; + V8EXPORT Local<Boolean> ToBoolean() const; V8EXPORT Local<Number> ToNumber() const; V8EXPORT Local<String> ToString() const; diff --git a/src/3rdparty/v8/src/api.cc b/src/3rdparty/v8/src/api.cc index d31ff9a..9f42ff9 100644 --- a/src/3rdparty/v8/src/api.cc +++ b/src/3rdparty/v8/src/api.cc @@ -2316,6 +2316,12 @@ bool Value::IsRegExp() const { return obj->IsJSRegExp(); } +bool Value::IsError() const { + if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsError()")) return false; + i::Handle<i::Object> obj = Utils::OpenHandle(this); + return obj->HasSpecificClassOf(HEAP->Error_symbol()); +} + Local<String> Value::ToString() const { i::Handle<i::Object> obj = Utils::OpenHandle(this); diff --git a/src/3rdparty/v8/src/heap.h b/src/3rdparty/v8/src/heap.h index 5e90964..6166cde 100644 --- a/src/3rdparty/v8/src/heap.h +++ b/src/3rdparty/v8/src/heap.h @@ -190,6 +190,7 @@ inline Heap* _inline_get_heap_(); V(string_symbol, "string") \ V(String_symbol, "String") \ V(Date_symbol, "Date") \ + V(Error_symbol, "Error") \ V(this_symbol, "this") \ V(to_string_symbol, "toString") \ V(char_at_symbol, "CharAt") \ |