diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-10-11 15:06:25 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-10 13:22:13 +0100 |
commit | bcd16f9453e543ba819385d87bd7061a4caeb325 (patch) | |
tree | 4296919fa02e8188be3b28ca7fa4ab548693be33 /src/v8/0011-QtScript-V8-Add-new-v8-api-to-check-if-a-value-is-an.patch | |
parent | 95d7abb694d5d21acf0a15dcbf3feb4514bd2ab4 (diff) |
Update V8
Change-Id: Ic239ef1e55bed06260e4a04cc2199f64c2d30059
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/v8/0011-QtScript-V8-Add-new-v8-api-to-check-if-a-value-is-an.patch')
-rw-r--r-- | src/v8/0011-QtScript-V8-Add-new-v8-api-to-check-if-a-value-is-an.patch | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/v8/0011-QtScript-V8-Add-new-v8-api-to-check-if-a-value-is-an.patch b/src/v8/0011-QtScript-V8-Add-new-v8-api-to-check-if-a-value-is-an.patch deleted file mode 100644 index 7cbc2d474b..0000000000 --- a/src/v8/0011-QtScript-V8-Add-new-v8-api-to-check-if-a-value-is-an.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 5f3e5dd6901b54707ea4f868d8fa7317c4ab3852 Mon Sep 17 00:00:00 2001 -From: Jedrzej Nowacki <jedrzej.nowacki@nokia.com> -Date: Tue, 7 Dec 2010 11:56:42 +0100 -Subject: [PATCH 11/16] 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. ---- - include/v8.h | 5 +++++ - src/api.cc | 6 ++++++ - src/heap.h | 1 + - 3 files changed, 12 insertions(+), 0 deletions(-) - -diff --git a/include/v8.h b/include/v8.h -index 18527e1..43e00f5 100644 ---- a/include/v8.h -+++ b/include/v8.h -@@ -937,6 +937,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/api.cc b/src/api.cc -index 1a585d6..bd435eb 100644 ---- a/src/api.cc -+++ b/src/api.cc -@@ -2108,6 +2108,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/heap.h b/src/heap.h -index 8cbf378..db90bb9 100644 ---- a/src/heap.h -+++ b/src/heap.h -@@ -169,6 +169,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") \ --- -1.7.4.4 - |