diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-12-07 11:56:42 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-13 09:57:09 +0200 |
commit | 86c51f7835a350a5d0cd8b09405feb5e8c03cb4c (patch) | |
tree | 750dc0d731a80b338dd387122658b00252b7d93b /src/3rdparty/v8/src/api.cc | |
parent | f7d784789656ab94077c29dcb7816a5cb945e049 (diff) |
[V8] QtScript/V8: Add new v8 api to check if a value is an error.
New function v8::Value::IsError was created.
This API is experimental and added only for the purposes of our
research.
Change-Id: Id2f5a6728d15fc02ae3c03e6b49928afed0f62fa
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/3rdparty/v8/src/api.cc')
-rw-r--r-- | src/3rdparty/v8/src/api.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/3rdparty/v8/src/api.cc b/src/3rdparty/v8/src/api.cc index d681328..1becc61 100644 --- a/src/3rdparty/v8/src/api.cc +++ b/src/3rdparty/v8/src/api.cc @@ -2366,6 +2366,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); |