Revision: 5227 Author: ant...@chromium.org Date: Tue Aug 10 02:53:56 2010 Log: Add v8::Value::IsRegExp method.
Patch by Vlad Burlik. Review URL: http://codereview.chromium.org/3064051 http://code.google.com/p/v8/source/detail?r=5227 Modified: /branches/bleeding_edge/AUTHORS /branches/bleeding_edge/include/v8.h /branches/bleeding_edge/src/api.cc ======================================= --- /branches/bleeding_edge/AUTHORS Thu Aug 5 03:56:15 2010 +++ /branches/bleeding_edge/AUTHORS Tue Aug 10 02:53:56 2010 @@ -29,4 +29,5 @@ Ryan Dahl <coldredle...@gmail.com> Subrato K De <subrato...@codeaurora.org> Burcu Dogan <burcujdo...@gmail.com> - +Vlad Burlik <vlad...@gmail.com> + ======================================= --- /branches/bleeding_edge/include/v8.h Mon Jul 19 06:26:25 2010 +++ /branches/bleeding_edge/include/v8.h Tue Aug 10 02:53:56 2010 @@ -919,6 +919,11 @@ */ V8EXPORT bool IsDate() const; + /** + * Returns true if this value is a RegExp. + */ + V8EXPORT bool IsRegExp() const; + V8EXPORT Local<Boolean> ToBoolean() const; V8EXPORT Local<Number> ToNumber() const; V8EXPORT Local<String> ToString() const; ======================================= --- /branches/bleeding_edge/src/api.cc Mon Aug 9 04:37:24 2010 +++ /branches/bleeding_edge/src/api.cc Tue Aug 10 02:53:56 2010 @@ -1790,6 +1790,13 @@ i::Handle<i::Object> obj = Utils::OpenHandle(this); return obj->HasSpecificClassOf(i::Heap::Date_symbol()); } + + +bool Value::IsRegExp() const { + if (IsDeadCheck("v8::Value::IsRegExp()")) return false; + i::Handle<i::Object> obj = Utils::OpenHandle(this); + return obj->IsJSRegExp(); +} Local<String> Value::ToString() const { -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev