File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -946,6 +946,11 @@ class Value : public Data {
946
946
*/
947
947
V8EXPORT bool IsRegExp () const ;
948
948
949
+ /* *
950
+ * Returns true if this value is an Error.
951
+ */
952
+ V8EXPORT bool IsError () const ;
953
+
949
954
V8EXPORT Local<Boolean> ToBoolean () const ;
950
955
V8EXPORT Local<Number> ToNumber () const ;
951
956
V8EXPORT Local<String> ToString () const ;
Original file line number Diff line number Diff line change @@ -2113,6 +2113,12 @@ bool Value::IsRegExp() const {
2113
2113
return obj->IsJSRegExp ();
2114
2114
}
2115
2115
2116
+ bool Value::IsError () const {
2117
+ if (IsDeadCheck (i::Isolate::Current (), " v8::Value::IsError()" )) return false ;
2118
+ i::Handle<i::Object> obj = Utils::OpenHandle (this );
2119
+ return obj->HasSpecificClassOf (HEAP->Error_symbol ());
2120
+ }
2121
+
2116
2122
2117
2123
Local<String> Value::ToString () const {
2118
2124
i::Handle<i::Object> obj = Utils::OpenHandle (this );
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ inline Heap* _inline_get_heap_();
169
169
V (string_symbol, " string" ) \
170
170
V (String_symbol, " String" ) \
171
171
V (Date_symbol, " Date" ) \
172
+ V (Error_symbol, " Error" ) \
172
173
V (this_symbol, " this" ) \
173
174
V (to_string_symbol, " toString" ) \
174
175
V (char_at_symbol, " CharAt" ) \
You can’t perform that action at this time.
0 commit comments